An Expo Config Plugin for the Square In-App Payments SDK that makes it easy to accept payments in your React Native app. This plugin handles all the necessary iOS and Android configuration for the Square SDK.
- Configures Apple Pay for iOS with merchant identifiers
- Adds Google Pay support for Android (optional)
- Handles all required build configurations for both platforms
- Sets up Square In-App Payments SDK build scripts correctly
npm install --dev square-expo-plugin
# or
yarn add --dev square-expo-pluginAdd the plugin to your Expo config in app.json or app.config.js:
{
"expo": {
"plugins": [
[
"square-expo-plugin",
{
"merchantIdentifier": "merchant.com.yourcompany.app",
"enableGooglePay": true
}
]
]
}
}| Option | Type | Description | Default |
|---|---|---|---|
merchantIdentifier |
string or string[] |
Apple Pay merchant identifier(s) | [] |
enableGooglePay |
boolean |
Enable Google Pay support for Android | false |
After installing and configuring the plugin, you can use the Square In-App Payments SDK in your app:
import { initializePaymentForm } from "react-native-square-in-app-payments";
// Follow Square SDK documentation for usageRefer to the Square React Native In-App Payments SDK documentation for complete usage instructions.
- Expo SDK 52 or higher
- react-native-square-in-app-payments ^1.7.6
This plugin:
- Adds the required merchant identifiers for Apple Pay to your iOS entitlements
- Creates a necessary Swift compatibility file
- Configures the Square payment SDK build scripts
- Sets up Google Pay metadata in Android Manifest (if enabled)
- If you see "Missing merchant identifier" errors, check that you've provided the correct
merchantIdentifierin your plugin config - Ensure you've set up your Apple Pay merchant account correctly in the Apple Developer Portal
- For Google Pay issues, verify your Square developer account is properly configured for Google Pay
MIT
Contributions are welcome! Please feel free to submit a pull request.