Alipay Mini Program

Method : POST
URL : https://open.revenuemonster.my/v3/payment/online/checkout
Sandbox URL : https://sb-open.revenuemonster.my/v3/payment/online/checkout

note

Create a payment in Alipay Mini Program

Request Parameters#

ParameterTypeDescriptionExample
checkoutIdStringrefer to web-payment to get your checkoutId"1607935374438928096"
methodStringRM currently supported method"ALIPAY_CN"
typeStringMINI_PROGRAM"MINI_PROGRAM"
curl --location --request POST '{{open_base_path}}/v3/payment/online/checkout' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{clientToken}}' \
--header 'X-Nonce-Str: XAYZRZNLGCKSTURRFKBIGYALUKLCLJOG' \
--header 'X-Signature: sha256 RLHmhe9pvCnM6wbp2UcQcyyjBXKbVhlbshaZqUBdgxqdnbM6WsmQuQL1PwhsF6/uOxoXtoXaLIi18zN0IQp5MdxNSiq+6MPLZqmPpiWyJSXpzZsUVst43tKp+JZDF8AWXesrol5vj1RVbxOvCfnkmfghA83mlKc4scXIJkqXpFdyKcRmjT6Bsu9nlMh5IdyBSKv3goatgso/4IsEi8R220ZSHp2Ai//g9iKrKG3cgspM2Uj74ZXIrzt8IB+660btXyoanMuqgqirl1ulj59KciqLKqQMYoHfRywJTH0XLDtV1fQHO1FAECwmMd91Y63acnH3BOxo023tF7AXwNASsg==' \
--header 'X-Timestamp: 1547643342' \
--data-raw '{
"checkoutId": "1607935374438928096",
"method": "ALIPAY_CN",
"type": "MINI_PROGRAM"
}'

Response Parameters#

ParameterTypeDescriptionExample
itemObjectObject of refund details.(Refer to explanation below)
codeStringStatus returned from Revenue Monster server, whether successfully called our endpoint or not."SUCCESS"

Item Object (item):
ParameterTypeDescriptionExample
typeStringMINI_PROGRAM"MINI_PROGRAM"
dataStringIs a base64 encode datashow as below

Example Response for URL

{
"item": {
"data": "X2lucHV0X2NoYXJzZXQ9VVRGLTgmY3VycmVuY3k9VVNEJmZvcmV4X2Jpej1GUCZub3RpZnlfdXJsPWh0dHBzJTNBJTJGJTJGc2ItcGcucmV2ZW51ZW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RAM"
},
"code": "SUCCESS"
}

Alipay Mini Program Side#

note

Using base64 decode this data parameter, and pass in mini program:

my.tradePay({
orderStr: << decoded base64 from url parameter >>,
success: (res) => {
console.log("success", res)
},
fail:(res) =>{
console.log("error", res)
},
});