Collecting Payment Method with KHPP

Steps to start collecting payment method with KHPP:

  1. Display customer paid fees
  2. Redirecting to KHPP
  3. Multifactor Authentication and Payment Method Collection
  4. Retrieving the Payment Method Token
  5. 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

ParameterDescriptionType
tokenEzypay’s authentication tokenString
successUrlThe 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
cancelUrlThe 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

ParameterDescriptionTypeExample
paymentMethodTokenThe newly created payment method token, if successfully created.UUID538d8e17-eda3-4227-b129-f6d3e2916fe2
statusThe status of the HPP process, whether it was successful or not.StringSUCCESS / FAILURE
errorCodeThe error code provided from the HPP process if the status was FAILURE.Stringinvalid_card_number
errorMessageThe 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.