Request signing is used to verify the integrity of messages between the platform and merchants. Signing occurs in two scenarios:
request.body using the merchant private key (SHA256WithRSA: compute SHA-256 hash, then RSA-encrypt with private key to produce the digital signature);Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(privateKey);
// When computing SHA256withRSA, convert byte stream with UTF-8 encoding to avoid incorrect signatures for Chinese parameters
signature.update(request.body);
byte[] signedHash = signature.sign();String signature = Base64.getEncoder().encodeToString(signedHash);signature request header.
Note: signing applies to request.body. When request.body is empty (e.g. query requests), no signature is required.Data encoding [utf-8]
"UTF-8"
API version. Current version is 2.0.0. Must be 2.0.0.
"2.0.0"
Transaction Type
- Use PAY for payment transactions
- Use VCC for VCC card transactions
PAY, CREDIT_CARD, 3D_PREAUTH_VOIDS, 3D_PREAUTH_COMPLETION, REFUND, VOIDS, QUERY, TRANSFER, DOWNLOAD, REGISTRATION, FILEUPLOAD, INQUIRYREGISTRATIONSTATUS, AUTHORIZE, VCC API access type
"s2s"
Message signature type
"RSA"
Institution ID
"2023010558663764"
Merchant ID
"2023010558663764"
Request time in RFC3339 format: yyyy-MM-ddTHH:mm:ss.SSSXXX. Must be within 2 minutes of current time.
"2024-05-24T14:29:32.682+08:00"
Payment channel
WEIXIN, UNIONPAY, ALIPAY_CN, ALIPAY_HK, GCASH, BPI, TNG, BOOST, DANA, KAKAOPAY, TRUEMONEY, BRAZIL_PIX, Ewallet_PicPay, Khipu, RABBIT_LINE_PAY, ALIPAY_INSTORE, NAVERPAY, TOSSPAY, GrabPay_SG, MAYA, BILLEASE, GrabPay_MY, GoPay, OVO, DOKU, Dragonpay, Konbini, PayEasy, GrabPay_PH Order validity duration (integer, unit: minutes)
Domain or APP name where the transaction occurs
"carrierId"
Order amount per ISO 4217 minimum unit e.g. (CNY) 110.86, (JPY) 1110. [For token creation: 0 = token only, non-0 = create token and pay]
"20.01"
Merchant order ID
"20230424141154"
Transaction mode. See Payment Methods for more details.
QRCODE, MICROPAY, JSAPI, MINIPROGRAM, APP, H5, 3D, FIXEDCODE "QRCODE"
Merchant region
"US"
Required for 3D transactions (example values: 1.0, 2.0)
"2.0"
Device channel
商品名称,多个商品 用";"隔开
"Iphone15"
Whether to use DCC. Pass value: dcc
"DCC"
Async notification URL
10 - 200Frontend callback URL
"http://www.gogole.com"
User IP address
"18.277.26.154"
Mobile OS type (required when payMode is APP)
"IOS"
Authorization code (required when transChannel is WEIXIN and payMode is MICROPAY)
"133788758877188822"
WeChat public account ID (AppID)
"wxd678efh567hg6787"
In-app user ID (OpenID)
"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
Merchant extension field
"reqReserved"
Reserved field
"reserved"
Merchant user ID (required when transChannel is BRAZIL_PIX)
"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
OK
Whether the request succeeded
Response status code. 00000000 means success; other codes indicate failure. See system error codes.
"00000003"
Error message
"处理中"
Order status (see supplementary notes)
"PENDING"
Unique request trace ID. Provide this when reporting issues for troubleshooting.
"33fae7b7aed1233f"