# 创建交易单

# 请求信息

请求地址:

https://mypaynz.com/api/v3/payment
  1. 请求方式: POST
  2. 参数传递方式: Form URL-Encoded
  3. 设置Content-Type: 'Content-Type: application/json;X-Requested-With=XMLHttpRequest'

# 参数详情

参数 类型 是否可空 是否参与签名 参数描述
mid int(4) No Yes 账号的Merchant Id, 通过注册IEPAY (opens new window)获得
amount int(10) No Yes 金额,单位:分
currency NZD No Yes 货币类型 请填: NZD
goods string(64) No Yes 商品名称,请去除特殊符号
goods_detail string(128) No Yes 商品详情,请去除特殊符号
out_trade_no string(64) No Yes 唯一订单号,推荐使用日期+随机数的组合
pay_type string(8) No Yes 支持的支付类型
return_url string(512) No Yes 支付成功后, 页面跳转回的结果地址
notify_url string(512) No Yes 支付成功后, 接收支付结果信息的后台地址
is_mobile true,false Yes No 是否为手机, 仅在支付方位为银联时需要
openid string(30) Yes No 微信的openid, 仅在支付方式为微信小程序时需要
mini_appid string(20) Yes No 微信小程序ID, 仅在支付方式为微信小程序时需要
sign_type MD5, SHA256 No No 加密算法类型 签名
sign string(32) No No 签名

代码示例

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java

## Create transaction  类似
curl --location --request POST 'https://mypaynz.com/api/v3/payment' \
    --form 'mid="11585"' \
    --form 'amount="1"' \
    --form 'currency="NZD"' \
    --form 'goods="test"' \
    --form 'goods_detail="test 1"' \
    --form 'out_trade_no="20220518012"' \
    --form 'pay_type="IE0012"' \
    --form 'sign="THISJUSTATEST"' \
    --form 'sign_type="MD5"' \
    --form 'return_url="http://test.com/return"' \
    --form 'notify_url="http://test.com/notify"' \

# 结果详情

# 成功

{
    "success": true,
    "status": true,
    "error_code": 0,
    "message": "OK",
    "data": {
        "pay_type": "IE0012",
        "pay_type_str": "Alipay Web",
        "out_trade_no": "20220518012",
        "trade_no": null,
        "amount": 1,
        "status": 0,
        "status_str": "Unpay",
        "pay_url": "https://alipay.com/payment/url"
    }
}

# 交易单已创建

{
    "success": false,
    "status": false,
    "error_code": 0,
    "message": "This order alreade exist.",
    "data": {
        "pay_type": "IE0012",
        "pay_type_str": "Alipay Web",
        "out_trade_no": "20220518012",
        "trade_no": null,
        "amount": 1,
        "status": 0,
        "status_str": "Unpay",
        "pay_url": "https://alipay.com/payment/url"
    }
}

# 错误

签名错误

{
    "success": false,
    "status": false,
    "error_code": 104,
    "message": "The signature is not matched.",
    "data": []
}

缺少参数

{
    "success": false,
    "status": false,
    "error_code": 102,
    "message": "The parameters are invalid.",
    "data": {
        "mid": [
            "The mid field is required."
        ]
    }
}

# 查询订单

# 请求信息

请求地址:

https://mypaynz.com/api/v3/query
  1. 请求方式: GET
  2. 参数传递方式: Form URL-Encoded
  3. 设置Content-Type: 'Content-Type: application/json;X-Requested-With=XMLHttpRequest'

# 参数详情

参数 类型 是否可空 是否参与签名 参数描述
mid int(4) No Yes 账号的Merchant Id, 通过注册IEPAY (opens new window)获得
out_trade_no string(64) No Yes 唯一订单号,推荐使用日期+随机数的组合
sign_type MD5, SHA256 No No 加密算法类型 签名
sign string(32) No No 签名

代码示例

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java

## Create transaction  类似
curl --location --request GET 'https://mypaynz.com/api/v3/query?mid=11585&out_trade_no=20220518012&sign=THISJUSTATEST&sign_type=MD5' \
--header 'Content-Type: application/json' \
--header 'X-Requested-With: XMLHttpRequest'

# 结果详情

# 成功

{
    "success": true,
    "status": true,
    "error_code": 0,
    "message": "OK",
    "data": {
        "pay_type": "IE0012",
        "pay_type_str": "Alipay Web",
        "out_trade_no": "20220518012",
        "trade_no": null,
        "amount": 1,
        "status": 0,
        "status_str": "Unpay",
        "refunded_amount": 0,
        "pay_url": "https://alipay.com/payment/url"
    }
}

# 错误

签名错误

{
    "success": false,
    "status": false,
    "error_code": 104,
    "message": "The signature is not matched.",
    "data": []
}

缺少参数

{
    "success": false,
    "status": false,
    "error_code": 102,
    "message": "The parameters are invalid.",
    "data": {
        "mid": [
            "The mid field is required."
        ]
    }
}

# 退款

# 请求信息

请求地址:

https://mypaynz.com/api/v3/refund
  1. 请求方式: POST
  2. 参数传递方式: Form URL-Encoded
  3. 设置Content-Type: 'Content-Type: application/json;X-Requested-With=XMLHttpRequest'

# 参数详情

参数 类型 是否可空 是否参与签名 参数描述
mid int(4) No Yes 账号的Merchant Id, 通过注册IEPAY (opens new window)获得
amount int(10) No Yes 金额,单位:分
out_trade_no string(64) No Yes 唯一订单号,推荐使用日期+随机数的组合
sign_type MD5, SHA256 No No 加密算法类型 签名
sign string(32) No No 签名

代码示例

  • Curl
  • PHP
  • Golang
  • JavaScript
  • Java

## Create transaction  类似
curl --location --request POST 'https://mypaynz.com/api/v3/refund' \
    --form 'mid="11585"' \
    --form 'amount="1"' \
    --form 'out_trade_no="20220518012"' \
    --form 'sign="THISJUSTATEST"' \
    --form 'sign_type="MD5"'

# 结果详情

# 成功

{
    "success": true,
    "status": true,
    "error_code": 0,
    "message": "OK",
    "data": {
        "pay_type": "IE0012",
        "pay_type_str": "Alipay Web",
        "out_trade_no": "20220518012",
        "trade_no": "origin_trade_no",
        "amount": 1,
        "status": 2,
        "status_str": "Refund",
        "refunded": 1
    }
}

# 错误

签名错误

{
    "success": false,
    "status": false,
    "error_code": 104,
    "message": "The signature is not matched.",
    "data": []
}

缺少参数

{
    "success": false,
    "status": false,
    "error_code": 102,
    "message": "The parameters are invalid.",
    "data": {
        "mid": [
            "The mid field is required."
        ]
    }
}