iFrame

The instructions below show how you can process accordingly for each platform type and how API Configurations operate.

 

A. Process flow

 

B. Explanation

 

Step 1: The customer makes a payment for an order on merchant's website.

Step 2: Merchant initiates the transaction and embeds the 9Pay payment iFrame on the e-commerce website.

Steps 3 and 4: Customer enters payment information and verifies the payment.

Steps 5 and 6: After customer completes the payment steps on 9Pay Payment Gateway, if the transaction is successful, 9Pay will send IPN (Instant Payment Notification) transaction status information to merchant's website as registered with 9Pay.

Step 7: Customer is redirected back to merchant's website via the return_url provided by merchant in Step 2.

Step 8: Merchant displays the transaction result to customer.

Step 9: Approximately 20 minutes after creating the payment URL, if IPN is not received, merchant proactively queries the transaction status to update the transaction result.

Not receiving IPN can occur due to network issues, service unavailability, or other reasons.

 

C. API configuration

 

Integration Rules

 

1. Embedding the iFrame

In the iFrame embedding section, the merchant needs to create two parameters, namely baseEncode and Signature, similar to the Integration Rules. The baseEncode parameter should be base64 encoded with payment creation parameters and the signature generated from these parameters according to the instructions.

Example for reference: https://gitlab.com/9pay-sample/sample-sdk

 

2. Payment

You can use ATM Cards Test to process payment.

  • Bank: Vietcombank

  • Card number: 9704000000000018

  • Card holder: NGUYEN VAN A

  • Expire date: 03/07

  • Otp: OTP

 

3. Processing payment result

Pay attention to duplicate handling when receiving results for a transaction using both methods.

 

Return

After the payment process is completed, the customer is redirected to the return_url provided by the merchant when creating the payment URL.

The merchant uses this result to display a notification of the successful/failed transaction to the customer (contained within the query string when returning to the merchant's link). 

 

IPN - Instant Payment Notification

After a successful payment transaction, 9Pay will send a POST request (x-www-form-data) to the merchant's registered IPN_url address.

 

Data reponse

Attribute Type Required Description
result String yes Transaction information
checksum String yes The checksum code generated using the merchant's result and checksum key
version String   IPN version

 

The value in the result after decoding:

Attribute Type Required Description
payment_no Number yes 9Pay's transaction id
invoice_no String yes Order id of merchant, unique for each request
amount Number yes Payment amount
description String (255) yes Order's information
method String yes  ATM_CARD 
currency String (10) yes Currency
created_at Array yes Example: 1335939007 (UTC+0, length=10)
card_brand String yes Bank name
status Number yes Transaction status
failure_reason String yes Error description
card_info Array yes Payment information data
card_info.card_name String yes The name of the cardholder printed on the card
card_info.card_brand String yes The issuing bank of the card
card_info.card_number String yes The card number in the format 123456xxxxxx6789
card_info.expire_date String yes The card's expiration date and issue date.

 

4. See also