Prepay

Referred to as prepay

Prepay

POST https://mapi.yuansfer.com/micropay/v3/prepay

This API does the mobile payment for the In-APP and/or WeChat Mini program solutions.

Request Body

Name
Type
Description

merchantNo*

string

Merchant ID

storeNo*

string

Store ID

amount*

number

The price amount.

currency*

number

The supported transaction currency is "USD", "CNY".

settleCurrency*

string

The supported settlement currency is "USD".

vendor*

string

The possible payment channels are "alipay", "wechatpay".

ipnUrl*

string

The instant Payment Notification Handler URL. IPN URL must be secure.

openid

string

openid from WeChat, which is only needed for the Wechat Mini-Program.

reference*

string

The Invoice Number of the transaction in the merchant's system.

terminal*

string

The possible values are: "MINIPROGRAM", "APP".

description

string

The description of the transaction which will be displayed on the invoice.

note

string

The payment note.

timeout

integer

The timeout in minutes. The default value is 120.

verifySign*

string

The parameter signature.

{
    "result": {
        "nonceStr": "QyGptpsnpbydUzdVvkJy5fysWHYO48uF",
        "package": "prepay_id=wx131236528509476a97469b574a5ea30000",
        "paySign": "F2BB1584CB384DC008C665BD19FBB736BF24F1727CEB01159F9BEFA1162A61B7",
        "signType": "HMAC-SHA256",
        "timeStamp": "1602563859"
    },
    "ret_msg": " prepay success",
    "ret_code": "000100"
}

Response

Parameter

Type

Description

result

object

The wechat-mini result object.

The wechat-app result object.

The alipay-app result object.

ret_msg

string

The response return message.

ret_code

string

The response return code. For more details, see here.

wehcat-mini result object

Parameter

Type

Description

timeStamp

string

The timestamp.

nonceStr

string

A random string.

package

string

prepay_id information.

signType

string

The signature type.

paySign

string

The signature.

wechat-app result object

Parameter

Type

Description

appid

string

The App Id.

noncestr

string

A random string.

package

string

The value is 'Sign=WXPay'.

partnerid

string

partnerid information.

prepayid

string

prepay_id information.

sign

string

The signature.

timestamp

string

The timestamp.

alipay-app result object

Parameter

Type

Description

payInfo

string

The payment information.

curl -XPOST -H "Content-type: application/json" -d '{
    "merchantNo": "200043",
    "storeNo": "300014",
    "verifySign": "09f722178f6cf2e71c9dfdd664e8663b",
    "amount": "10",
    "currency": "CNY",
    "settleCurrency": "USD",
    "ipnUrl": "http://zk-tys.yunkeguan.com/login/test",
    "reference": "test2020101302",
    "description": "司机支付会员费用",
    "vendor": "wechatpay",
    "terminal": "MINIPROGRAM",
    "openid": "ocBgh5fnabrf-pxPgCWXlq2mOvG8"
}' 'https://mapi.yuansfer.com/micropay/v3/prepay'

Last updated