curl --request POST \
--url https://uat-interface.haipay.asia/twd/collect/apply \
--header 'Content-Type: application/json' \
--data '
{
"appId": 1054,
"orderId": "M233323000059",
"name": "John Doe",
"phone": "+886912345678",
"email": "john.doe@example.com",
"amount": "100.00",
"payType": "ONLINE_BANKING",
"inBankCode": "CARD",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"country": "TW",
"currency": "TWD",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
'import requests
url = "https://uat-interface.haipay.asia/twd/collect/apply"
payload = {
"appId": 1054,
"orderId": "M233323000059",
"name": "John Doe",
"phone": "+886912345678",
"email": "john.doe@example.com",
"amount": "100.00",
"payType": "ONLINE_BANKING",
"inBankCode": "CARD",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"country": "TW",
"currency": "TWD",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 1054,
orderId: 'M233323000059',
name: 'John Doe',
phone: '+886912345678',
email: 'john.doe@example.com',
amount: '100.00',
payType: 'ONLINE_BANKING',
inBankCode: 'CARD',
callBackUrl: 'https://merchant.com/payment/success',
callBackFailUrl: 'https://merchant.com/payment/fail',
notifyUrl: 'https://merchant.com/api/notify',
subject: 'Payment for order',
body: JSON.stringify('Premium subscription'),
country: 'TW',
currency: 'TWD',
partnerUserId: '149597870',
sign: 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
})
};
fetch('https://uat-interface.haipay.asia/twd/collect/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uat-interface.haipay.asia/twd/collect/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appId' => 1054,
'orderId' => 'M233323000059',
'name' => 'John Doe',
'phone' => '+886912345678',
'email' => 'john.doe@example.com',
'amount' => '100.00',
'payType' => 'ONLINE_BANKING',
'inBankCode' => 'CARD',
'callBackUrl' => 'https://merchant.com/payment/success',
'callBackFailUrl' => 'https://merchant.com/payment/fail',
'notifyUrl' => 'https://merchant.com/api/notify',
'subject' => 'Payment for order',
'body' => 'Premium subscription',
'country' => 'TW',
'currency' => 'TWD',
'partnerUserId' => '149597870',
'sign' => 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://uat-interface.haipay.asia/twd/collect/apply"
payload := strings.NewReader("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://uat-interface.haipay.asia/twd/collect/apply")
.header("Content-Type", "application/json")
.body("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://uat-interface.haipay.asia/twd/collect/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}"
response = http.request(request)
puts response.read_body{
"status": "1",
"error": "00000000",
"msg": "success",
"data": {
"orderId": "M233323000059",
"orderNo": "6023071013539074",
"payUrl": "https://pay.haipay.asia/cashier/1L9zQS2",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
}Collection Application
Use the appId corresponding to TWD. After successful user payment, the TWD balance will be increased.
curl --request POST \
--url https://uat-interface.haipay.asia/twd/collect/apply \
--header 'Content-Type: application/json' \
--data '
{
"appId": 1054,
"orderId": "M233323000059",
"name": "John Doe",
"phone": "+886912345678",
"email": "john.doe@example.com",
"amount": "100.00",
"payType": "ONLINE_BANKING",
"inBankCode": "CARD",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"country": "TW",
"currency": "TWD",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
'import requests
url = "https://uat-interface.haipay.asia/twd/collect/apply"
payload = {
"appId": 1054,
"orderId": "M233323000059",
"name": "John Doe",
"phone": "+886912345678",
"email": "john.doe@example.com",
"amount": "100.00",
"payType": "ONLINE_BANKING",
"inBankCode": "CARD",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"country": "TW",
"currency": "TWD",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 1054,
orderId: 'M233323000059',
name: 'John Doe',
phone: '+886912345678',
email: 'john.doe@example.com',
amount: '100.00',
payType: 'ONLINE_BANKING',
inBankCode: 'CARD',
callBackUrl: 'https://merchant.com/payment/success',
callBackFailUrl: 'https://merchant.com/payment/fail',
notifyUrl: 'https://merchant.com/api/notify',
subject: 'Payment for order',
body: JSON.stringify('Premium subscription'),
country: 'TW',
currency: 'TWD',
partnerUserId: '149597870',
sign: 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
})
};
fetch('https://uat-interface.haipay.asia/twd/collect/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uat-interface.haipay.asia/twd/collect/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appId' => 1054,
'orderId' => 'M233323000059',
'name' => 'John Doe',
'phone' => '+886912345678',
'email' => 'john.doe@example.com',
'amount' => '100.00',
'payType' => 'ONLINE_BANKING',
'inBankCode' => 'CARD',
'callBackUrl' => 'https://merchant.com/payment/success',
'callBackFailUrl' => 'https://merchant.com/payment/fail',
'notifyUrl' => 'https://merchant.com/api/notify',
'subject' => 'Payment for order',
'body' => 'Premium subscription',
'country' => 'TW',
'currency' => 'TWD',
'partnerUserId' => '149597870',
'sign' => 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://uat-interface.haipay.asia/twd/collect/apply"
payload := strings.NewReader("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://uat-interface.haipay.asia/twd/collect/apply")
.header("Content-Type", "application/json")
.body("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://uat-interface.haipay.asia/twd/collect/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"John Doe\",\n \"phone\": \"+886912345678\",\n \"email\": \"john.doe@example.com\",\n \"amount\": \"100.00\",\n \"payType\": \"ONLINE_BANKING\",\n \"inBankCode\": \"CARD\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"country\": \"TW\",\n \"currency\": \"TWD\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}"
response = http.request(request)
puts response.read_body{
"status": "1",
"error": "00000000",
"msg": "success",
"data": {
"orderId": "M233323000059",
"orderNo": "6023071013539074",
"payUrl": "https://pay.haipay.asia/cashier/1L9zQS2",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
}Secret Key & Private Key (Generate Signature)
Related Topics
Body
Business ID (obtained from the backend, needs to pass the corresponding business ID according to the currency in the URL)
Merchant order number
48User’s full name. Recommended to use real name. Format: firstName and lastName separated by a space. Example: John Doe
Real phone number
Real email
Transaction amount. For TWD orders, decimals are not allowed
Transaction type
Redirect URL after successful payment
Redirect URL after failed payment
Payment note
Unique user identifier (e.g., userId). Used for risk control. Must be valid, otherwise it will affect the transaction. Allowed format: numbers, uppercase/lowercase letters, or common symbols -~!@#$%&*()_.
^[A-Za-z0-9\-~!@#$%&*()_]+$Signature
Callback URL
Additional details
Required for cashier mode, fixed value: 158
Currency (default TWD; supported currencies: USD, TWD)
USD, TWD Was this page helpful?

