Place an order
Create a pre-order transaction and pay through the returned information.
Currently only supports WeChat and Alipay.
Info
{domain}/Servlet/JSAPIService.do
https:/VMP/Servlet/JSAPIService.do
Name | Type | Description | Requirement |
---|---|---|---|
service | String | Interface nameservice.alipay.jsapi.PreOrder service.wechat.jsapi.PreOrder | |
user_confirm_key | String(12) | User Key, provided by eftPay | |
paytype | String(6) | Payment typeAlipay ,WeChat | |
payment_type | String(20) | Wallet typeALIPAYCN ,ALIPAYHK WECHATCN ,WECHATHK | |
scene_type | String | Payment scene, PUBLIC and H5 are only applicable to WeChatAPPLETS ,PUBLIC ,H5 | |
transaction_amount | String(8) | Amount. Requires numbers, the maximum length of decimal places is 2 | |
out_trade_no | String(28) | Merchant order number | |
subject | String(256) | Transaction information | |
tid | String(20) | Merchant terminal number | |
fee_type | String(5) | Currency type, HKD ,CNY Default: HKD | |
notify_url | String(240) | Notification address, the production environment only supports 80 and 443 ports, other ports need to apply | |
active_time | String | Effective time, in seconds. Default 30 minutes, that is,1800 | |
time | String | Time, format:yyyyMMddHHmmss | |
sign | String(64) | Signature |
Name | Type | Description | Requirement |
---|---|---|---|
openid | String | The openid obtained by the official account, applicable to the PUBLIC sceneopenid and sub_openid choose one | |
sub_openid | String | The openid obtained by the applet, applicable to the APPLETS scenesub_openid and openid choose one | |
return_url | String | The return address after payment is completed. Applicable to the H5 scene, see [Notes on WeChat H5 Scene](#Notes on WeChat H5 Scene) | |
scene_info | String | Scene information, applicable to the H5 scene | |
receipt | String | Electronic invoice entry opening logo (only applicable to WeChat). When Y is entered, the payment success message and payment details page will appear to open the invoice entry. It is necessary to open the electronic invoice function on the WeChat payment merchant platform or WeChat public platform to pass this field Can take effect | |
goods_tag | String | Order discount mark | |
detail | Object | Detailed description of the product, for merchants who use single-item discounts, this field must be uploaded in accordance with the specifications. For ordinary merchants, use the Json format. For merchants who use single-item discounts, the specification of this field is detailed in Single Item Discount Parameter Description |
About return_url
The WeChat H5 payment scene may occur after setting the return_url
and jumping back to the specified page:
- More than 5 seconds after the WeChat payment middle page calls up the WeChat cashier
- The user clicks
“Cancel Payment”
or“Complete”
button after payment is completed
Therefore, it cannot be guaranteed that the payment process has ended when the page jumps back, so the return_url
address set by the merchant cannot automatically execute the check single operation, and the user should be allowed to click the button to trigger the check single operation.
The display effect of the jump back page can refer to the figure below.
More questions
Please refer to WeChat H5 Development Guide Common Questions
Name | Type | Description | Requirement |
---|---|---|---|
return_status | String(3) | Return status code, represents . Note: This parameter cannot be used to judge whether the transaction status is successful Other status codes see Appendix 3 | |
return_char | String(100) | Return description, which may change and cannot be used for conditional judgment | |
time | String | Time, format: yyyyMMddHHmmss return_status >= 00 when returned | |
sign | String(64) | Signaturereturn_status >= 00 when returned |
Name | Type | Description | Requirement |
---|---|---|---|
user_confirm_key | String | User Key, provided by eftPay | |
paytype | String(6) | Payment type | |
payPackage | String | Used for jsapi or H5 to call up payment, the content inside cannot be modified | |
out_trade_no | String(28) | Merchant order number | |
payment_type | String(20) | Wallet type | |
transaction_amount | String(8) | Transaction amount | |
scene_type | String | Payment scene | |
subject | String(256) | Transaction information | |
tid | String(20) | Terminal number, returned when the consumption request is sent | |
fee_type | String(5) | Currency | |
eftpay_trade_no | String(28) | eftPay order number, configuration return | |
openid | String | Openid obtained from the public accountWeChat PUBLIC scene return | |
sub_openid | String | Openid obtained from the appletWeChat APPLETS scene return |
{
"service": "service.wechat.jsapi.PreOrder",
"user_confirm_key": "S0003469",
"paytype": "WeChat",
"payment_type": "WECHATCN",
"scene_type": "H5",
"transaction_amount": "0.07",
"out_trade_no": "rrn_1686280006040",
"subject": "test测试",
"time": "20230609110646",
"sign": "2426d6a5eb2371052aaa7b2ecead2f1c23cb6b9114960a5eee89a6a8aba2a475",
"tid": "tid_3378",
"fee_type": "HKD",
"notify_url": "https://www.merchant.com/notify/receive",
"return_url": "https://www.merchant.com/return/page"
}
{
"user_confirm_key": "S0003469",
"return_status": "00",
"return_char": "",
"payPackage": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx161448344276518c6138605600a28axxxx&package=3645625860&redirect_url=https%3A%2F%2Fwww.merchant.com%2Freturn%2Fpage",
"subject": "test测试",
"transaction_amount": "0.89",
"sign": "7725226a14e3aefc738246a03ed6b3a357ab17f63b9ae22377e89ecad0a0c5e0",
"fee_type": "HKD",
"scene_type": "H5",
"tid": "tid_3378",
"payment_type": "WECHATCN",
"out_trade_no": "rrn_1686280006042",
"time": "20230609110646",
"paytype": "WeChat"
}