域名管理
-
token
正式域名 : https://apptms.nihaopay.com 测试域名 : http://apptms.aurfy.com
-
txnToken
正式域名 : https://api.nihaopay.com 测试域名 : https://apitest.nihaopay.com
测试账号
- 美元测试账号
商户号:M086100288 商户后台登录名:414039913123123@qq.com 商户后台登录密码:abcd.1234 交易密码:709Vej8GjH
txnToken:c7978f40e669f86c6409f029181b3f0aef8621a6173b136b9c22c71c956f6f79 token: 1882aa15dd2a06eebb97f8c597c65640e1f7158e095864e16ea057f103a47c1e
功能接口
- 请求头token拼接
"Authorization: Bearer <TOKEN>"
- 部分接口请求头的token为txnToken
1.登陆
简要描述:
- 账号登陆
请求URL:
- http://apptms.aurfy.com/out/login
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
username | 是 | string | 用户名 |
password | 是 | string | 密码 |
machineCode | 否 | string | 昵称 |
返回示例
{
"userContext": {
"merCode": "M086100288",
"token": "1882aa15dd2a06eebb97f8c597c65640e1f7158e095864e16ea057f103a47c1e",
"txnToken": "c7978f40e669f86c6409f029181b3f0aef8621a6173b136b9c22c71c956f6f79",
"userEmail": "414039913123123@qq.com",
"subMerCode": null,
"merName": "HelloMan",
"currency": "USD",
"userRole": "Admin"
},
"isSuccess": true
}
{
"isSuccess": false,
"msg": "user not exist"
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
merCode | string | 商户号 |
token | string | token |
txnToken | string | txnToken |
userEmail | string | |
subMerCode | string | 子商户号 |
merName | string | 商户名称 |
currency | string | 币种 |
userRole | string | 用户权限 |
备注
- 无
2.首页前五条交易以及当天交易总金额
简要描述:
- 首页的内容展示
请求URL:
- http://apptms.aurfy.com/out/transactions/recentTxn
请求方式: - POST
参数:
- 无请求参数
返回示例
{
"transactions": [
{
"createDate": "2017-10-26 06:54:16",
"updateDate": "2017-10-26",
"txnDate": "2017-10-26 14:57:00",
"version": "1.2",
"charset": null,
"language": "English",
"txnType": "Purchase",
"merCode": "M001100271",
"subMerCode": null,
"merOrderId": "20171026145628415626",
"merOrderDate": "20171026",
"merOrderTime": "145659",
"merOrderAmount": 0.01,
"bizCode": "POS",
"txnAmount": 0.01,
"exchangeRate": 1,
"txnStatus": "success",
"merPrivate1": null,
"merPrivate2": null,
"merReserved": null,
"originalTxnId": null,
"accessURL": null,
"clientIP": "180.167.25.154",
"merOrderDescription": null,
"browserReturnURL": null,
"serverNotifyURL": null,
"deliveryAddressId": null,
"orderTimeZone": "CN",
"orderTimeOut": "3",
"signature": "nosignature",
"branchId": "a2532b43-cd01-46bf-bbdb-57c3bd16dcb2",
"saleId": "44ae59ba11314245981c36f00381a0f4",
"agentId": null,
"pspId": null,
"cardOrg": "wechatpay",
"receiveBankTraceNo": null,
"sendBankOrderId": null,
"startTxnDate": null,
"endTxnDate": null,
"countIp": null,
"sumAmount": null,
"txnFinishDate": "2017-10-26 14:57:02",
"mappedRespCode": null,
"merCodes": null,
"maxAmount": null,
"minAmount": null,
"goodsAmount": 0,
"platformAmount": 0,
"cancellationFlag": null,
"paymentRefundAmount": null,
"cutoffStatus": null,
"bizCategory": null,
"terminalID": "QR",
"currencyName": "USD",
"id": "20171026145659105687"
},
... 省略4条数据
],
"totalAmount": "0.03",
"isSuccess": true,
"currency": "USD"
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
totalAmount | string | 总金额 |
txnDate | string | 交易时间 |
cardOrg | string | 交易类型 |
txnStatus | string | 交易状态 |
paymentRefundAmount == txnAmount | string | refunded交易状态 |
txnAmount | string | 交易金额 |
merName | string | 商户名称 |
currencyName | string | 币种 |
id | string | id |
userRole | string | 用户权限 |
备注
- refunded为两个参数对比判断是否为相等
- txnStatus :success pending new cancelled closed capture failure
3.退款
简要描述:
- 退款接口
请求URL:
- http://tip.aurfy.com/api/transactions/merchantRefund
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
currency | 是 | string | 币种 |
txnId | 是 | string | 交易id |
pwd | 是 | string | 交易密码 |
refundAmount | 是 | string | 退款金额 |
adminEmail | 是 | string | 用户邮箱 |
备注 - token为token
返回示例
{
"message": "refund success",
"refundDate": "2017-10-27 10:18:28",
"refundId": "20171027101823000856",
"isSuccess": true
}
{
"message": "63(The original transaction failed. You cannot refund, cancel, capture, or release an unsuccessful transaction.)",
"isSuccess": false
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
refundDate | string | 退款日期 |
refundId | string | 退款id |
备注
- 无
4.交易详情
简要描述:
- 查询单个交易详情的接口
请求URL:
- http://tip.aurfy.com/api/transactions/detail/{id}
请求方式: - GET
参数:
- 拼接id
备注 - 请求token为 txnToken
返回示例
{
"transaction": {
"txnDate": "2017-10-26 15:55:22",
"merOrderId": "20171026155502908974",
"txnAmount": 0.01,
"txnStatus": "success",
"merOrderDescription": null,
"cardOrg": "alipay",
"txnFinishDate": "2017-10-26 15:52:17",
"currencyName": "USD",
"paymentRefundAmount": 0.01,
"id": "20171026155521105690"
},
"isSuccess": true
}
{
"isSuccess":false,
"message":"transaction not found"
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
txnDate | string | 交易时间 |
merOrderId | string | 交易id |
txnAmount | string | 交易金额 |
txnStatus | string | 交易状态 |
id | string | 子商户号 |
备注
-
- txnStatus可选项 success, pending, closed, failure,cancelled
- 尚缺小费参数,和payment NO , Merchant reference不明确
5.交易查询
简要描述:
- 交易历史记录查询
请求URL:
- http://apptms.aurfy.com/out/transactions/search
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
pageNum | 是 | string | 页码 |
pageSize | 是 | string | 请求数 |
txnStatus | 否 | string | 交易状态 |
id | 否 | string | id |
备注 - 1. txnStatus可选项 SUCCESS, PENDING, CLOSED, FAIL
返回示例
{
"isSuccess": true,
"pagination": {
"totalRows": 1,
"pageSize": 10,
"currPageNum": 1,
"totalPages": 1,
"startRow": 0,
"endRow": 1,
"pageData": [
{
"createDate": "2017-10-26 06:41:24",
"updateDate": null,
"txnDate": "2017-10-26 14:44:08",
"version": "1.2",
"charset": null,
"language": "English",
"txnType": "Purchase",
"merCode": "M001100271",
"subMerCode": null,
"merOrderId": "20171026144334758583",
"merOrderDate": "20171026",
"merOrderTime": "144407",
"merOrderAmount": 4.5,
"bizCode": "Show QRCode",
"txnAmount": 4.5,
"exchangeRate": 1,
"txnStatus": "pending",
"merPrivate1": null,
"merPrivate2": null,
"merReserved": null,
"originalTxnId": null,
"accessURL": null,
"clientIP": "127.0.0.1",
"merOrderDescription": null,
"browserReturnURL": "http://nihaopay.com",
"serverNotifyURL": "http://demo.aurfy.cn:8007/ipn",
"deliveryAddressId": null,
"orderTimeZone": "CN",
"orderTimeOut": "30",
"signature": "nosignature",
"branchId": "a2532b43-cd01-46bf-bbdb-57c3bd16dcb2",
"saleId": "44ae59ba11314245981c36f00381a0f4",
"agentId": null,
"pspId": null,
"cardOrg": "alipay",
"receiveBankTraceNo": null,
"sendBankOrderId": null,
"startTxnDate": null,
"endTxnDate": null,
"countIp": null,
"sumAmount": null,
"txnFinishDate": null,
"mappedRespCode": null,
"merCodes": null,
"maxAmount": null,
"minAmount": null,
"goodsAmount": 0,
"platformAmount": 0,
"cancellationFlag": null,
"paymentRefundAmount": null,
"cutoffStatus": null,
"bizCategory": null,
"terminalID": "QR",
"currencyName": "USD",
"id": "20171026144407105684"
}
],
"totalAmount": null,
"totalFee": null
}
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
txnDate | string | 交易时间 |
cardOrg | string | 交易类型 |
txnStatus | string | 交易状态 |
txnAmount | string | 交易金额 |
id | string | id |
备注
- 无
6.修改密码
简要描述:
- 账号登陆
请求URL:
- http://apptms.aurfy.com/out/user/modifypwd
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
oldpwd | 是 | string | 当前密码 |
newpwd | 是 | string | 新密码 |
返回示例
{
"isSuccess": true
}
{
"message": "The login password is wrong",
"isSuccess": false
}
备注
- 根据返回的isSuccess判断是否修改成功
7.小费接口(scanQRcpde)
简要描述:
- 付款前先提交保存记录,先调用摄像头扫码获取信息,再调用该接口
请求URL:
- http://tip.aurfy.com/api/transactions/scanqrcode
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
origin_amount | 是 | string | 订单金额 |
tip_amount | 是 | string | 小费金额 |
currency | 是 | string | 币种 |
vendor | 是 | string | 付款方式 |
reference | 是 | string | 新密码 |
buyer_identity_code | 是 | string | 二维码或条形码的内容 |
client_ip | 是 | string | 终端ip |
description | 否 | string | 订单描述 |
note | 否 | string | 备注 |
备注 - 请求token为 txnToken
返回示例
{
暂无
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
status | string | 交易状态;支付成功 success, 支付失败failure, 支付中pending, 交易关闭closed |
sys_reserve | string | 系统备用字段。返回Json格式的字符串,如果支付成功,返回渠道的交易流水号 |
amount | int | 订单金额 |
currency | string | 订单币种 |
id | string | NihaoPay生成的唯一交易流水号 |
time | string | 交易在NihaoPay系统中的完成时间. 例如: 2015-01-01T01:01:00Z(NihaoPay使用的是UTC时区) |
reference | string | 商户订单号 |
note | string | 备注 |
备注
- 根据返回的isSuccess判断是否修改成功
8.小费接口(showQRcpde)
简要描述:
- 付款前先提交保存记录,先调用摄像头扫码获取信息,再调用该接口
请求URL:
- http://tip.aurfy.com/api/transactions/showqrcode
请求方式: - POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
origin_amount | 是 | string | 订单金额 |
tip_amount | 是 | string | 小费金额 |
currency | 是 | string | 币种 |
vendor | 是 | string | 付款方式 |
reference | 是 | string | 新密码 |
ipn_url | 是 | string | 支付通知接收的URL |
timeout | 否 | string | 超时时间 |
description | 否 | string | 订单描述 |
note | 否 | string | 备注 |
备注 - 请求token为 txnToken
返回示例
{
暂无
}
返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
code_url | string | 二维码URL |
id | string | NihaoPay生成的唯一交易ID |
amount | int | 订单金额 |
currency | string | 订单币种 |
timeout | string | 二维码的有效时间(分钟),超过该时间,二维码将失效。 |
time | string | 交易在NihaoPay系统中的完成时间. 例如: 2015-01-01T01:01:00Z(NihaoPay使用的是UTC时区) |
reference | string | 商户订单号 |
time | string | 交易在NihaoPay系统中的时间. 例如: 2015-01-01T01:01:00Z(NihaoPay使用的是UTC时区). |
备注
- 根据返回的isSuccess判断是否修改成功
9.查询订单(showQRcpde)
简要描述:
- 在展示付款二维码之后,订单轮询
请求URL:
- http://tip.aurfy.com/api/transactions/detail/{{id}}
请求方式: - GET
参数:
- 拼接id
备注 - 请求token为 txnToken
返回示例
{
暂无
}
返回参数说明
- 暂无
备注
- 根据返回的isSuccess判断是否修改成功,跳转到制定id的paySuccess