On the sandbox API endpoint i try to refund a previously valid transaction (120053733345) with the following createTransactionRequest array (converted into JSON):
Array
(
[merchantAuthentication] => Array
(
[name] => mytestname
[transactionKey] => mytestkey
)
[refId] => 1041-352205
[transactionRequest] => Array
(
[transactionType] => refundTransaction
[amount] => 29.00
[currencyCode] => CAD
[refTransId] => 120053733345
[payment] => Array
(
[creditCard] => Array
(
[cardNumber] => 5121212121212124
[expirationDate] => 2028-01
)
)
)
)
While the authCaptureTransaction operation works fine, i receive an error with the refundTransaction operation:
The element ‘transactionRequest’ in namespace ‘AnetApi/xml/v1/schema/AnetApiSchema.xsd’ has invalid child element ‘payment’ in namespace ‘AnetApi/xml/v1/schema/AnetApiSchema.xsd’. List of possible elements expected: ‘splitTenderId, order, lineItems, tax, duty, shipping, taxExempt, poNumber, customer, billTo, shipTo, customerIP, cardholderAuthentication, retail, employeeId, transactionSettings, userFields, surcharge, merchantDescriptor, subMerchant, tip, processingOptions, subsequentAuthInformation, otherTax, shipFrom, authorizationIndicatorType’ in namespace ‘AnetApi/xml/v1/schema/AnetApiSchema.xsd’.
I’ve tried to follow the instruction in
https://developer.authorize.net/api/reference/index.html#payment-transactions-refund-a-transaction
and
Is it possible to refund a transaction in Authorize.Net sandbox account?
but with no success.