Requests

Requests


Pay

The Pay action can be used to perform a payment

Base JSON request

Use the base request as instructed on this page

Pay request

Parameters

Service specific parameters

Parameter Type Required Recommended Description
Locale string Possible values: en-US, zh-CN, zh-TW. Determines the displayed language for the customer. If the parameter is not provided, the language is English (default). Suggestion for implementation: use the billing address in the order information. If the billing country is China, send value zh-CN. If the billing country is Taiwan, send value zh-TW. Anything else, send value en-US. Another option is to check the customer's browser language.
Basic parameters

Example request

{
   "Currency": "EUR",
   "AmountDebit": 10,
   "Invoice": "Testinvoice 1234",
   "Services": {
      "ServiceList": [
         {
            "Name": "WeChatPay",
            "Action": "Pay",
            "Parameters": [
               {
                  "Name": "Locale",
                  "Value": "en-US"
               }
            ]
         }
      ]
   }
}

Pay response

The response contains two URL's; the RedirectURL and the QrCodeUrl. In general, the consumer should be redirected to the RedirectURL; a QR code will then be displayed to the customer to complete the payment. For mobile devices, this will not intiate the WeChat app, making this payment option not applicable for mobile payments.

Parameters

Service specific parameters

Parameter Type Required Recommended Description
QrCodeUrl string The QrCodeUrl can be used for displaying the QR code on POS devices. But in general (for e-commerce transactions), the RedirectURL should be used to redirect the customer.
BankStatementId string ID that will be shown on the customer’s bank statement.
expirytimestamp string Timestamp that shows when the WeChat Pay QR code will no longer be valid.
Basic parameters

Example response

{
   "Key": "79FF157971FD401B8BD50952E09EXXXX",
   "Status": {
      "Code": {
         "Code": 791,
         "Description": "Pending processing"
      },
      "SubCode": {
         "Code": "S002",
         "Description": "An additional action is required: Redirect to WeChatPay."
      },
      "DateTime": "2019-10-18T13:07:12"
   },
   "RequiredAction": {
      "RedirectURL": "https://testcheckout.buckaroo.nl/html/redirect.ashx?r=465007051FE74DD2B323AFCCAC2AXXXX",
      "RequestedInformation": null,
      "PayRemainderDetails": null,
      "Name": "Redirect",
      "TypeDeprecated": 0
   },
   "Services": [
      {
         "Name": "WeChatPay",
         "Action": null,
         "Parameters": [
            {
               "Name": "expirytimestamp",
               "Value": "1571404000"
            },
            {
               "Name": "BankStatementId",
               "Value": "3E154AA"
            },
            {
               "Name": "QrCodeUrl",
               "Value": "weixin://wxpay/bizpayurl?pr=LOqdxxx"
            }
         ]
      }
   ],
   "CustomParameters": null,
   "AdditionalParameters": null,
   "RequestErrors": null,
   "Invoice": "Testinvoice 1234",
   "ServiceCode": "WeChatPay",
   "IsTest": true,
   "Currency": "EUR",
   "AmountDebit": 10,
   "TransactionType": "C050",
   "MutationType": 1,
   "RelatedTransactions": null,
   "ConsumerMessage": null,
   "Order": null,
   "IssuingCountry": null,
   "StartRecurrent": false,
   "Recurring": false,
   "CustomerName": null,
   "PayerHash": null,
   "PaymentKey": "57FBEE1B06DE41B0ACBDED6B6A44XXXX"
}

Pay push

After successful completion of the payment by the customer, a push response will follow with the final transaction status.

Parameters

Service specific parameters

Parameter Type Required Recommended Description
QrCodeUrl string The QrCodeUrl can be used for displaying it on POS devices. But in general (for e-commerce transactions), the RedirectURL should be used to redirect the customer.
ConsumerAmount decimal The amount that has been paid in the consumer's currency.
ConsumerCurrency string The currency in which the payment has been done.
Basic parameters

Example push

{
   "Transaction": {
      "Key": "9D2C9F2938E24B7D8A3165F7BDA4XXXX",
      "Invoice": "Testinvoice 1234",
      "ServiceCode": "WeChatPay",
      "Status": {
         "Code": {
            "Code": 190,
            "Description": "Success"
         },
         "SubCode": {
            "Code": "S990",
            "Description": "The request was successful."
         },
         "DateTime": "2019-08-07T12:30:13"
      },
      "IsTest": true,
      "Order": null,
      "Currency": "EUR",
      "AmountDebit": 0.01,
      "TransactionType": "C050",
      "Services": [
         {
            "Name": "WeChatPay",
            "Action": null,
            "Parameters": [
               {
                  "Name": "QrCodeUrl",
                  "Value": "weixin://wxpay/bizpayurl?pr=XYZXXXX"
               },
               {
                  "Name": "ConsumerAmount",
                  "Value": "7"
               },
               {
                  "Name": "ConsumerCurrency",
                  "Value": "CNY"
               }
            ],
            "VersionAsProperty": 1
         }
      ],
      "CustomParameters": null,
      "AdditionalParameters": null,
      "MutationType": 1,
      "RelatedTransactions": null,
      "IsCancelable": false,
      "IssuingCountry": null,
      "StartRecurrent": false,
      "Recurring": false,
      "CustomerName": null,
      "PayerHash": null,
      "PaymentKey": "1EAB3CFDE6914B01BD8A7C4B8EAFXXXX"
   }
}

Refund

This action can be used to perform a refund on a WeChatPay transaction.

Base JSON request

Use the base request as instructed on this page

Refund request

Parameters

Basic parameters

Example request

{
   "Currency": "EUR",
   "AmountCredit": 0.01,
   "Invoice": "testinvoice 1234",
   "OriginalTransactionKey": "9D2C9F2938E24B7D8A3165F7BDA4Exxx",
   "Services": {
      "ServiceList": [
         {
            "Name": "wechatpay",
            "Action": "refund"
         }
      ]
   }
}

Pay response

Parameters

Basic parameters

Example response

{
   "Key": "B4A21C5F70A940088EA85A6E5BBBAxxx",
   "Status": {
      "Code": {
         "Code": 190,
         "Description": "Success"
      },
      "SubCode": {
         "Code": "S990",
         "Description": "The request was successful."
      },
      "DateTime": "2019-08-21T16:20:28"
   },
   "RequiredAction": null,
   "Services": null,
   "CustomParameters": null,
   "AdditionalParameters": null,
   "RequestErrors": null,
   "Invoice": "testinvoice 1234",
   "ServiceCode": "WeChatPay",
   "IsTest": true,
   "Currency": "EUR",
   "AmountCredit": 0.01,
   "TransactionType": "C051",
   "MutationType": 1,
   "RelatedTransactions": [
      {
         "RelationType": "refund",
         "RelatedTransactionKey": "9D2C9F2938E24B7D8A3165F7BDA4Exxx"
      }
   ],
   "ConsumerMessage": null,
   "Order": null,
   "IssuingCountry": null,
   "StartRecurrent": false,
   "Recurring": false,
   "CustomerName": null,
   "PayerHash": null,
   "PaymentKey": "A7192A3231CE48AF8003317758838xxx"
}

Pay push

Parameters

Basic parameters

Example push

{
   "Transaction": {
      "Key": "B4A21C5F70A940088EA85A6E5BBBAxxx",
      "Invoice": "testinvoice 1234",
      "ServiceCode": "WeChatPay",
      "Status": {
         "Code": {
            "Code": 190,
            "Description": "Success"
         },
         "SubCode": null,
         "DateTime": "2019-08-21T16:20:28"
      },
      "IsTest": true,
      "Order": null,
      "Currency": "EUR",
      "AmountCredit": 0.01,
      "TransactionType": "C051",
      "Services": null,
      "CustomParameters": null,
      "AdditionalParameters": null,
      "MutationType": 1,
      "RelatedTransactions": [
         {
            "RelationType": "refund",
            "RelatedTransactionKey": "9D2C9F2938E24B7D8A3165F7BDA4Exxx"
         }
      ],
      "IsCancelable": false,
      "IssuingCountry": null,
      "StartRecurrent": false,
      "Recurring": false,
      "CustomerName": null,
      "PayerHash": null,
      "PaymentKey": null
   }
}

Was this article helpful?