# midasCancelPay

本接口应在后端服务器调用

For Mini Games with virtual payment activated, if the order number with game coins deducted is within valid period, this order can be canceled through the interface

# Formal environment

POST https://api.weixin.qq.com/cgi-bin/midas/cancelpay?access_token=ACCESS_TOKEN

# Sandbox environment

POST https://api.weixin.qq.com/cgi-bin/midas/sandbox/cancelpay?access_token=ACCESS_TOKEN

# 请求Parameter

property type default value optional description version
openid string yes User unique identifier
appid string yes Mini Program appId
offer_id string yes offer_id distributed by Midas
ts number yes UNIX timestamp in seconds
zone_id string yes Game server zone ID; if the game servers are not classified by zones, the default zoneId ="1", and it is string type. If the app supports selecting role, the zone ID is followed by role ID by using "_".
pf string yes Platform: Android
user_ip string no User's Internet IP
bill_no string yes Order ID, which requires unique value; recurring payment will not occur for the same ID It should be no more than 63 characters including numbers, uppercase and lowercase letters_- *@
pay_item string no Prop name
sig string yes All parameters above (up to 9 including optional parameters) + uri + Midas key, with HMAC SHA256 signature. For details, please see Midas payment signature algorithm
access_token string yes Proof of interface call
mp_sig string yes All parameters above (up to 11 including optional parameters) + uri + session_key, with HMAC SHA256 signature. For details, please see Midas payment signature algorithm

# Return

# Object

Returned JSON data package

property type description version
errcode number Error code
errmsg string Error message
bill_no string Deduct the order ID with game coins

errcode 's struct

value description
0 Request successful
-1 System busy, the developer is requested to try again later
90000 No order
90009 mp_sig signature error
90010 User has not logged in, or login status has expired
90011 sig signature error
90014 The order is paid and confirmed, so current operation is not allowed
90015 The order is returned, so current operation is not allowed
90016 The order is processing
90017 No interface calling permissions
90018 Parameter error

# POST data format: JSON

{
    "openid":"odkx20ENSNa2w5y3g_qOkOvBNM1g",
    "appid":"wx1234567",
    "offer_id":"12345678",
    "ts":1507530737,
    "zone_id":"1",
    "pf":"android",
    "bill_no":"BillNo_123",
    "sig":"8bd582a6b06e38a1346fc335ebcb11c8990241bbe23118eb3d22f0ef42870a6a",
    "mp_sig":"2651b0ee9cc7e7e1791de388d34c4d0357936e9ab7b8a9db9ba7b0537208f72b"
}