Web SDK Integration
Payment Flow#
Refer following sequence diagram to get gist of payment flow via PortOne platform

note
- Both SandboxandProductionmode integration can be managed via same APIs and same account on PortOne platform.
- Please refer following instructions to use appropriate environmentflags while integration.
Embed Script#
Embed following JS snippet in your Checkout UI
New setup details#
For integration embed the following scripts in your Checkout UI code.
tip
Refer Integration Sheet to check the extensive list of available Payment Channels & Payment Methods for Integration in your country.
Parameter list for Payment Service#
| Parameter | Datatype | Obligatory/Optional | Description | 
|---|---|---|---|
| key | string | Obligatory | The unique PortOne key for merchant | 
| pmt_channel | string | Obligatory | The Payment Channel Key listed in PortOne docs | 
| pmt_method | string | Obligatory | The Payment Method Key listed in PortOne docs | 
| environment | string | Obligatory | The environment of the transaction is either live OR sandbox | 
| description | string | Obligatory | The description of the transaction | 
| merchant_order_id | string | Obligatory | The unique merchant order reference generated by the merchant | 
| amount | double | Obligatory | The amount of transaction, can be a floating-point number | 
| currency | string | Obligatory | The currency of transaction | 
| billing_details | object | Optional | The JSON object for billing details | 
| shipping_details | object | Optional | The JSON object for shipping details | 
| order_details | array of objects | Optional | Order Details like quantity, id, name, price are Obligatory, while image is Optional | 
| success_url | string | Obligatory | The url of success page hosted by merchant. | 
| failure_url | string | Obligatory | The url of failure page hosted by merchant. | 
| pending_url | string | Obligatory | The url of pending page hosted by merchant. | 
| signature_hash | string | Obligatory | Signature calculated using this link | 
Parameter list for Checkout Service#
| Parameter | Datatype | Obligatory/Optional | Description | 
|---|---|---|---|
| environment | string | Obligatory | The environment of the transaction is either live OR sandbox | 
| description | string | Obligatory | The description of the transaction | 
| merchant_order_id | string | Obligatory | The unique merchant order reference generated by the merchant | 
| amount | double | Obligatory | The amount of transaction, can be a floating-point number | 
| currency | string | Obligatory | The currency of transaction | 
| billing_details | object | Optional | The JSON object for billing details | 
| shipping_details | object | Optional | The JSON object for shipping details | 
| merchant_details | object | Obligatory | The JSON object for merchant details | 
| order_details | array of objects | Optional | TOrder Details like quantity, id, name, price are Obligatory, while image is Optional | 
| success_url | string | Obligatory | The url of success page hosted by merchant. | 
| failure_url | string | Obligatory | The url of failure page hosted by merchant. | 
| signature_hash | string | 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.
Production
Sandbox
Payment Service#
Use following JS code snippet to initiate the payment using the respective supported payment channels (e.g. MOMO, ZaloPay, Mastercard, etc).
To generate the signature hash, refer Generate Signature Hash link.
Detailed script for payment service (including optional fields.)
Checkout Service#
Use following JS code snippet to initiate the payment in checkout service using the respective supported payment channels (e.g. MomoPay, ZaloPay, Mastercard, etc).
To generate the signature hash, refer Generate Signature Hash link.
To generate the jwt token, refer Generate JWT Token link.