💵 Page Redirect Payment (POST returns payment console URL, GET returns redirect payment page, choose as needed)
Interface Description
POST data: pid={merchant_id}&type={payment_method}&out_trade_no={merchant_order_no}¬ify_url={server_async_notify_url}&return_url={page_redirect_notify_url}&name={product_name}&money={amount}&sitename={website_name}&sign={signature_string}&sign_type=MD5
GET data: http://domain from merchant management after login/pay/submit.php?pid={merchant_id}&type={payment_method}&out_trade_no={merchant_order_no}¬ify_url={server_async_notify_url}&return_url={page_redirect_notify_url}&name={product_name}&money={amount}&sitename={website_name}&sign={signature_string}&sign_type=MD5
Request Parameters
Field Name
Parameter Name
Required
Type
Example Value
Description
Response Parameters (Only returned for POST requests, GET requests redirect directly to payment page)
Field Name
Parameter Name
Type
Example Value
Description
Description / Example
Signature algorithm is the same as Alipay signature algorithm, sign and sign_type are not included, code example as follows
let secretKey = "7a3b1053780db61ebd3d7123e1b8d6c4"
let reqJson = {
pid: 152787,
type: "wxpay",
out_trade_no: "20240125193935458",
notify_url: "1",
return_url: "2",
name: "Test Payment 20240125193935458",
money: 0.1
}
//str string (Note: 1/Parameter names in ASCLL code from small to large 2/Empty parameter values do not participate in signature 3/Case sensitive 4/sign and sign_type do not participate in signature 5/Finally concatenate secretKey)
money=0.1&name=Test Payment 20240125193935458&
notify_url=1&out_trade_no=20240125193935458&pid=152787&return_url=2&type=wxpay7a3b1053780db61ebd3d7123e1b8d6c4
//MD5 encryption result (Note: remove the newline before notify_url)
5af4287ea6c3ab4505e9dc8d2e3a148c
Status code description (can be handled by yourself, or directly pop up the returned message):
700: Missing parameters 701: Signature verification failed 702: Channel is under maintenance, please try again later 703: No payment code matched for the corresponding amount, please change the amount and try again 704: Amount cannot be less than 0.01 yuan 705: Duplicate order number 800: Invalid merchant or secret key, please check 901: No available channel, please check