I'm trying to integrate wirecard payments and got a problem with the refund transaction.
With test username "70000-APILUHN-CARD" and password "8mhwavKVb91T" i've created payment processing and could see that it's successful. But when it comes to refund i get "405 method not allowed" result.
So the payment request looks like this:
POST https://wpp-test.wirecard.com/api/payment/register
With auth header including encoded username/password, content-type header, and body:
{
"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
}
}
After verification i could check that such transaction successfully completed and everything is fine, so i tried to make a refund request with the same headers:
POST https://api-test.wirecard.com/engine/rest/merchants/{merchantId}/payments/{transactionId}
and body:
{
"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
}
}
Where all the data about card/card-token/etc were obtained from transaction state request.
Is there any mistakes in my refund request, or maybe there are some extra steps that i should perform?
There are a set of mistakes both in payment and in refund requests:
(From wirecard support answer)