Collecting Payment Method with KHPP
Steps to start collecting payment method with KHPP:
- Display customer paid fees
- Redirecting to KHPP
- Multifactor Authentication and Payment Method Collection
- Retrieving the Payment Method Token
- Link customer with the payment method token
Redirecting to KHPP
When a customer wishes to input their payment method, redirect them to KHPP using the URL below:
https://vault-sandbox.ezypay.com/paymentmethod/korea
Mandatory URL Parameters
Parameter | Description | Type |
---|---|---|
token | Ezypay’s authentication token | String |
successUrl | The URL to redirect to once an outcome is reached. We will redirect to this URL regardless of whether we have successfully / unsuccessfully created a payment method token. | URL |
cancelUrl | The URL to redirect to if the user clicks on the ‘Cancel’ button. A payment method token would not have been created. | URL |
E.g. https://vault-sandbox.ezypay.com/paymentmethod/korea?token=TOKEN&successUrl=https://integrator.com/result&cancelUrl=https://integrator.com/cancel
Important
The token have a time to live of 60 minutes only. Remember to regenerate the KHPP URL with a new token once it has expired.
Multifactor Authentication and Payment Method Collection
After being redirected to KHPP, customer will need to enter their full name and agree to Ezypay's terms and conditions. After that, they will be redirected to payment provider hosted page to perform a multifactor authentication. After successful authentication, customer will need input their payment method details and send it over to Ezypay.
Retrieving the Payment Method Token
Upon completion, the customer is redirected to the successUrl
defined in KHPP URL with additional output parameters.
Output Parameters
Parameter | Description | Type | Example |
---|---|---|---|
paymentMethodToken | The newly created payment method token, if successfully created. | UUID | 538d8e17-eda3-4227-b129-f6d3e2916fe2 |
status | The status of the HPP process, whether it was successful or not. | String | SUCCESS / FAILURE |
errorCode | The error code provided from the HPP process if the status was FAILURE. | String | invalid_card_number |
errorMessage | The human friendly description of the error code from the HPP process, if the status was FAILURE. | String | ”Invalid card number provided” |
Example success result: https://integrator.com/result?paymentMethodToken=PAYMENT_TOKEN&status=SUCCESS
Example failure result: https://integrator.com/result?status=FAILURE&errorCode=invalid_card_number&errorDescription=”Invalid card number provided”
Store the payment method token in your database and link it with a customer. The token can then be used when creating invoice or subscription with Ezypay.
When an error is returned, display it to the customer and guide them through the payment method collection again.
Link Customer with the Payment Method Token
To use the payment method token returned by the HPP, attach it to a customer using the Create Payment Method API. Newly added payment method will automatically become the primary payment method if no payment method was linked to the customer.
After linking a payment method to a customer, ensure that the payment method data is stored and displayed within your platform. This allows the customer to easily identify the specific payment method.
Be aware that different payment methods have distinct objects storing their information. For more details, refer to the guide.
Customer Cancel the Process
In any event if the customer opt to cancel the payment method creation, they can do so by clicking the cancel button in the KHPP. In this case, customer will be redirected to the cancelUrl
of the KHPP URL without any parameter.
Example cancel result: https://integrator.com/cancel
Attention
KHPP does not support any customization.
Updated 2 months ago