您可以在沙盒中测试退款,但它必须满足与生产环境相同的所有标准。他们的示例可能有陈旧的数据,但如果您使用新数据,它将对您有用。
要发出退款,必须满足以下条件:
- 该交易最初是通过支付网关 (Authorize.Net) 处理并成功结算的。
x_trans_id
交易是使用原始成功结算交易的有效交易 ID ( ) 提交的。
- 申请退款的金额小于或等于原结算金额。
- 针对原交易提交的多笔 Credit 交易之和小于或等于原结算金额。
x_card_num
至少提交用于原始、成功结算的交易的信用卡号 ( ) 的最后四位。不需要到期日期。
- 交易在原交易结算日后120日内提交。
这是我刚刚做的一个测试:
AUTH_CAPTURE
{
"createTransactionRequest":{
"merchantAuthentication":{
"name":"",
"transactionKey":""
},
"refId":49782069,
"transactionRequest":{
"transactionType":"authCaptureTransaction",
"amount":5,
"payment":{
"creditCard":{
"cardNumber":"4427802641004797",
"expirationDate":"122020",
"cardCode":"999"
}
},
"order":{
"invoiceNumber":"1324567890",
"description":"this is a test transaction"
},
"lineItems":{
"lineItem":[
{
"itemId":"1",
"name":"vase",
"description":"Cannes logo",
"quantity":"18",
"unitPrice":"45.00"
},
{
"itemId":"2",
"name":"desk",
"description":"Big Desk",
"quantity":"10",
"unitPrice":"85.00"
}
]
},
"tax":{
"amount":"4.26",
"name":"level2 tax name",
"description":"level2 tax"
},
"duty":{
"amount":"8.55",
"name":"duty name",
"description":"duty description"
},
"shipping":{
"amount":"4.26",
"name":"level2 tax name",
"description":"level2 tax"
},
"poNumber":"456654",
"customer":{
"id":"18",
"email":"someone@blackhole.tv"
},
"billTo":{
"firstName":"Ellen",
"lastName":"Johnson",
"company":"Souveniropolis",
"address":"14 Main Street",
"city":"Pecan Springs",
"state":"TX",
"zip":"44628",
"country":"USA"
},
"shipTo":{
"firstName":"China",
"lastName":"Bayles",
"company":"Thyme for Tea",
"address":"12 Main Street",
"city":"Pecan Springs",
"state":"TX",
"zip":"44628",
"country":"USA"
},
"customerIP":"192.168.1.1",
"transactionSettings":{
"setting":[
{
"settingName":"allowPartialAuth",
"settingValue":"false"
},
{
"settingName":"duplicateWindow",
"settingValue":"0"
},
{
"settingName":"emailCustomer",
"settingValue":"false"
},
{
"settingName":"recurringBilling",
"settingValue":"false"
},
{
"settingName":"testRequest",
"settingValue":"false"
}
]
},
"userFields":{
"userField":[
{
"name":"MerchantDefinedFieldName1",
"value":"MerchantDefinedFieldValue1"
},
{
"name":"favorite_color",
"value":"blue"
}
]
}
}
}
}
RESPONSE
{
"transactionResponse":{
"responseCode":"1",
"authCode":"A2XE99",
"avsResultCode":"Y",
"cvvResultCode":"P",
"cavvResultCode":"2",
"transId":"40047374169",
"refTransID":"",
"transHash":"",
"testRequest":"0",
"accountNumber":"XXXX4797",
"accountType":"Visa",
"messages":[
{
"code":"1",
"description":"This transaction has been approved."
}
],
"userFields":[
{
"name":"MerchantDefinedFieldName1",
"value":"MerchantDefinedFieldValue1"
},
{
"name":"favorite_color",
"value":"blue"
}
],
"transHashSha2":"D8C48317CB529C6DFCC472F4548CAAC18F17F505BAD9077E54C117854D8791BADBC76DF6ECEA330E0462E0F9C4C60FDC13BEBDA068E5431EAA551DEB97F358DF",
"SupplementalDataQualificationIndicator":3,
"networkTransId":"A3HTA7GK9GEC0S1889A0M5O"
},
"refId":"49782069",
"messages":{
"resultCode":"Ok",
"message":[
{
"code":"I00001",
"text":"Successful."
}
]
}
}
退款
{
"createTransactionRequest":{
"merchantAuthentication":{
"name":"",
"transactionKey":""
},
"refId":49782069,
"transactionRequest":{
"transactionType":"refundTransaction",
"amount":5,
"payment":{
"creditCard":{
"cardNumber":"4427802641004797",
"expirationDate":"122020"
}
},
"authCode":"A2XE99"
}
}
}
RESPONSE
{
"transactionResponse":{
"responseCode":"1",
"authCode":"",
"avsResultCode":"P",
"cvvResultCode":"",
"cavvResultCode":"",
"transId":"40047374178",
"refTransID":"",
"transHash":"",
"testRequest":"0",
"accountNumber":"XXXX4797",
"accountType":"Visa",
"messages":[
{
"code":"1",
"description":"This transaction has been approved."
}
],
"transHashSha2":"A5390A4933681142E2A41FEC37BF0303FC5FF30D9DF9CBD05FABEC2FA87FE3E241F0705B559924313E972E5457A633CCFA62B7C52A63D93BBB67ACC102D9984B",
"SupplementalDataQualificationIndicator":0
},
"refId":"49782069",
"messages":{
"resultCode":"Ok",
"message":[
{
"code":"I00001",
"text":"Successful."
}
]
}
}