Brief Description
- 代收下单接口
Solicited Message
Request URL
javascripthttps://www.xxx.com/gateway/rechargeRequest Specification
Basic Information
- Interface Protocol:
HTTPS - Data Format:
application/json - Request Method:
POST
- Interface Protocol:
Request Example
typescript// typescript + axios Request Example import axios from 'axios' // Define the types of request parameters interface CreateOrderParams { merchant_no: string order_no: string amount: string remark: string customer: string ip: string callback_url: string return_url: string time: string sign: string } // Example function: Send order creation request async function createOrder(params: CreateOrderParams) { try { const response = await axios.post('https://api.example.com/gateway/recharge', params) console.log('Success:', response.data) return response.data } catch (error: any) { if (error.response) { // The error response returned by the server side console.error('API Error:', error.response.data) } else { // Network error or other issues console.error('Request Failed:', error.message) } throw error } } // Example call createOrder({ merchant_no: 'M1234567890', order_no: 'ORD1234567890', amount: '100.00', remark: 'Test order', customer: 'user123', ip: '192.168.1.1', callback_url: 'https://yourapp.com/callback', return_url: 'https://yourapp.com/return', time: Date.now().toString(), sign: 'your_generated_signature_here' })
Request Parameter List
Parameter Name Required Type explain merchant_no ✅ string merchant identification number order_no ✅ string Merchant Order Number amount ✅ string amount remark ✅ string remark customer ✅ string user ID ip ✅ string user IP callback_url ✅ string Successful callback address return_url ✅ string Successful Jumping Address time ✅ string timestamp sign ✅ string sign
Response Message
Response Example
json
{
"code": "0",
"msg": "",
"data": {
"hash": "def50200d53b9e1f830a35165aeebae8baa18ef3806e5300cf412ec91c08577df3a1d27f00f46197c55c4c66a5dc6f11d1528c96a8b9a5c4a8281a2e577c47384ae036bee45721dea7595a58d89b482eea66e20043dcb79404",
"trade_no": "RR241115223531937981",
"qr_code": "rsn://r/RR241115223531937981",
"url": "https://xxxxxx/?hash=def50200d53b9e1f830a35165aeebae8baa18ef3806e5300cf412ec91c08577df3a1d27f00f46197c55c4c66a5dc6f11d1528c96a8b9a5c4a8281a2e577c47384ae036bee45721dea7595a58d89b482eea66e20043dcb79404",
"pay_timeout": 3600
}
}Response parameter list
Parameter Name Type explain hash string The encrypted order ID trade_no string order number qr_code string QR code url string jump link pay_timeout number Expiration time (the number of seconds until the order expires)
remark
- For more questions regarding 代收下单接口 , please contact the administrator.
- Date updated: 2024-04-25