Path parameters
-
merchant string Required
Merchant name to payment company, e.g. weixinpay.test
Body
-
paymentMethod string Required
Payment method, must be wechatpay or alipay
Values are
wechatpay
oralipay
. -
paymentType string Required
Payment companies have different payment types
Values are
NATIVE
,H5
,JSAPI
,MINIPRO
, orAPP
. -
orderRef string Required
Merchant system order number
-
actualAmount integer Required
Order actual amount, which uses the base unit of current currency
-
total integer
Order total amount, which uses the base unit of current currency
-
subsidyAmount integer
Subsidy amount, only works when profitSharing is True
-
costPrice integer
When the original order price is not equal to the payment amount, the discount will not be enjoyed. This field is mainly used to prevent the same invoice from being paid multiple times to enjoy multiple discounts.
-
invoiceId string
Merchant invoice ID, need to use with products data
-
currency string Required
Must be
CNY
orGBP
-
profitSharing boolean
Whether the order is going to share profit
Default value is
true
. -
products array[object] | null
Payment product
-
description string
Order product description
-
attach string
Payment attach data, which could be used by payment notifies
-
timeExpire string
Payment due time
-
goodsTag string
Coupon goods tag
-
payerId string
Payer ID of customer in service provider side.
-
merchantPayerId string
Payer ID of customer in merchant side.
-
notifyUrl string
Notify url, that is used by payment company.
-
successUrl string
Success url, that is used by alipay company.
-
cancelUrl string
Cancel url, that is used by alipay company.
-
spAppId string
App ID of payment company.
curl \
-X POST https://nomad.samarkand-global.cn/broker/v1/payment/wechat.sh_smk \
-H "app-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-H "X-Real-Ip: string" \
-H "Client-Id: string" \
-d '{"paymentMethod":"wechatpay","paymentType":"H5","orderRef":"O123456789","actualAmount":2200,"total":2200,"subsidyAmount":0,"costPrice":0,"invoiceId":"string","currency":"CNY","profitSharing":true,"products":[{"goodsName":"Orange","goodsCategory":"health-beauty/fragrance","goodsUnitPrice":12,"goodsQuantity":1,"merchantProductId":"barcode123456","paymentProductId":1246464644}],"description":"面膜 mask","attach":"Payment attach mark","timeExpire":"2022-02-24T14:02:38Z","goodsTag":"new","payerId":"osGEYs0HfdUF4R965HMmEPKqOSWw","merchantPayerId":"osGEYs0HfdUF4R965HMmEPKqOSWw","notifyUrl":"https://www.weixin.qq.com/wxpay/pay.php","successUrl":"https://www.weixin.qq.com/wxpay/pay.php","cancelUrl":"https://www.weixin.qq.com/wxpay/pay.php","spAppId":"string"}'
# Headers
X-Real-Ip: string
Client-Id: string
# Payload
{
"paymentMethod": "wechatpay",
"paymentType": "H5",
"orderRef": "O123456789",
"actualAmount": 2200,
"total": 2200,
"subsidyAmount": 0,
"costPrice": 0,
"invoiceId": "string",
"currency": "CNY",
"profitSharing": true,
"products": [
{
"goodsName": "Orange",
"goodsCategory": "health-beauty/fragrance",
"goodsUnitPrice": 12,
"goodsQuantity": 1,
"merchantProductId": "barcode123456",
"paymentProductId": 1246464644
}
],
"description": "面膜 mask",
"attach": "Payment attach mark",
"timeExpire": "2022-02-24T14:02:38Z",
"goodsTag": "new",
"payerId": "osGEYs0HfdUF4R965HMmEPKqOSWw",
"merchantPayerId": "osGEYs0HfdUF4R965HMmEPKqOSWw",
"notifyUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"successUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"cancelUrl": "https://www.weixin.qq.com/wxpay/pay.php",
"spAppId": "string"
}
{
"code": 200,
"message": "success",
"payMessage": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx031",
"payInvokeMessage": "weixin://wap/pay?prepayid%3Dwx03143347..",
"timeStamp": 1414561699,
"nonceStr": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success"
}
{
"code": 200,
"message": "success",
"errors": "Something wrong when making the service."
}