# Create Transaction

# Request

# Basic

URL API:

https://a.mypaynz.com/api/online
  1. Request method: POST
  2. Parameter method: Form URL-Encoded
  3. Set Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# Parameter

Parameter Type Nullable Parameter Description
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"

# Response

# Successes

 {
    "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"
    }
}

# Transaction Created

 {
    "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"
    }
}

# Error

Signature Error

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

# WeChat mini Program Create Transaction

# Request

# Basic

URL API:

https://a.mypaynz.com/wechatApi/mini_pay
  1. Request method: POST
  2. Parameter method: Form URL-Encoded
  3. Set Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# Parameter

Parameter Type Nullable Parameter Description
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

# Response

# Successes

//coming soon

# Error

Signature Error

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

# Check Transaction

# Request

# Basic

URL API:

https://a.mypaynz.com/api/check_order_status
  1. Request method: POST
  2. Parameter method: Form URL-Encoded
  3. Set Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# Parameter

Parameter Type Nullable Parameter Description
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"

# Response

# Successes

 {
    "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": ""
    }
}

# Error

Signature Error

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

Other Error

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

# Refund Transaction

# Request

# Basic

URL API:

https://a.mypaynz.com/api/refund
  1. Request method: POST
  2. Parameter method: Form URL-Encoded
  3. Set Content-Type: 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

# Parameter

Parameter Type Nullable Parameter Description
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"

# Response

# Successes

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

# Error

Signature Error

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

Not enough balance

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

# Parameter Description

# return_url - Sync results notification

This URL should be used only for user interaction. This URL should only be used for user interaction. It should not be used as a ticket confirmation callback. All variables passed to the API https://a.mypaynz.com/api/online will be returned as well.

TIP

$url = $return_url

# notify_url - asynchronous result notification

When the payment is successful, IEPay makes a callback based on the order creation. The merchant needs the string "SUCCESS" to be returned by the interface directly after receiving the asynchronous notification. Otherwise, IEPay will send multiple asynchronous notifications within 12 hours.

TIP

Note that you may receive multiple asynchronous notifications at the same time, so make sure that the transaction number is unique in your system!

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