React Native SDK - Embed(V3)
#
1. OverviewThe PortOne React Native SDK allows merchants to seamlessly integrate the PortOne Payment Gateway into their React Native applications, enabling secure and efficient payment processing. Integrate the PortOne React Native SDK to start accepting payments via PortOne.
#
2. Video TutorialFor a detailed guide on integrating the PortOne iOS SDK and using a payment method flow, refer to the following video tutorial:
#
3. Sample AppCheck out the sample app for integration on GitHub.
#
4. PrerequisitesCreate 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.
#
5. Integration Steps#
5.1. Configure iOS for Deep LinkingUpdate
info.plist
Add URL schemes
Add URL schemes for other apps
Enable HTTP connections
#
5.2. Configure Android for Deep LinkingUpdate
AndroidManifest.xml
Add intent filter
#
5.3. Install the SDKCreate
.npmrc
FileAdd the following to the
.npmrc
file in your project directoryInstall SDK and Dependencies
Run the following commands in your project terminal
#
5.4. Obtain JWT TokenGenerate JWT Token
Implement server-side logic to generate a JWT token using
portoneKey
.Retrieve Token in iOS
Implement logic in your iOS app to fetch and securely store the JWT token.
#
5.5. Generate Signature HashGenerate Signature
Use HmacSHA256 to create a signature hash for your payload.
#
5.6. Initialize PortOne SDKImport SDK
Initialize Checkout
#
6. Checkout Using Web (v3)PortOne's web checkout simplifies the integration by handling the payment UI within the SDK.
Open Checkout UI
Handle Response
#
Sample Payload#
Sample ResponseSuccess Case:
Failure Case:
#
7. TroubleshootingINVALID_UNAUTHORIZED_JWT_TOKEN_ERROR
- Verify PortOne Key and Secret Key.
- Ensure JWT token starts with
Bearer
.
INVALID_UNAUTHORIZED_TRANSACTION_SIGNATURE_ERROR
- Confirm payload parameters and PortOne Key match.
INVALID_UNAUTHORIZED_TRANSACTION_IAMPORTKEY_ERROR
- Check PortOne Key alignment.
INVALID_PAYMENT_CHANNEL
- Verify payment channels and methods are enabled.
INVALID_ENVIRONMENT
- Ensure environment is set to
sandbox
orlive
.
- Ensure environment is set to
Order Value Mismatch
- Confirm total amount matches the sum of items, shipping charges, and discounts.
For further assistance, refer to the official documentation or contact support