rest - Wirecard 退款申请
问题描述
我正在尝试整合有线卡付款,但退款交易出现问题。
使用测试用户名“70000-APILUHN-CARD”和密码“8mhwavKVb91T”,我创建了支付处理并且可以看到它是成功的。但是当涉及到退款时,我得到“405 方法不允许”的结果。
所以付款请求如下所示:
POST https://wpp-test.wirecard.com/api/payment/register
使用 auth 标头,包括编码的用户名/密码、内容类型标头和正文:
{
"payment" :
{
"merchant-account-id" :
{
"value" : merchantId
},
"request-id" : generatedRequestId,
"transaction-type" : "auto-sale",
"requested-amount" :
{
"value" : 1,
"currency" : "EUR"
},
"payment-methods" :
{
"payment-method" :
[
{"name" : "creditcard"}
]
}
},
"options" :
{
"mode" : "seamless",
"frame-ancestor" : ancestorURL
}
}
验证后,我可以检查此类交易是否成功完成并且一切正常,因此我尝试使用相同的标题提出退款请求:
POST https://api-test.wirecard.com/engine/rest/merchants/{merchantId}/payments/{transactionId}
与身体:
{
"payment":{
"merchant-account-id":{
"value":merchantId
},
"request-id":generatedRequestId,
"requested-amount":{
"value":1,
"currency":"EUR"
},
"payment-methods":{
"payment-method":[
{
"name":"creditcard"
}
]
},
"card-token":{
"token-id":"4819253888096002"
},
"card":{
"expiration-month":"1",
"expiration-year":"2023",
"card-type":"visa"
},
"parent-transaction-id": parentTransactionId,
"transaction-type":"refund-request"
},
"options":{
"mode":"seamless",
"frame-ancestor":ancestorURL
}
}
所有关于卡/卡令牌/等的数据都是从交易状态请求中获得的。
我的退款请求中是否有任何错误,或者我应该执行一些额外的步骤?
解决方案
付款和退款请求都存在一系列错误:
- 付款请求需要有"transaction-type" : "purchase"而不是"transaction-type" : "auto-sale"
- 退款请求应该有"transaction-type" : "refund-purchase"而不是 "transaction-type" : "refund-request"
- 退款请求也应发送到 URL:“https://api-test.wirecard.com/engine/rest/payments/”
(来自wirecard支持答案)
推荐阅读
- python - 如何创建一个允许用户输入的循环,直到它们在 Python 中是正确的
- html - 为什么“首选”通过标头交付 Content-Security-Policy?
- amazon-s3 - 将 spark DataFrame 写入 s3?
- javascript - 类属性更改时 Redux 重新加载状态
- scala - 线程“主”java.lang.NoSuchMethodError 中的异常:scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps
- c# - 如何使 ComboBox 列的编辑器元素保存用户选择的新值?
- libcurl - libcurl:获取通过 CURLOPT_SSL_VERIFYSTATUS 请求的 libcurl 的结果
- ruby-on-rails - 如何允许从 Trello API ips 渲染到 Web 控制台?
- cassandra - Cassandra - 检查具有 2 个主键的表的行上的 TTL
- javascript - 拆分字符串后的数组值“未定义”?