首页 > 解决方案 > 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
   }
}

所有关于卡/卡令牌/等的数据都是从交易状态请求中获得的。

我的退款请求中是否有任何错误,或者我应该执行一些额外的步骤?

标签: restintegrationpayment-processingwirecard

解决方案


付款和退款请求都存在一系列错误:

  • 付款请求需要有"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支持答案)


推荐阅读