# 反扫直接支付

# 请求信息

请求地址:

https://a.mypaynz.com/api/pay
  1. 请求方式: POST
  2. 参数传递方式: Form URL-Encoded
  3. 设置Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# 参数详情

参数 类型 是否可空 参数描述
mid int(4) No Merchant ID
tid int(4) Yes Terminal ID
fee int(10) No Amount, Unit: Cent
barcode string(32) No Barcode from customers' app
memo string(128) Yes Goods name
out_trade_no string(32) No Order number, should be unique, recommend using date(YYYYmmddHHiiss) + 18 digit random number
pay_type string(8) No IE0014 = ALIPAY_BARCODE;
IE0024 = WECHAT_BARCODE;
sign string(32) No Signature, please refer to signature explaination section

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
//coming soon

# 结果详情

TIP

{
    "code": "200",
    "msg": "SUCCESS",
    "data": {
        "id": "60682",
        "mid": "10209",
        "tid": "0",
        "status": "1",
        "currency": "NZD",
        "amount": "0.01",
        "rate": "1.2",
        "customer_id": "64-2****70117",
        "goods_detail": "test",
        "out_trade_no": "s123411a2311232131332131",
        "trade_no": "2018061121001004210581551337",
        "payment_time": "2018-06-11 12:15:35"
    },
    "timestamp": 1528690537
}

TIP

'code':'1002' = PRICE_ERROR
'code':'1003' = SIGN_ERROR
'code':'1004' = ORDER_NUMBER_EXIST / ORDER_CREATED
'code':'206' = SYSTEM_ERROR
'code':'202' = WAITING_FOR_CUSTOMER_COMFIRM / UNPAID
'code':'205' = AUTH_CODE_INVALID / FAIL

# 查询反扫交易单

# 请求信息

请求地址:

https://a.mypaynz.com/api/check
  1. 请求方式: POST
  2. 参数传递方式: Form URL-Encoded
  3. 设置Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# 参数详情

参数 类型 是否可空 参数描述
mid int(4) No Merchant ID
tid int(4) No Terminal ID
total_fee int(10) No Amount, Unit: Cent
rmb_fee int(10) Yes Amount, Unit: Cent. Only used when pay_type is IE0012 or IE0013. Use this parameter to replace total_fee if partner wish to price their product in RMB. If total_fee is used, rmb_fee should not be set. They are mutual exclusive.
goods string(64) No Item name, must not contain any special characters
goods_detail string(128) No Item descripion, must not contain any special characters
out_trade_no string(64) No Order number, should be unique, recommend using date(YYYYmmddHHiiss) + 18 digit random number
pay_type string(8) No IE0011 = ALIPAY_QRCODE;
                        IE0012 = ALIPAY_WEB;<br/>
                        IE0013 = ALIPAY_WAP;<br/>
                        IE0014 = ALIPAY_BARCODE;<br/>
                        IE0015 = ALIPAY_APP;<br/>
                        IE0016 = ALIPAY_APP_SDK;<br/>
                        IE0021 = WECHAT_QRCODE;<br/>
                        IE0022 = WECHAT_WAP;<br/>
                        IE0023 = WECHAT_WAP_DIRECT;<br/>
                        IE0024 = WECHAT_BARCODE;<br/>
                        IE0025 = WECHAT_APP;<br/>
                        IE0026 = WECHAT_MINI;<br/>
                        IE0031 = UNION_QRCODE;<br/>
                        IE0041 = POLI_WEB;

expired | int(8) | Yes | Expiration time, Unit: second. default: 3600 return_url | string(512) | Yes | After the payment is done, the result is returned to this url via the URL redirect. notify_url | string(512) | Yes | The URL for receiving asynchronous notifications after the payment is done. version | string(4) | No | 'v1' pay_rate | int(4) | Yes | Default merchant rate if null, range 0 - 30 sign | string(32) | No | Signature, please refer to signature explaination section

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
//coming soon

# 结果详情

成功

{
    "is_success":"TRUE",
    "message":"SUCCESS",
    "extra":{
        "mid":"10224",
        "pay_type":"IE0012",
        "out_trade_no":"201808170123245622346777231",
        "pay_url":"https://intlmapi.alipay.com/gateway.do?_input_charset=utf-8&currency=NZD&notify_url=https://a.mypaynz.com/api/alipay_push_notify_web&order_gmt_create=2018-07-26 07:00:27&order_valid_time=3600&out_trade_no=201808170123245622346777231&partner=2088421400772571&return_url=http://www.amazon.com/syn&secondary_merchant_id=10224&secondary_merchant_industry=0742&secondary_merchant_name=merchant&service=create_forex_trade&subject=123312&supplier=merchant&total_fee=1&sign=da41c17de81b5981d376a1b32c382d04"
    }
}

失败

{
    "is_success":"FALSE",
    "message":"ORDER_CREATED",
    "extra":{
        "mid":"10224",
        "pay_url":"https://intlmapi.alipay.com/gateway.do?_input_charset=utf-8&currency=NZD&notify_url=https://a.mypaynz.com/api/alipay_push_notify_web&order_gmt_create=2018-07-26 07:03:43&order_valid_time=3600&out_trade_no=2018081701232456223467772311&partner=2088421400772571&return_url=http://www.amazon.com/syn&rmb_fee=0.12&secondary_merchant_id=10224&secondary_merchant_industry=0742&secondary_merchant_name=merchant&service=create_forex_trade&subject=123312&supplier=merchant&sign=be411b88522a162290bf4f45412d43ad",
        "pay_type":"IE0012",
        "out_trade_no":"2018081701232456223467772311"
    }
}