Contents
About WeChat Pay
General information about WeChat Pay
WeChat is a free, cross-platform and instant messaging application developed by Tencent. It was first released in January 2011 and was one of the largest standalone messaging apps by monthly active users. As of May 2016, WeChat has over a billion created accounts, 700 million active users; with more than 70 million outside of China (as of December 2015). In 2016, WeChat reached 864 million active users. |
WeChat Pay is a payment solution completely integrated inside the social and messaging application WeChat. WeChat payment functionality appears in the "Wallet" section of the application.
WeChat supports Payment and Money Transfer
Users can perform a variety of transactions using WeChat Pay, including and not limited to:
- Transferring money to friends (especially as "red envelopes" shared during Chinese festivals)
- Performing transactions on e-commerce websites
- Topping up their mobile
Process flow chart
WeChat Pay process flow
Payment platform interface
Data formats: Format Description a alphabetical as alphabetical with special characters n numeric an alphanumeric ans alphanumeric with special characters ns numeric with special characters bool boolean expression (true or false) 3 fixed length with 3 digits/characters ..3 variable length with maximum 3 digits/characters enum enumeration of allowed values dttm ISODateTime (YYYY-MM-DDThh:mm:ss) Abbreviations: Abbreviation Description CND condition M mandatory O optional C conditional Notice: Please note that the names of parameters can be returned in upper or lower case.Definitions
Payment with WeChat Pay via form interface
To make a payment with WeChat Pay, please use the following URL:
Notice: For security reasons, Payment platform rejects all payment requests with formatting errors. Therefore, please use the correct data type for each parameter.
The following table describes the encrypted payment request parameters:
Parameter | Format | CND | Description | |
---|---|---|---|---|
MerchantID | ans..30 | M | ID of merchant. Additionally this parameter has to be passed in plain language too. | |
TransID | ans..64 | M | Merchant transaction number, which must be unique | |
RefNr | ans..40 | O | Merchant’s unique reference number. Only characters a-zA-Z0-9,-_ are allowed. | |
Amount | n..10 | M | Amount in the smallest currency unit (e.g. EUR Cent) Please contact the helpdesk, if you want to capture amounts < 100 (smallest currency unit). | |
Currency | a3 | M | Currency, three digits DIN / ISO 4217. Only EUR, USD allowed. | |
MAC | an64 | M | Hash Message Authentication Code (HMAC) with SHA-256 algorithm | |
URLSuccess | ans..256 | M | Complete URL which calls up Payment platform if payment has been successful. The URL may be called up only via port 443 This URL may not contain parameters: In order to exchange values between Payment platform and shop, please use the parameter UserData. | |
URLFailure | ans..256 | M | Complete URL which calls up Payment platform if payment has been unsuccessful. The URL may be called up only via port 443 This URL may not contain parameters: In order to exchange values between Payment platform and shop, please use the parameter UserData. | |
Response | a7 | O | Status response sent by Payment platform to URLSuccess and URLFailure, should be encrypted. For this purpose, transmit Response=encrypt parameter. | |
URLNotify | ans..256 | M | Complete URL which Payment platform calls up in order to notify the shop about the payment result. The URL may be called up only via port 443 It may not contain parameters: Use the UserData parameter instead. | |
UserData | ans..1024 | O | If specified at request, Payment platform forwards the parameter with the payment result to the shop | |
ReqID | ans..32 | O | To avoid double payments, enter an alphanumeric value which identifies your transaction and may be assigned only once. If the transaction is submitted again with the same ReqID, the payment platform will not carry out the payment, but will just return the status of the original transaction. Please note that the payment platform must have a finalized transaction status for the first initial action. Submissions with identical ReqID for an open status will be processed regularly. | |
OrderDesc | ans..768 | M | Description of goods and prices. Intended purpose on the statement of account | |
SellingPoint | ans..50 | O | Selling point | |
Service | ans..50 | O | Products or service sold | |
Channel | ans..64 | O | Configuration channel of the PPRO contract (account and ContractID are stored in the system). If it exists, it may overwrite channels stored in the system. | |
Language | a2 | O | 2-letter language code that should be preferred when presenting payment pages to the consumer. Possible values: If left empty, the default language will be applied. | |
AccOwner | ans..50 | M | Name of account holder | |
AddrCountryCode | a2 | M | Country code according to ISO-3166-1, alphanumeric 2 chars | |
Plain | ans..50 | O | A value to be set by the merchant to return some information unencrypted, e.g. the MID | |
Custom | ans..1024 | O | The merchant can submit several values separated by | which are returned unencrypted and separated by &. Custom=session=123|id=456 will change in the answer to Session=123&id=456 |
Parameters for payments with WeChat Pay
The following table describes the result parameters that the Payment platform transmits to your URLSuccess, URLFailure or URLNotify. If you have specified the Response=encrypt parameter, the following parameters are sent Blowfish encrypted to your system:
Parameter | Format | CND | Description |
---|---|---|---|
MID | ans..30 | M | ID of merchant |
PayID | an32 | M | ID assigned by Payment platform for the payment, e.g. for referencing in batch files |
XID | an32 | M | ID for all single transactions (authorisation, capture, credit note) for one payment assigned by Payment platform |
TransID | ans..64 | M | Merchant’s transaction number |
RefNr | ans..40 | O | Merchant’s unique reference number. Only characters a-zA-Z0-9,-_ are allowed. |
Status | a..30 | M | OK in the case of URLSuccess and AUTHORIZE_REQUEST or FAILED in the case of URLFailure |
Description | ans..1024 | M | Further details in the event that payment is rejected. Please do not use the Description but the Code parameter for the transaction status analysis! |
Code | n8 | M | Error code according to Payment platform Response Codes Excel file |
MAC | an64 | M | Hash Message Authentication Code (HMAC) with SHA-256 algorithm |
UserData | ans..1024 | O | If specified at request, Payment platform forwards the parameter with the payment result to the shop |
PaymentPurpose | ans..26 | M | Purpose of payment |
PaymentGuarantee | a..12 | C | NONE = no payment guarantee, VALIDATED= customer account valid, but no payment guarantee, FULL= payment guarantee Notice: This parameter is only returned if the Status=OK. |
ErrorText | ans..256 | C | Detailed PPRO error message. Notice: Is returned only if Status=FAILED. Use is possible only in agreement with support. |
TransactionID | an..20 | O | Unique transaction number with PPRO |
Plain | ans..50 | O | A value to be set by the merchant to return some information unencrypted, e.g. the MID |
Custom | ans..1024 | O | The merchant can submit several values separated by | which are returned unencrypted and separated by &. Custom=session=123|id=456 will change in the answer to Session=123&id=456 |
Return parameters for URLSuccess, URLFailure and URLNotify with WeChat Pay
Credit with reference
Credits (refunds) are possible via a Server-to-Server connection. For a Credit with reference to a capture the amount of the Credit is limited to the amount of the previous capture.
To carry out a credit with a reference transaction, please use the following URL:
Notice: For security reasons, Payment platform rejects all payment requests with formatting errors. Therefore, please use the correct data type for each parameter.
The following table describes the encrypted payment request parameters:
Parameter | Format | CND | Description | |
---|---|---|---|---|
MerchantID | ans..30 | M | ID of merchant. Additionally this parameter has to be passed in plain language too. | |
PayID | an32 | M | ID assigned by Payment platform for the payment to be credited | |
TransID | ans..64 | M | TransactionID which should be unique for each payment | |
RefNr | ans..40 | O | Merchant’s unique reference number. Only characters a-zA-Z0-9,-_ are allowed. | |
Amount | n..10 | M | Amount in the smallest currency unit (e.g. EUR Cent) Please contact the helpdesk, if you want to capture amounts < 100 (smallest currency unit). | |
Currency | a..3 | M | Currency code, three digits DIN / ISO 4217 | |
MAC | an64 | M | Hash Message Authentication Code (HMAC) with SHA-256 algorithm | |
ReqID | ans..32 | O | To avoid double payments, enter an alphanumeric value which identifies your transaction and may be assigned only once. If the transaction is submitted again with the same ReqID, the payment platform will not carry out the payment, but will just return the status of the original transaction. Please note that the payment platform must have a finalized transaction status for the first initial action. Submissions with identical ReqID for an open status will be processed regularly. |
Parameters for credit payments with WeChat Pay via socket connection
The following table describes the Payment platform response parameters:
Parameter | Format | CND | Description |
---|---|---|---|
MID | ans..30 | M | ID of merchant |
PayID | an32 | M | ID assigned by Payment platform for the payment, e.g. for referencing in batch files |
XID | an32 | M | ID for all single transactions (authorisation, capture, credit note) for one payment assigned by Payment platform |
TransID | ans..64 | M | Merchant’s transaction number |
Status | a..30 | M | OK or FAILED |
Description | ans..1024 | M | Further details in the event that payment is rejected. Please do not use the Description but the Code parameter for the transaction status analysis! |
Code | n8 | M | Error code according to Payment platform Response Codes Excel file |
RefNr | ans..40 | O | Merchant’s unique reference number. Only characters a-zA-Z0-9,-_ are allowed. |
ErrorText | ans..256 | O | Detailed PPRO error message |
Response parameters for credit payments with WeChat Pay via socket connection