消费
发起消费交易,消费成功时会产生实际扣款
curl --request POST \
--url https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay \
--header 'Content-Type: application/json' \
--header 'signature: <api-key>' \
--data '
{
"charset": "UTF-8",
"version": "2.0.0",
"signType": "RSA",
"memberId": "2023010558663764",
"merchantId": "2023010558663764",
"requestTime": "2024-05-24T14:29:32.682+08:00",
"keyVersion": "1",
"data": {
"merchantOrderId": "ORD202604231532478921",
"integrate": "Direct",
"captureMode": "MANUAL",
"subject": "Iphone 16",
"totalAmount": "10.01",
"currency": "USD",
"country": "US",
"userId": "U123333333",
"expireTime": "1800",
"paymentDetail": {
"paymentMethodType": "WALLET",
"targetOrg": "KLARNA",
"payAccountInfo": [
{
"accountNo": "125@gmail.com",
"accountNoType": "EMAIL"
}
],
"cardInfo": {
"cardNo": "4111111111111111",
"cardName": "John Tan",
"cardExpirationMonth": "12",
"cardExpirationYear": "28",
"cvv": "123",
"stored": "true",
"dynamic3DS": "true"
},
"buyerInfo": {
"firstName": "John",
"middleName": "Michael",
"email": "john.tan@example.com",
"lastName": "Tan",
"phoneNo": "+6591234567",
"phoneNoRegion": "+65",
"idType": "PASSPORT",
"idNo": "E12345678",
"taxType": "CPF",
"taxNo": "123.456.789-09",
"address": "10 Anson Road, #25-08 International Plaza",
"city": "Singapore",
"region": "Central",
"zipCode": "079903",
"clientIp": "203.0.113.42",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15"
},
"paymentTokenID": "ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a",
"tokenForFutureUse": true,
"merchantInitiated": "false",
"mitType": "SCHEDULED",
"info3DSecure": {
"threeDSVersion": "2.2.0",
"eci": "05",
"cavv": "AAABBBCCCDDDEEE111222333",
"dsTransactionId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"xid": "MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=="
},
"carrierId": "qiye"
},
"goodsDetails": [
{
"goodsId": "SKU_1000001",
"goodsName": "Wireless Bluetooth Earbuds",
"quantity": "2",
"price": "59.99",
"goodsCurrency": "USD",
"showUrl": "https://example.com/product/sku_1000001",
"goodsCategory": "Electronics"
}
],
"subMerchant": {
"subMerchantNo": "SM202604270001"
},
"shippingInfo": {
"firstName": "John",
"middleName": "string",
"lastName": "John",
"phoneNo": "+6598765432",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"region": "Central",
"state": "string",
"country": "SG",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"billingInfo": {
"firstName": "John",
"middleName": "Michael",
"lastName": "Tan",
"phoneNo": "+6591234567",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"country": "SG",
"region": "Central",
"state": "string",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"envInfo": {
"deviceId": "a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f",
"deviceLanguage": "en-US",
"screenHeight": "956",
"screenWidth": "440",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1"
},
"language": "EN",
"riskParams": {},
"terminalType": "APP",
"osType": "ANDROID",
"reference": "goods reference",
"frontCallbackUrl": "https://www.google.com",
"notifyUrl": "https://www.google.com",
"subscriptionPlan": {
"subscriptionNo": "SUB_202604270001"
}
}
}
'import requests
url = "https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay"
payload = {
"charset": "UTF-8",
"version": "2.0.0",
"signType": "RSA",
"memberId": "2023010558663764",
"merchantId": "2023010558663764",
"requestTime": "2024-05-24T14:29:32.682+08:00",
"keyVersion": "1",
"data": {
"merchantOrderId": "ORD202604231532478921",
"integrate": "Direct",
"captureMode": "MANUAL",
"subject": "Iphone 16",
"totalAmount": "10.01",
"currency": "USD",
"country": "US",
"userId": "U123333333",
"expireTime": "1800",
"paymentDetail": {
"paymentMethodType": "WALLET",
"targetOrg": "KLARNA",
"payAccountInfo": [
{
"accountNo": "125@gmail.com",
"accountNoType": "EMAIL"
}
],
"cardInfo": {
"cardNo": "4111111111111111",
"cardName": "John Tan",
"cardExpirationMonth": "12",
"cardExpirationYear": "28",
"cvv": "123",
"stored": "true",
"dynamic3DS": "true"
},
"buyerInfo": {
"firstName": "John",
"middleName": "Michael",
"email": "john.tan@example.com",
"lastName": "Tan",
"phoneNo": "+6591234567",
"phoneNoRegion": "+65",
"idType": "PASSPORT",
"idNo": "E12345678",
"taxType": "CPF",
"taxNo": "123.456.789-09",
"address": "10 Anson Road, #25-08 International Plaza",
"city": "Singapore",
"region": "Central",
"zipCode": "079903",
"clientIp": "203.0.113.42",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15"
},
"paymentTokenID": "ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a",
"tokenForFutureUse": True,
"merchantInitiated": "false",
"mitType": "SCHEDULED",
"info3DSecure": {
"threeDSVersion": "2.2.0",
"eci": "05",
"cavv": "AAABBBCCCDDDEEE111222333",
"dsTransactionId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"xid": "MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=="
},
"carrierId": "qiye"
},
"goodsDetails": [
{
"goodsId": "SKU_1000001",
"goodsName": "Wireless Bluetooth Earbuds",
"quantity": "2",
"price": "59.99",
"goodsCurrency": "USD",
"showUrl": "https://example.com/product/sku_1000001",
"goodsCategory": "Electronics"
}
],
"subMerchant": { "subMerchantNo": "SM202604270001" },
"shippingInfo": {
"firstName": "John",
"middleName": "string",
"lastName": "John",
"phoneNo": "+6598765432",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"region": "Central",
"state": "string",
"country": "SG",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"billingInfo": {
"firstName": "John",
"middleName": "Michael",
"lastName": "Tan",
"phoneNo": "+6591234567",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"country": "SG",
"region": "Central",
"state": "string",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"envInfo": {
"deviceId": "a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f",
"deviceLanguage": "en-US",
"screenHeight": "956",
"screenWidth": "440",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1"
},
"language": "EN",
"riskParams": {},
"terminalType": "APP",
"osType": "ANDROID",
"reference": "goods reference",
"frontCallbackUrl": "https://www.google.com",
"notifyUrl": "https://www.google.com",
"subscriptionPlan": { "subscriptionNo": "SUB_202604270001" }
}
}
headers = {
"signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {signature: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
charset: 'UTF-8',
version: '2.0.0',
signType: 'RSA',
memberId: '2023010558663764',
merchantId: '2023010558663764',
requestTime: '2024-05-24T14:29:32.682+08:00',
keyVersion: '1',
data: {
merchantOrderId: 'ORD202604231532478921',
integrate: 'Direct',
captureMode: 'MANUAL',
subject: 'Iphone 16',
totalAmount: '10.01',
currency: 'USD',
country: 'US',
userId: 'U123333333',
expireTime: '1800',
paymentDetail: {
paymentMethodType: 'WALLET',
targetOrg: 'KLARNA',
payAccountInfo: [{accountNo: '125@gmail.com', accountNoType: 'EMAIL'}],
cardInfo: {
cardNo: '4111111111111111',
cardName: 'John Tan',
cardExpirationMonth: '12',
cardExpirationYear: '28',
cvv: '123',
stored: 'true',
dynamic3DS: 'true'
},
buyerInfo: {
firstName: 'John',
middleName: 'Michael',
email: 'john.tan@example.com',
lastName: 'Tan',
phoneNo: '+6591234567',
phoneNoRegion: '+65',
idType: 'PASSPORT',
idNo: 'E12345678',
taxType: 'CPF',
taxNo: '123.456.789-09',
address: '10 Anson Road, #25-08 International Plaza',
city: 'Singapore',
region: 'Central',
zipCode: '079903',
clientIp: '203.0.113.42',
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15'
},
paymentTokenID: 'ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a',
tokenForFutureUse: true,
merchantInitiated: 'false',
mitType: 'SCHEDULED',
info3DSecure: {
threeDSVersion: '2.2.0',
eci: '05',
cavv: 'AAABBBCCCDDDEEE111222333',
dsTransactionId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
xid: 'MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=='
},
carrierId: 'qiye'
},
goodsDetails: [
{
goodsId: 'SKU_1000001',
goodsName: 'Wireless Bluetooth Earbuds',
quantity: '2',
price: '59.99',
goodsCurrency: 'USD',
showUrl: 'https://example.com/product/sku_1000001',
goodsCategory: 'Electronics'
}
],
subMerchant: {subMerchantNo: 'SM202604270001'},
shippingInfo: {
firstName: 'John',
middleName: 'string',
lastName: 'John',
phoneNo: '+6598765432',
email: 'john.tan@example.com',
address1: '10 Anson Road',
city: 'Singapore',
region: 'Central',
state: 'string',
country: 'SG',
zipCode: '079903',
address2: '#25-08 International Plaza',
address3: 'string'
},
billingInfo: {
firstName: 'John',
middleName: 'Michael',
lastName: 'Tan',
phoneNo: '+6591234567',
email: 'john.tan@example.com',
address1: '10 Anson Road',
city: 'Singapore',
country: 'SG',
region: 'Central',
state: 'string',
zipCode: '079903',
address2: '#25-08 International Plaza',
address3: 'string'
},
envInfo: {
deviceId: 'a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f',
deviceLanguage: 'en-US',
screenHeight: '956',
screenWidth: '440',
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
},
language: 'EN',
riskParams: {},
terminalType: 'APP',
osType: 'ANDROID',
reference: 'goods reference',
frontCallbackUrl: 'https://www.google.com',
notifyUrl: 'https://www.google.com',
subscriptionPlan: {subscriptionNo: 'SUB_202604270001'}
}
})
};
fetch('https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay', 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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay",
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([
'charset' => 'UTF-8',
'version' => '2.0.0',
'signType' => 'RSA',
'memberId' => '2023010558663764',
'merchantId' => '2023010558663764',
'requestTime' => '2024-05-24T14:29:32.682+08:00',
'keyVersion' => '1',
'data' => [
'merchantOrderId' => 'ORD202604231532478921',
'integrate' => 'Direct',
'captureMode' => 'MANUAL',
'subject' => 'Iphone 16',
'totalAmount' => '10.01',
'currency' => 'USD',
'country' => 'US',
'userId' => 'U123333333',
'expireTime' => '1800',
'paymentDetail' => [
'paymentMethodType' => 'WALLET',
'targetOrg' => 'KLARNA',
'payAccountInfo' => [
[
'accountNo' => '125@gmail.com',
'accountNoType' => 'EMAIL'
]
],
'cardInfo' => [
'cardNo' => '4111111111111111',
'cardName' => 'John Tan',
'cardExpirationMonth' => '12',
'cardExpirationYear' => '28',
'cvv' => '123',
'stored' => 'true',
'dynamic3DS' => 'true'
],
'buyerInfo' => [
'firstName' => 'John',
'middleName' => 'Michael',
'email' => 'john.tan@example.com',
'lastName' => 'Tan',
'phoneNo' => '+6591234567',
'phoneNoRegion' => '+65',
'idType' => 'PASSPORT',
'idNo' => 'E12345678',
'taxType' => 'CPF',
'taxNo' => '123.456.789-09',
'address' => '10 Anson Road, #25-08 International Plaza',
'city' => 'Singapore',
'region' => 'Central',
'zipCode' => '079903',
'clientIp' => '203.0.113.42',
'userAgent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15'
],
'paymentTokenID' => 'ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a',
'tokenForFutureUse' => true,
'merchantInitiated' => 'false',
'mitType' => 'SCHEDULED',
'info3DSecure' => [
'threeDSVersion' => '2.2.0',
'eci' => '05',
'cavv' => 'AAABBBCCCDDDEEE111222333',
'dsTransactionId' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'xid' => 'MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=='
],
'carrierId' => 'qiye'
],
'goodsDetails' => [
[
'goodsId' => 'SKU_1000001',
'goodsName' => 'Wireless Bluetooth Earbuds',
'quantity' => '2',
'price' => '59.99',
'goodsCurrency' => 'USD',
'showUrl' => 'https://example.com/product/sku_1000001',
'goodsCategory' => 'Electronics'
]
],
'subMerchant' => [
'subMerchantNo' => 'SM202604270001'
],
'shippingInfo' => [
'firstName' => 'John',
'middleName' => 'string',
'lastName' => 'John',
'phoneNo' => '+6598765432',
'email' => 'john.tan@example.com',
'address1' => '10 Anson Road',
'city' => 'Singapore',
'region' => 'Central',
'state' => 'string',
'country' => 'SG',
'zipCode' => '079903',
'address2' => '#25-08 International Plaza',
'address3' => 'string'
],
'billingInfo' => [
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Tan',
'phoneNo' => '+6591234567',
'email' => 'john.tan@example.com',
'address1' => '10 Anson Road',
'city' => 'Singapore',
'country' => 'SG',
'region' => 'Central',
'state' => 'string',
'zipCode' => '079903',
'address2' => '#25-08 International Plaza',
'address3' => 'string'
],
'envInfo' => [
'deviceId' => 'a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f',
'deviceLanguage' => 'en-US',
'screenHeight' => '956',
'screenWidth' => '440',
'userAgent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
],
'language' => 'EN',
'riskParams' => [
],
'terminalType' => 'APP',
'osType' => 'ANDROID',
'reference' => 'goods reference',
'frontCallbackUrl' => 'https://www.google.com',
'notifyUrl' => 'https://www.google.com',
'subscriptionPlan' => [
'subscriptionNo' => 'SUB_202604270001'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"signature: <api-key>"
],
]);
$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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay"
payload := strings.NewReader("{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("signature", "<api-key>")
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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay")
.header("signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": "00000003",
"message": "处理中",
"traceId": "33fae7b7aed1233f",
"data": {
"status": "SUCCESS",
"merchantId": "2023010558663764",
"merchantOrderId": "167812677182888888",
"orderId": "TR1658354573473091584",
"currency": "USD",
"totalAmount": "10.01",
"nextAction": {
"contentType": "application/json",
"data": {},
"method": "GET",
"qrcode": "weixin://wxpay/bizpayurl?pr=waUjCuPzz",
"type": "render_qrcode",
"url": "https://www.google.com"
}
}
}授权
加签(Signature)
加签是 Payloco 开放平台与商户之间用于保障报文完整性和防篡改的安全机制。
适用场景
- 商户请求 Payloco:商户使用自身私钥对请求报文进行加签。
- Payloco 返回响应:商户使用 Payloco 公钥 对响应报文进行验签。
加签规则(商户请求端)
商户需对 HTTP 请求的 Body 进行签名,具体步骤如下:
1. 计算签名(SHA256withRSA)
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(merchantPrivateKey);
// 必须使用 UTF-8 编码
byte[] bodyBytes = requestBody.getBytes(StandardCharsets.UTF_8);
signature.update(bodyBytes);
byte[] signedBytes = signature.sign();
2. 将加签内容进行 Base64 编码;
String signature = Base64.getEncoder().encodeToString(signedHash);
3. 将编码后的内容放在请求头部 signature 参数中。
POST /v2/payments/open/api/pay HTTP/1.1
Content-Type: application/json
signature: MIIC8jCCAdqgAwIBAgI...
请求头
签名
"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
请求体
交互数据的编码【utf-8】
"UTF-8"
接口版本,当前版本为【2.0.0】,目前只能传2.0.0,不能不传
8"2.0.0"
报文签名类型
"RSA"
机构号
"2023010558663764"
商户号
32"2023010558663764"
请求时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ssSSS+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2026-05-20T13:29:35.262+08:00表示,北京时间2026年5月20日13点29分35秒。
32"2026-05-24T14:29:32.682+08:00"
密钥版本 当前值为:1
8"1"
请求数据体
Show child attributes
Show child attributes
curl --request POST \
--url https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay \
--header 'Content-Type: application/json' \
--header 'signature: <api-key>' \
--data '
{
"charset": "UTF-8",
"version": "2.0.0",
"signType": "RSA",
"memberId": "2023010558663764",
"merchantId": "2023010558663764",
"requestTime": "2024-05-24T14:29:32.682+08:00",
"keyVersion": "1",
"data": {
"merchantOrderId": "ORD202604231532478921",
"integrate": "Direct",
"captureMode": "MANUAL",
"subject": "Iphone 16",
"totalAmount": "10.01",
"currency": "USD",
"country": "US",
"userId": "U123333333",
"expireTime": "1800",
"paymentDetail": {
"paymentMethodType": "WALLET",
"targetOrg": "KLARNA",
"payAccountInfo": [
{
"accountNo": "125@gmail.com",
"accountNoType": "EMAIL"
}
],
"cardInfo": {
"cardNo": "4111111111111111",
"cardName": "John Tan",
"cardExpirationMonth": "12",
"cardExpirationYear": "28",
"cvv": "123",
"stored": "true",
"dynamic3DS": "true"
},
"buyerInfo": {
"firstName": "John",
"middleName": "Michael",
"email": "john.tan@example.com",
"lastName": "Tan",
"phoneNo": "+6591234567",
"phoneNoRegion": "+65",
"idType": "PASSPORT",
"idNo": "E12345678",
"taxType": "CPF",
"taxNo": "123.456.789-09",
"address": "10 Anson Road, #25-08 International Plaza",
"city": "Singapore",
"region": "Central",
"zipCode": "079903",
"clientIp": "203.0.113.42",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15"
},
"paymentTokenID": "ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a",
"tokenForFutureUse": true,
"merchantInitiated": "false",
"mitType": "SCHEDULED",
"info3DSecure": {
"threeDSVersion": "2.2.0",
"eci": "05",
"cavv": "AAABBBCCCDDDEEE111222333",
"dsTransactionId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"xid": "MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=="
},
"carrierId": "qiye"
},
"goodsDetails": [
{
"goodsId": "SKU_1000001",
"goodsName": "Wireless Bluetooth Earbuds",
"quantity": "2",
"price": "59.99",
"goodsCurrency": "USD",
"showUrl": "https://example.com/product/sku_1000001",
"goodsCategory": "Electronics"
}
],
"subMerchant": {
"subMerchantNo": "SM202604270001"
},
"shippingInfo": {
"firstName": "John",
"middleName": "string",
"lastName": "John",
"phoneNo": "+6598765432",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"region": "Central",
"state": "string",
"country": "SG",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"billingInfo": {
"firstName": "John",
"middleName": "Michael",
"lastName": "Tan",
"phoneNo": "+6591234567",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"country": "SG",
"region": "Central",
"state": "string",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"envInfo": {
"deviceId": "a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f",
"deviceLanguage": "en-US",
"screenHeight": "956",
"screenWidth": "440",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1"
},
"language": "EN",
"riskParams": {},
"terminalType": "APP",
"osType": "ANDROID",
"reference": "goods reference",
"frontCallbackUrl": "https://www.google.com",
"notifyUrl": "https://www.google.com",
"subscriptionPlan": {
"subscriptionNo": "SUB_202604270001"
}
}
}
'import requests
url = "https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay"
payload = {
"charset": "UTF-8",
"version": "2.0.0",
"signType": "RSA",
"memberId": "2023010558663764",
"merchantId": "2023010558663764",
"requestTime": "2024-05-24T14:29:32.682+08:00",
"keyVersion": "1",
"data": {
"merchantOrderId": "ORD202604231532478921",
"integrate": "Direct",
"captureMode": "MANUAL",
"subject": "Iphone 16",
"totalAmount": "10.01",
"currency": "USD",
"country": "US",
"userId": "U123333333",
"expireTime": "1800",
"paymentDetail": {
"paymentMethodType": "WALLET",
"targetOrg": "KLARNA",
"payAccountInfo": [
{
"accountNo": "125@gmail.com",
"accountNoType": "EMAIL"
}
],
"cardInfo": {
"cardNo": "4111111111111111",
"cardName": "John Tan",
"cardExpirationMonth": "12",
"cardExpirationYear": "28",
"cvv": "123",
"stored": "true",
"dynamic3DS": "true"
},
"buyerInfo": {
"firstName": "John",
"middleName": "Michael",
"email": "john.tan@example.com",
"lastName": "Tan",
"phoneNo": "+6591234567",
"phoneNoRegion": "+65",
"idType": "PASSPORT",
"idNo": "E12345678",
"taxType": "CPF",
"taxNo": "123.456.789-09",
"address": "10 Anson Road, #25-08 International Plaza",
"city": "Singapore",
"region": "Central",
"zipCode": "079903",
"clientIp": "203.0.113.42",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15"
},
"paymentTokenID": "ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a",
"tokenForFutureUse": True,
"merchantInitiated": "false",
"mitType": "SCHEDULED",
"info3DSecure": {
"threeDSVersion": "2.2.0",
"eci": "05",
"cavv": "AAABBBCCCDDDEEE111222333",
"dsTransactionId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"xid": "MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=="
},
"carrierId": "qiye"
},
"goodsDetails": [
{
"goodsId": "SKU_1000001",
"goodsName": "Wireless Bluetooth Earbuds",
"quantity": "2",
"price": "59.99",
"goodsCurrency": "USD",
"showUrl": "https://example.com/product/sku_1000001",
"goodsCategory": "Electronics"
}
],
"subMerchant": { "subMerchantNo": "SM202604270001" },
"shippingInfo": {
"firstName": "John",
"middleName": "string",
"lastName": "John",
"phoneNo": "+6598765432",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"region": "Central",
"state": "string",
"country": "SG",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"billingInfo": {
"firstName": "John",
"middleName": "Michael",
"lastName": "Tan",
"phoneNo": "+6591234567",
"email": "john.tan@example.com",
"address1": "10 Anson Road",
"city": "Singapore",
"country": "SG",
"region": "Central",
"state": "string",
"zipCode": "079903",
"address2": "#25-08 International Plaza",
"address3": "string"
},
"envInfo": {
"deviceId": "a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f",
"deviceLanguage": "en-US",
"screenHeight": "956",
"screenWidth": "440",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1"
},
"language": "EN",
"riskParams": {},
"terminalType": "APP",
"osType": "ANDROID",
"reference": "goods reference",
"frontCallbackUrl": "https://www.google.com",
"notifyUrl": "https://www.google.com",
"subscriptionPlan": { "subscriptionNo": "SUB_202604270001" }
}
}
headers = {
"signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {signature: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
charset: 'UTF-8',
version: '2.0.0',
signType: 'RSA',
memberId: '2023010558663764',
merchantId: '2023010558663764',
requestTime: '2024-05-24T14:29:32.682+08:00',
keyVersion: '1',
data: {
merchantOrderId: 'ORD202604231532478921',
integrate: 'Direct',
captureMode: 'MANUAL',
subject: 'Iphone 16',
totalAmount: '10.01',
currency: 'USD',
country: 'US',
userId: 'U123333333',
expireTime: '1800',
paymentDetail: {
paymentMethodType: 'WALLET',
targetOrg: 'KLARNA',
payAccountInfo: [{accountNo: '125@gmail.com', accountNoType: 'EMAIL'}],
cardInfo: {
cardNo: '4111111111111111',
cardName: 'John Tan',
cardExpirationMonth: '12',
cardExpirationYear: '28',
cvv: '123',
stored: 'true',
dynamic3DS: 'true'
},
buyerInfo: {
firstName: 'John',
middleName: 'Michael',
email: 'john.tan@example.com',
lastName: 'Tan',
phoneNo: '+6591234567',
phoneNoRegion: '+65',
idType: 'PASSPORT',
idNo: 'E12345678',
taxType: 'CPF',
taxNo: '123.456.789-09',
address: '10 Anson Road, #25-08 International Plaza',
city: 'Singapore',
region: 'Central',
zipCode: '079903',
clientIp: '203.0.113.42',
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15'
},
paymentTokenID: 'ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a',
tokenForFutureUse: true,
merchantInitiated: 'false',
mitType: 'SCHEDULED',
info3DSecure: {
threeDSVersion: '2.2.0',
eci: '05',
cavv: 'AAABBBCCCDDDEEE111222333',
dsTransactionId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
xid: 'MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=='
},
carrierId: 'qiye'
},
goodsDetails: [
{
goodsId: 'SKU_1000001',
goodsName: 'Wireless Bluetooth Earbuds',
quantity: '2',
price: '59.99',
goodsCurrency: 'USD',
showUrl: 'https://example.com/product/sku_1000001',
goodsCategory: 'Electronics'
}
],
subMerchant: {subMerchantNo: 'SM202604270001'},
shippingInfo: {
firstName: 'John',
middleName: 'string',
lastName: 'John',
phoneNo: '+6598765432',
email: 'john.tan@example.com',
address1: '10 Anson Road',
city: 'Singapore',
region: 'Central',
state: 'string',
country: 'SG',
zipCode: '079903',
address2: '#25-08 International Plaza',
address3: 'string'
},
billingInfo: {
firstName: 'John',
middleName: 'Michael',
lastName: 'Tan',
phoneNo: '+6591234567',
email: 'john.tan@example.com',
address1: '10 Anson Road',
city: 'Singapore',
country: 'SG',
region: 'Central',
state: 'string',
zipCode: '079903',
address2: '#25-08 International Plaza',
address3: 'string'
},
envInfo: {
deviceId: 'a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f',
deviceLanguage: 'en-US',
screenHeight: '956',
screenWidth: '440',
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
},
language: 'EN',
riskParams: {},
terminalType: 'APP',
osType: 'ANDROID',
reference: 'goods reference',
frontCallbackUrl: 'https://www.google.com',
notifyUrl: 'https://www.google.com',
subscriptionPlan: {subscriptionNo: 'SUB_202604270001'}
}
})
};
fetch('https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay', 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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay",
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([
'charset' => 'UTF-8',
'version' => '2.0.0',
'signType' => 'RSA',
'memberId' => '2023010558663764',
'merchantId' => '2023010558663764',
'requestTime' => '2024-05-24T14:29:32.682+08:00',
'keyVersion' => '1',
'data' => [
'merchantOrderId' => 'ORD202604231532478921',
'integrate' => 'Direct',
'captureMode' => 'MANUAL',
'subject' => 'Iphone 16',
'totalAmount' => '10.01',
'currency' => 'USD',
'country' => 'US',
'userId' => 'U123333333',
'expireTime' => '1800',
'paymentDetail' => [
'paymentMethodType' => 'WALLET',
'targetOrg' => 'KLARNA',
'payAccountInfo' => [
[
'accountNo' => '125@gmail.com',
'accountNoType' => 'EMAIL'
]
],
'cardInfo' => [
'cardNo' => '4111111111111111',
'cardName' => 'John Tan',
'cardExpirationMonth' => '12',
'cardExpirationYear' => '28',
'cvv' => '123',
'stored' => 'true',
'dynamic3DS' => 'true'
],
'buyerInfo' => [
'firstName' => 'John',
'middleName' => 'Michael',
'email' => 'john.tan@example.com',
'lastName' => 'Tan',
'phoneNo' => '+6591234567',
'phoneNoRegion' => '+65',
'idType' => 'PASSPORT',
'idNo' => 'E12345678',
'taxType' => 'CPF',
'taxNo' => '123.456.789-09',
'address' => '10 Anson Road, #25-08 International Plaza',
'city' => 'Singapore',
'region' => 'Central',
'zipCode' => '079903',
'clientIp' => '203.0.113.42',
'userAgent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15'
],
'paymentTokenID' => 'ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a',
'tokenForFutureUse' => true,
'merchantInitiated' => 'false',
'mitType' => 'SCHEDULED',
'info3DSecure' => [
'threeDSVersion' => '2.2.0',
'eci' => '05',
'cavv' => 'AAABBBCCCDDDEEE111222333',
'dsTransactionId' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'xid' => 'MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw=='
],
'carrierId' => 'qiye'
],
'goodsDetails' => [
[
'goodsId' => 'SKU_1000001',
'goodsName' => 'Wireless Bluetooth Earbuds',
'quantity' => '2',
'price' => '59.99',
'goodsCurrency' => 'USD',
'showUrl' => 'https://example.com/product/sku_1000001',
'goodsCategory' => 'Electronics'
]
],
'subMerchant' => [
'subMerchantNo' => 'SM202604270001'
],
'shippingInfo' => [
'firstName' => 'John',
'middleName' => 'string',
'lastName' => 'John',
'phoneNo' => '+6598765432',
'email' => 'john.tan@example.com',
'address1' => '10 Anson Road',
'city' => 'Singapore',
'region' => 'Central',
'state' => 'string',
'country' => 'SG',
'zipCode' => '079903',
'address2' => '#25-08 International Plaza',
'address3' => 'string'
],
'billingInfo' => [
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Tan',
'phoneNo' => '+6591234567',
'email' => 'john.tan@example.com',
'address1' => '10 Anson Road',
'city' => 'Singapore',
'country' => 'SG',
'region' => 'Central',
'state' => 'string',
'zipCode' => '079903',
'address2' => '#25-08 International Plaza',
'address3' => 'string'
],
'envInfo' => [
'deviceId' => 'a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f',
'deviceLanguage' => 'en-US',
'screenHeight' => '956',
'screenWidth' => '440',
'userAgent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
],
'language' => 'EN',
'riskParams' => [
],
'terminalType' => 'APP',
'osType' => 'ANDROID',
'reference' => 'goods reference',
'frontCallbackUrl' => 'https://www.google.com',
'notifyUrl' => 'https://www.google.com',
'subscriptionPlan' => [
'subscriptionNo' => 'SUB_202604270001'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"signature: <api-key>"
],
]);
$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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay"
payload := strings.NewReader("{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("signature", "<api-key>")
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://gate.uat.payloco.com/gateway/v2/payments/open/api/pay")
.header("signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gate.uat.payloco.com/gateway/v2/payments/open/api/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charset\": \"UTF-8\",\n \"version\": \"2.0.0\",\n \"signType\": \"RSA\",\n \"memberId\": \"2023010558663764\",\n \"merchantId\": \"2023010558663764\",\n \"requestTime\": \"2024-05-24T14:29:32.682+08:00\",\n \"keyVersion\": \"1\",\n \"data\": {\n \"merchantOrderId\": \"ORD202604231532478921\",\n \"integrate\": \"Direct\",\n \"captureMode\": \"MANUAL\",\n \"subject\": \"Iphone 16\",\n \"totalAmount\": \"10.01\",\n \"currency\": \"USD\",\n \"country\": \"US\",\n \"userId\": \"U123333333\",\n \"expireTime\": \"1800\",\n \"paymentDetail\": {\n \"paymentMethodType\": \"WALLET\",\n \"targetOrg\": \"KLARNA\",\n \"payAccountInfo\": [\n {\n \"accountNo\": \"125@gmail.com\",\n \"accountNoType\": \"EMAIL\"\n }\n ],\n \"cardInfo\": {\n \"cardNo\": \"4111111111111111\",\n \"cardName\": \"John Tan\",\n \"cardExpirationMonth\": \"12\",\n \"cardExpirationYear\": \"28\",\n \"cvv\": \"123\",\n \"stored\": \"true\",\n \"dynamic3DS\": \"true\"\n },\n \"buyerInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"email\": \"john.tan@example.com\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"phoneNoRegion\": \"+65\",\n \"idType\": \"PASSPORT\",\n \"idNo\": \"E12345678\",\n \"taxType\": \"CPF\",\n \"taxNo\": \"123.456.789-09\",\n \"address\": \"10 Anson Road, #25-08 International Plaza\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"zipCode\": \"079903\",\n \"clientIp\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15\"\n },\n \"paymentTokenID\": \"ptok_9f1c2e7a6b5d4c3a8e0f1b2c3d4e5f6a\",\n \"tokenForFutureUse\": true,\n \"merchantInitiated\": \"false\",\n \"mitType\": \"SCHEDULED\",\n \"info3DSecure\": {\n \"threeDSVersion\": \"2.2.0\",\n \"eci\": \"05\",\n \"cavv\": \"AAABBBCCCDDDEEE111222333\",\n \"dsTransactionId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"xid\": \"MDAwMDAwMDAwMDAwMDAwMDAwWDEyMw==\"\n },\n \"carrierId\": \"qiye\"\n },\n \"goodsDetails\": [\n {\n \"goodsId\": \"SKU_1000001\",\n \"goodsName\": \"Wireless Bluetooth Earbuds\",\n \"quantity\": \"2\",\n \"price\": \"59.99\",\n \"goodsCurrency\": \"USD\",\n \"showUrl\": \"https://example.com/product/sku_1000001\",\n \"goodsCategory\": \"Electronics\"\n }\n ],\n \"subMerchant\": {\n \"subMerchantNo\": \"SM202604270001\"\n },\n \"shippingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"string\",\n \"lastName\": \"John\",\n \"phoneNo\": \"+6598765432\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"country\": \"SG\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"billingInfo\": {\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Tan\",\n \"phoneNo\": \"+6591234567\",\n \"email\": \"john.tan@example.com\",\n \"address1\": \"10 Anson Road\",\n \"city\": \"Singapore\",\n \"country\": \"SG\",\n \"region\": \"Central\",\n \"state\": \"string\",\n \"zipCode\": \"079903\",\n \"address2\": \"#25-08 International Plaza\",\n \"address3\": \"string\"\n },\n \"envInfo\": {\n \"deviceId\": \"a3f5c9e2-7b4d-4c1a-9f6e-2d8b7a1c0e5f\",\n \"deviceLanguage\": \"en-US\",\n \"screenHeight\": \"956\",\n \"screenWidth\": \"440\",\n \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1\"\n },\n \"language\": \"EN\",\n \"riskParams\": {},\n \"terminalType\": \"APP\",\n \"osType\": \"ANDROID\",\n \"reference\": \"goods reference\",\n \"frontCallbackUrl\": \"https://www.google.com\",\n \"notifyUrl\": \"https://www.google.com\",\n \"subscriptionPlan\": {\n \"subscriptionNo\": \"SUB_202604270001\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": "00000003",
"message": "处理中",
"traceId": "33fae7b7aed1233f",
"data": {
"status": "SUCCESS",
"merchantId": "2023010558663764",
"merchantOrderId": "167812677182888888",
"orderId": "TR1658354573473091584",
"currency": "USD",
"totalAmount": "10.01",
"nextAction": {
"contentType": "application/json",
"data": {},
"method": "GET",
"qrcode": "weixin://wxpay/bizpayurl?pr=waUjCuPzz",
"type": "render_qrcode",
"url": "https://www.google.com"
}
}
}