React Native(v4)- Customizable UI Elements
Please follow steps below to setup React Native SDK and start accepting UI elements via PortOne.
For initial SDK installation set up refer here
- After inital setup, Install the package
- Add peer dependencies
Elements#
Checkout UI#
- Import from portone sdk as below
Payload parameter list#
| Parameter | 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 | |
| signatureHash | Obligatory | Signature calculated using this link |
Environment Flag#
Pass the environment flag in above payload. Environment is the mandatory field, by default the value of environment is sandbox while initiating payment.
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| selectedProducts | object | yes | Should provide the selected products |
| payload | object | yes | Should provide the transaction payload |
| JWTtoken | string | yes | Should provide the JWT token |
| themeColor | String | no | Changes the view colour |
| layout | int | No | To change the UI layout |
| onClose | func | No | Callback when on close clicks |
| callbackFunction | func | Yes | Callback when any update in the transaction |
| showShippingAddressView | bool | No | To show the shipping address view |
| showSavedCardsView | bool | No | To show the Saved cards view |
| showCartDetailsView | bool | No | To show the Cart details view |
| customerUUID | string | No | Provide when merchant card vault enabled |
| showCartDetailsView | string | No | Provide when sub merchant flow enabled |


Sample payload
Payment Methods List#
- Import from portone sdk as below
Input :
| Params | Data type | Mandatory | Description | |
|---|---|---|---|---|
| customHandle | Boolean | No | Based on the boolean transaction initiation will be handled by the element. | |
| Payload | Object | Yes, if customHandle is false | Payload required to initiate the payment | |
| headerTitle | String | No | Default payment methods | |
| To display the title of the elemennt | ||||
| headerFontSize | Int | No | Default 14 | |
| Changes the header style | ||||
| headerFontWeight | string | No | Default “normal” | |
| Changes the header style | ||||
| fontSize | Int | No | Default 14 | |
| Changes the items style | ||||
| fontWeight | String | No | Default “normal” | |
| Changes the items style | ||||
| selectedData | func | yes, if customHandle is true | provides the selected method | |
| selectedProducts | Array | No | To show the selected Products on the transaction status screen. | |
| deliveryAmount | Int | No | Delivery amount for the particular transaction, if exists | |
| removeBorder | Bool | No | To remove the border Lines | |
| newCardData | func | No | Passes the entered card details | |
| atmCardClicked | func | No | Callbacks after atm card option selected | |
| themeColor | string | No | Changes border color and header Title to themeColor | |
| customerUUID | string | No | Provide when merchant card vault enabled | |
| subMerchantKey | string | No | Provide when sub merchant flow enabled |
- Output :
- if customHandle is true,
- Share the selected payment method details (should be as per the params required in init payment) back to the merchant
- if customHandle is false,
- Initiate the transaction and displays the status
- if customHandle is true,

Wallets#
- Import from portone sdk as below
Input :
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| customHandle | Boolean | No | if true, transaction initiation will be handled by the element. |
| If false, provides the selected method via selectedData Method | |||
| Payload | Object | Yes, if customHandle is false | Payload required to initiate the payment |
| headerTitle | String | No | Default payment methods |
| To display the title of the element | |||
| subMerchantKey | string | no | provides it when sub merchant flow enabled |
| selectedData | func | yes, if customHandle is true | provides the selected method |
| selectedProducts | Array | No | To show the selected Products on the transaction status screen. |
| deliveryAmount | Int | No | Delivery amount for the particular transaction, if exists |
| themeColor | string | No | Changes border color and header Title to themeColor |
- Output :
- if customHandle is true,
- Share the selected payment method details (should be as per the params required in init payment) back to the merchant
- if customHandle is false,
- Initiate the transaction and displays the status
- if customHandle is true,

Credit Card Details#
- Import from portone sdk as below
Input :
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| handleSDK | Bool | No | Based on the param, handles transaction from SDK side |
| containerHeight | String | No | Height of the bottom sheet view |
| showSaveForLater | Bool | No | Option to show save card view |
| headerTitle | String | Yes | Title for the bottom sheet |
| payNowButtonText | String | Yes | Title for the Pay now button |
| payload | String | Yes | Provide transaction payload |
| jwtToken | String | Yes | Provide JWT Token |
| themeColor | string | No | Changes border color and header Title to themeColor |
| newCardData | func | No | Passes the entered card Details |
| customerUUID | string | No | Provide when merchant card vault enabled |
| subMerchantKey | string | No | Provide when sub merchant flow enabled |
| | | | |
- Output :
- Provided credit card Details

Mobile Authentication Flow#
- Import from portone sdk as below
- Input
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| containerHeight | String | No | Height of the bottom sheet view |
| savedCardsData | func | Yes | Provides the saved card data |
| Onclose | func | Yes | Dismiss the bottom sheet view |
| headerTitle | String | Yes | Title for the bottom sheet |
| payNowButtonText | String | Yes | Title for the Pay now button |
| payload | String | Yes | Provide transaction payload |
| jwtToken | String | Yes | Provide JWT Token |
| themeColor | string | No | Changes border color and header Title to themeColor |
- Output - Share the fetched saved cards for the particular number

Get Saved Cards#
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| showAuthenticationFlow | Bool | yes | To show the authentication flow |
| showSheet | Bool | Yes | to display the view |
| payNow | func | yes | Clicks on pay now button with selected data |
| checkBoxColor | string | No | Changes checkbox colour |
| checkBoxHeight | Int | No | height of the checkbox field |
| nameFontSize | Int | No | Style of the name text |
| nameFontWeight | String | No | Style of the name text Font |
| subNameFontSize | Int | No | Style of the description text |
| subNameFontWeight | String | No | Style of the description text font |
| imageWidth | Int | No | width of the image |
| imageHeight | Int | No | Height of the image |
| imageResizeMode | String | No | default contain |
| containerHorizontalPadding | Int | No | Changes the horizontal padding |
| containerVerticalPadding | Int | No | Changes the vertical padding |
| headerTitle | String | No | Default Saved Cards |
| headerTitleFont | Int | No | style of header title font size |
| headerTitleWeight | Int | No | style of header title font weight |
| headerImageWidth | Int | No | - |
| headerImageHeight | Int | No | - |
| headerImageResizeMode | String | No | Default contain |
| selectedItem | func | yes | Passes the selected Item |
- Input
- Show Authentication flow - false
- Provide the fetched saved card details
- Show Authentication flow - true
- No input Params
- Show Authentication flow - false
- Output
Share the Selected Saved card details

Pay Now button#
Input :
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| disabled | Bool | No | Default false, to disable the button |
| textFontSize | Int | No | Default 14 |
| Changes the items style | |||
| textFontWeight | String | No | Default “800” |
| Changes the items style | |||
| themeColor | string | No | Changes backgroungColor to themeColor |
| textColor | String | No | Default “White” |
| borderRadius | Int | No | To add Corner radius to the button |
| height | Int | No | Height of the button |
| width | Int | No | Height of the button |
| text | String | No | Button Text. Default Pay now |
| payload | object | yes | pass the whole payload to initiate the payment |
- Logic - Call the init payment request and handle the payment flow using web view, redirection
- Output - Share the final payment status and details back to the merchant

Cart Section#
- Input
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| selectedProducts | Object | Yes | Should pass the selected Items to display |
| nameFontSize | Int | No | Changes the items style |
| descriptionSize | Int | No | Changes the items style |
| amountFontSize | Int | No | Changes the items style |
| nameFontWeight | String | No | Changes the items style |
| descriptionFontWeight | String | No | Changes the items style |
| amountFontWeight | String | No | Changes the items style |
| borderRadius | Int | No | Changes border radius of item view |
| textColor | String | No | Default “White” |
| borderRadius | Int | No | To add Corner radius to the button |
| borderWidth | Int | No | Default 1 |
| headerText | String | No | Default Net payable |
| orderSummaryText | String | No | Default Order details |
| showCancel | Bool | yes | Should show cancel Icon |
| removeItem | func | no | Mandatory if show cancel is true |
| Provides the deleted data. | |||
| themeColor | String | No | changes the colour for the view |
| removeBorder | Bool | no | To show or hide the border colour |
| borderColor | String | no | colour of he item view border |
| headerFont | Int | No | |
| headerFontWeight | String | No |
Output - Displays on cart section UI

Cart Summary#
- Input - Merchant share cart summary details
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| hideHeaderView | Bool | no | To hide/show the header part |
| removeBorder | Bool | No | To remove the border Colour |
| deliveryAmount | Int | yes | Provide the delivery amount |
| totalAmount | Int | yes | Provide the total amount |
| amountTitle | String | No | Name for amount title |
| deliveryTitle | String | No | Name for Devlivery title |
| summaryTitle | String | No | Name for Summary title |
| amountFont | Int | No | Font of the amount |
| deliveryFont | Int | No | Font of the delivery field |
| summaryFont | Int | No | Font of the summary field |
| amountFontWeight | String | No | Changes the font weight style |
| deliveryFontWeight | String | No | Changes the font weight style |
| summaryFontWeight | String | No | Changes the font weight style |
| amountColor | String | No | Colour of the amount text |
| deliveryColor | String | No | Colour of the delivery text |
| summaryColor | String | No | Colour of the summary text |
| backgroundColor | String | No | Default “transparent” |
- Output - Displays on cart summary UI

Transaction Status Page#
- Input - Merchant shares transaction response and cart details
| Params | Data type | Mandatory | Description |
|---|---|---|---|
| selectedProducts | object | yes | Should share the selected products |
| deliveryAmount | Float | yes | provide the delivery amount |
| orderDetails | object | yes | provide the items deatils |
| showSheet | Bool | yes | To hide / show the view |
| onClose | func | yes | when on close clicks, it triggeres |
| themeColor | String | No | To add the required colour |
| payload | object | yes | payload of the transaction |
- Output - Displays the details on the success page UI
