React Native SDK - Connect(V2)
Integrate the PortOne React Native SDK to start accepting payments via PortOne.
Integrate with React Native SDK#
The PortOne React Native SDK allows merchants to seamlessly integrate the PortOne Payment Gateway into their React Native applications, enabling secure and efficient payment processing.
Video Tutorial#
For a detailed guide on integrating the PortOne iOS SDK and using a payment method flow, refer to the following video tutorial
Sample App#
Check out the sample app for integration on GitHub.
Prerequisites#
Create a PortOne Account
- Sign up on PortOne to access services and functionalities.
Access API Keys
- Log in to the PortOne portal to obtain API Keys (client key and secret key) under Settings -> API tab.
Enable Payment Channels and Methods
- Customize and enable payment channels and methods as per your requirements.
React Native Application
- Ensure you have a React Native application ready for SDK integration.
Integration#
1. Enable Deep Link in iOS#
Add URL schemes and identifier in info.plist
Include URL schemes in info.plist to open other applications
Add HTTP connection support in info.plist
2. Enable Deep Link in Android#
Add an intent filter in AndroidManifest.xml
3. Install the SDK#
Add .npmrc file to the project directory
Install the SDK and peer dependencies
4. Obtain JWT Token#
Generate a JWT token using
portoneKeyon the server.Retrieve and store the JWT token securely in your iOS app.
For more details, refer to Authentication | PortOne.
5. Generate Signature Hash#
Generate a Signature Hash using HmacSHA256 for inclusion in the payload. For details, refer to Payment Request | PortOne.
6. Initialize PortOne RN SDK#
Import the SDK library
Initialize the checkout instance
Payment Methods#
New Credit Card Payment#
Collect card details and use the
startPaymentWithNewCardmethodHandle the web view response in
afterCheckout
Saved Card Payment#
Use the
startPaymentWithSavedCardmethod
Wallet Payment#
Use the
startPaymentWithWalletsmethod
Non-Tokenized Payment#
Use the
startPaymentWithoutTokenizationmethod
Fetch Available Payment Methods#
Use the
getAvailablePaymentMethodsmethod
Merchant-Centric Card Vault#
Add Card for Customer
Delete Card for Customer
Fetch Customer Cards
Add Customer
Get Customer Data
Failover Routing#
Enable failover routing in payload
Fetch list of routes
PreAuth and Capture Payment#
Pre-Authorization
Capture Payment
Payload Parameters#
| Parameter | Data Type | Mandatory |
|---|---|---|
| portOneKey | String | Yes |
| merchantDetails | Object | No |
| merchantOrderId | String | Yes |
| signatureHash | String | Yes |
| amount | Double | Yes |
| currency | String | Yes |
| countryCode | String | Yes |
| billingDetails | Object | No |
| shippingDetails | Object | No |
| orderDetails | Array | No |
| successUrl | String | Yes |
| failureUrl | String | Yes |
| expiryHours | Int | Yes |
| source | String | Yes |
| description | String | No |
| showShippingDetails | Boolean | No |
| showBackButton | Boolean | No |
| defaultGuestCheckout | Boolean | No |
| isCheckoutEmbed | Boolean | No |
| redirectUrl | String | Yes |
| environment | String | Yes |
MerchantDetails
| Parameter | Data Type | Optional |
|---|---|---|
| name | String | Yes |
| logo | String | Yes |
| returnUrl | String | Yes |
| merchantId | String | No |
| mcc | String | No |
OrderDetails
| Parameter | Data Type | Optional |
|---|---|---|
| title | String | Yes |
| description | String | Yes |
| quantity | Int | Yes |
| price | Double | Yes |
BillingDetails
| Parameter | Data Type | Optional |
|---|---|---|
| address | String | Yes |
| city | String | Yes |
| country | String | Yes |
| postalCode | String | Yes |
| phone | String | Yes |
ShippingDetails
| Parameter | Data Type | Optional |
|---|---|---|
| address | String | Yes |
| city | String | Yes |
| country | String | Yes |
| postalCode | String | Yes |
| phone | String | Yes |
Support#
For additional support or questions, please contact the PortOne support team.