React Native SDK(v2) - Merchant's checkout
Please follow steps below to setup React Native SDK and start accepting payment via PortOne.
For initial SDK installation set up refer here
After inital setup, Install the package
Add peer dependencies
#
Access saved cards via React Native SDKImport the chaiport-sdk library
Initialize the checkout instance as below
Capture the mobile number and OTP to fetch the saved cards for a particular user. To generate the OTP, call the method as below:
Response: contains data, status
Status code :
200 - Success
400 - Failed due to incorrect OTP or wrong params provideed
After successfully entered the OTP, the captured mobile number and OTP should provide to the fetchSavedCards as below to fetch the saved cards for the particular number.
formattedText: Contains mobile number with Country code. (eg: +16625655248 , +918341234123)
OTP: OTP that received to the particular number given.
response:
Success case
Failure case:
#
Payload parameter listParameter | Datatype | Obligatory/Optional | Description |
---|---|---|---|
portOneKey | Text | Obligatory | PortOne Key provided to merchants |
paymentChannel | Text | Obligatory | Name of the payment channel |
paymentMethod | Text | Obligatory | Payment Method to be used |
environment | Text | Obligatory | Environment of the payment |
description | Text | Optional | Order description set in PSP order creation |
merchantOrderId | Text | Obligatory | Order reference given by merchant ID |
amount | Numeric[1,12] | Obligatory | Amount for transaction |
currency | Text | Obligatory | Currency for transaction |
billingDetails | Optional | Details of billing | |
shippingDetails | Optional | Details of shipping | |
merchantDetails | Optional | Merchant details | |
orderDetails | Obligatory | Order Details like quantity, id, name, price are Obligatory, while image is Optional | |
successUrl | Obligatory | Redirection url for success | |
failureUrl | Obligatory | Redirection url for failure | |
token_params | Obligatory | if saved cards or new cards flow, its Obligatory, token params like card_number, card_holder_name, cvv, expiry_month, expiry_year | |
signatureHash | Obligatory | Signature calculated using this link |
#
Environment Flagprovide the environment
flag in above payload. Environment is the mandatory field, by default the value of environment is sandbox
while initiating payment.
#
Initiate payment with a new credit card for a particular numberCollect the card details and provide them to startPaymentWithNewCard method as below:
Params:
cardDetails: Contains card name, card number, expiry month, expiry year and CVV
Payload : provide the transaction payload
JWTToken: provide the JWT token
client key: provide the provided Client key
customerUUID: provide the customer UUId if merchant card vault is enabled
subMerchantKey: provide the sub merchant key for sub merchant flow
data
Response
Success case
Failure case:
#
Initiate payment with a saved credit card for a particular numberCollect the card details and provide them to the startPaymentWithSavedCard method as below:
Params:
cardDetails: Contains card name, card number, expiry month, expiry year and CVV
Payload : provide the transaction payload
JWTToken: provide the JWT token
client key: provide the provided Client key
data
Response
Success case
Failure case:
#
Initiate payment with a walletCollect the payload and provide them to the startPaymentWithWallets method as below:
- payload
#
Initiate payment with a non tokenization flowCollect the payload and provide them to the startPaymentWithoutTokenization method as below:
#
Fetch available payment methods for a merchantCollect the portOneKey, currency and provide them to the getAvailablePaymentMethods method as below:
#
Merchant centric card vaultCollect the customerId, clientKey, JWTToken and cardData and provide them to the addCardForCustomerId method as below:
- cardData
Collect the customerId, clientKey, JWTToken and cardData and provide them to the deleteCardForCustomerId method as below:
- cardData
Collect the customerId, clientKey, JWTToken and provide them to the fetchCustomerCards method as below:
Collect the customerData, clientKey, JWTToken and provide them to the addCustomer method as below:
customerData
Collect the customerID, customerData, clientKey, JWTToken and provide them to the getCustomerData method as below:
#
Failover RoutingTo support failover routing add the following two parameters to payload:
isRoutingEnabled= true
Routing Param type should be failover.
provide the Routing Ref which is set in the merchant portal.
To Fetch the List of Routes which are created from merchant portal
- Collect the clientKey, JWTToken and provide them to the fetchRoutes method as below:
#
PreAuth and Capture PaymentTo implement PreAuth one parameter has to be set: transactionType= PREAUTH || PURCHASE
To Capture the Payment
- Collect the transactionOrderRef, clientKey, JWTToken and provide them to the captureTransactionAPI method as below:
Steps for Signature Hash Generation