Skip to main content

Tokenizer.

Merchants with membership or subscription systems can enhance customer convenience by utilizing our credit card recognition system (Tokenizer). To implement this feature, merchants must include the following additional parameters

Tokenizer

info

version 2.2.x version 2.3.x version 2.4.x Normally, the system will not be turned on. Merchants need to contact Customer Support (CS) to activate the Tokennizer mode before use

1. For first-time users of the credit card recognition system (Tokenizer):

Parameters

NameData Type Maximum Length Description
customerrefinteger and character10Merchant Member Reference Number

Example

Below is a sample HTML code snippet for testing the transmission of parameters to the e-payment system. Merchants can utilize this code by replacing the placeholders with their own merchantID and customer email values for test.

payment.html
<html>
<head>
<title>Paysolutoins Payment</title>
</head>
<body>
<form method="post" action="https://www.thaiepay.com/epaylink/payment.aspx">
<input type="hidden" name="customeremail" value="customer@email.com">
<input type="hidden" name="productdetail" value="product detail">
<input type="hidden" name="refno" value="123456789012">
<input type="hidden" name="merchantid" value="12345678">
<input type="hidden" name="cc" value="00">
<input type="hidden" name="total" value="400">
<!-- Tokenizer -->
<input type="hidden" name="customerref" value="1234567890">
<br>
<input type="submit" name="Submit" value="Comfirm Order">
</form>
</body>
</html>

Interface

When the customer chooses to pay with a credit card, the screen will appear a checkbox to save credit card information for the customer to choose for.

Tokenizer

After the customers choose to remember the card information, the system will remember it for the merchant to send the information to be used for the next time.

2. Retrieving customer data for registered credit cards:

If a customer has previously registered their credit card in the system, merchants can retrieve their data by calling the following API:

Parameters

NameDescription
apikeyContact staff for apikey
secretkeyContact staff to request secretkey
merchantIDLast 5 digits of MerchantID 12345678
customerRefMerchant member reference number

Command

curl --location --request POST 'https://apis.paysolutions.asia/tokenizer/getCustomerToken' \ 
-H 'Content-Type: application/json' \
-H 'apikey: xxxxxxx' \
-H 'secretkey: xxxxxxx' \
-d '{
"merchantId": "45678", "customerRef": "202101201"
}'

Response

The system will respond in JSON with the following values:

{
"status": 200,
"message": "Complete",
"data": "S2O1eaewrasdlkfnwovh0_23y_wlenf1owneQHewonvoryeryixGxwJuxjpoawenovpa_awienfo120_owenfo28qlncwyweryewyr",
"card": [
{ "id": "1", "card_tye": "M", "card_no": "xxxx-xxxx-5678" },
{ "id": "2", "card_tye": "V", "card_no": "xxxx-xxxx-1234" }
]
}

3. Merchants recognize credit cards.

After the credit card is recognized, the merchant must send the following parameters:

Parameters

NameData TypeMaximum LengthDescription
customerRefinteger and character10Merchant Member Reference Number
customertokencharacter1024Token number is the identity of the customer whose credit card has been memorized

Example

payment.html
<html>
<head>
<title>Paysolutoins Payment</title>
</head>
<body>
<form method="post" action="https://www.thaiepay.com/epaylink/payment.aspx">
<input type="hidden" name="customeremail" value="customer@email.com">
<input type="hidden" name="productdetail" value="product detail">
<input type="hidden" name="refno" value="123456789012">
<input type="hidden" name="merchantid" value="12345678">
<input type="hidden" name="cc" value="00">
<input type="hidden" name="total" value="400">
<!-- Tokenizer -->
<input type="hidden" name="customerref" value="1234567890">
<input type="hidden" name="customertoken" value="INvowLHVowovoslUE wobvow8923kjbwknvowLBWEOVow_wkejbf_woenfo123wleosweoiOWNVO_ 9vawoeOWONVO_lwenfPIwqon_wlr124lsd_g84p0URnhgowowobn49woowob_"">
<br>
<input type="submit" name="Submit" value="Comfirm Order">
</form>
</body>
</html>

Interface

During the payment process, the system will display the customer's previously saved credit card information, offering a convenient payment option.

Tokenizer

4. Canceling credit card recognition for registered cards

To remove a customer's previously registered credit card from the recognition system, merchants must call the following API with the specified information:

Parameters

NameDescription
apikeyContact staff for apikey
secretkeyContact staff to request secretkey
merchantIDLast 5 digits of MerchantID 12345678
customerRefMerchant member reference number

Command

curl -i -X POST 'https://apis.paysolutions.asia/tokenizer/removeCustomerCard' \ 
-H 'Content-Type: application/json' \
-H 'apikey: xxxxxxx' \
-H 'secretkey: xxxxxxx' \
-d '{
"merchantId": "45678", "customerRef": "202101201",
"customerToken": "xxxxxxx",
"cardID": "1"
}'

Response

The system will respond in JSON with the following values:

{
"status": 200,
"message": "Complete",
"card_no": "xxxx-xxxx-5678"
}