# 普通创建交易单

# 请求信息

请求地址:

https://a.mypaynz.com/api/online
  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
total_fee int(10) No Amount, Unit: Cent
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 Pay Type
version string(4) No 'v1'
sign string(32) No Signature, please refer to signature explaination section
tid int(4) YES Terminal ID
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.
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.
pay_rate int(4) Yes Default merchant rate if null, range 0 - 30

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java

## Create transaction  类似
curl -X "POST" "https://a.mypaynz.com/api/online" \
     -H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
     --data-urlencode "mid=10224" \
     --data-urlencode "total_fee=1" \
     --data-urlencode "goods=goodname" \
     --data-urlencode "goods_detail=goodsdetail" \
     --data-urlencode "out_trade_no=202012022020515152520003" \
     --data-urlencode "pay_type=IE0012" \
     --data-urlencode "version=v1" \
     --data-urlencode "sign=66a70986659927076f0e4ad7842c3134"

# 结果详情

# 成功

 {
    "is_success": "TRUE",
    "message": "SUCCESS",
    "extra": {
        "mid": "10224",
        "pay_type": "IE0012",
        "out_trade_no": "202012041142265577006791947779410",
        "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=2020-12-04 06:42:26&order_valid_time=3600&out_trade_no=202012041142265577006791947779410&partner=2088331448074211&product_code=NEW_OVERSEAS_SELLER&secondary_merchant_id=10224&secondary_merchant_industry=5812&secondary_merchant_name=Demo Merchant&service=create_forex_trade&subject=goodname&supplier=Demo Merchant&total_fee=0.01&sign_type=MD5&sign=6e126a60d1b540c40b98882cbff8733e"
    }
}

# 交易单已创建

 {
    "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=2020-12-04 06:42:26&order_valid_time=3600&out_trade_no=202012041142265577006791947779410&partner=2088331448074211&product_code=NEW_OVERSEAS_SELLER&secondary_merchant_id=10224&secondary_merchant_industry=5812&secondary_merchant_name=Demo Merchant&service=create_forex_trade&subject=goodname&supplier=Demo Merchant&total_fee=0.01&sign_type=MD5&sign=6e126a60d1b540c40b98882cbff8733e",
        "pay_type": "IE0012",
        "out_trade_no": "202012041142265577006791947779410",
        "status": "0"
    }
}

# 错误

签名错误

{
    "is_success":"FALSE",
    "message": "SIGN_ERROR"
}

# 微信小程序创建交易单

# 请求信息

请求地址:

https://a.mypaynz.com/wechatApi/mini_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
total_fee int(10) No Amount, Unit: Cent
appid string(64) No WeChat mini program appid
openid string(64) No user openid in your WeChat mini program
pay_type string(8) No IE0026 Pay Type
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
sign string(32) No Signature, please refer to signature explaination section
expired int(8) Yes Expiration time, Unit: second. default: 3600
notify_url string(512) Yes The URL for receiving asynchronous notifications after the payment is done.

Examples

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

# 结果详情

# 成功

//coming soon

# 交易单已创建

//coming soon

# 错误

签名错误

{
    "is_success":"FALSE",
    "message": "SIGN_ERROR"
}

# 查询交易单

# 请求信息

请求地址:

https://a.mypaynz.com/api/check_order_status
  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
pay_type string(8) No Pay Type
out_trade_no string(64) No Order number
version string(4) No 'v1'
sign string(32) No Signature, please refer to signature explaination section

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
## Check transaction 类似
curl -X "POST" "https://a.mypaynz.com/api/check_order_status" \
     -H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
     --data-urlencode "mid=10224" \
     --data-urlencode "out_trade_no=202012022020515152520003" \
     --data-urlencode "pay_type=IE0012" \
     --data-urlencode "version=v1" \
     --data-urlencode "sign=66a70986659927076f0e4ad7842c3134"

# 结果详情

# 成功

 {
    "is_success": "TRUE",
    "message": "SUCCESS",
    "extra": {
        "pay_type": "IE0012",
        "trade_no": "",
        "out_trade_no": "20201204004657072197599568617124",
        "order_status": "0",
        "total_fee": 1,
        "rmb_fee": 0,
        "goods": "goodname",
        "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=2020-12-04 08:46:57&order_valid_time=3600&out_trade_no=20201204004657072197599568617124&partner=2088331448074211&product_code=NEW_OVERSEAS_SELLER&secondary_merchant_id=10224&secondary_merchant_industry=5812&secondary_merchant_name=Demo Merchant&service=create_forex_trade&subject=goodname&supplier=Demo Merchant&total_fee=0.01&sign_type=MD5&sign=1b57ff84c8bf92a895f53459c008ac24",
        "return_url": ""
    }
}

# 错误

签名错误

{
    "is_success":"FALSE",
    "message": "SIGN_ERROR"
}

其他错误

{
    "is_success": "FALSE",
    "message": "COMBINE_ERROR",
    "extra": []
}

# 退款交易单

请求地址:

https://a.mypaynz.com/api/refund
  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
pay_type string(8) No Pay Type
out_trade_no string(64) No Order number
refund_amount int(10) No Refund Amount, Unit: Cent
version string(4) No 'v1'
sign string(32) No Signature, please refer to signature explaination section

Examples

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java
## Refund transaction 类似
curl -X "POST" "https://a.mypaynz.com/api/refund" \
     -H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
     --data-urlencode "mid=10224" \
     --data-urlencode "out_trade_no=202012022020515152520003" \
     --data-urlencode "refund_amount=1" \
     --data-urlencode "pay_type=IE0012" \
     --data-urlencode "version=v1" \
     --data-urlencode "sign=66a70986659927076f0e4ad7842c3134"

# 结果详情

# 成功

 {
    "is_success": "TRUE",
    "message": "SUCCESS",
    "extra": []
}

# 错误

签名错误

{
    "is_success":"FALSE",
    "message": "SIGN_ERROR"
}

余额不足

{
    "is_success": "FALSE",
    "message": "BALANCE_ERROR",
    "extra": []
}

# 参数说明

# return_url - 同步结果通知

支付成功后会有一个同步返回的URL,将最终用户重定向到这个返回的URL。该URL应该仅用于用户交互。不应该作为交易单确认回调。 传递给 API 的所有变量 https://a.mypaynz.com/api/online 也将被返回。

提示

$url = $return_url

# notify_url - 异步结果通知

当支付成功后, IEPay 会根据创建订单的时候进行回调。商户需要在收到异步通知后接口直接返回字符串 ”SUCCESS“。否则 IEPay 将在12小时内发送多次异步通知。

提示

注意,您可能同时收到多次异步通知,因此请确保交易单号在您的系统里面是唯一的

$url = $notify_url."?out_trade_no=".$out_trade_no."&trade_no=".$trade_no."&trade_status=SUCCESS&pay_type=".$pay_type."&sign=".$sign;
$sign = md5($trade_no.$out_trade_no.'SUCCESS'.$api_key);