Testing your Integration
...
Testing Overview
Testing your Direct (API) Inte...
Testing Refunds
testing refunds card refund scenarios (positive flow) important to consider ensure the refund payments permission is enabled on your api credentials ensure you have the correct receiptid for the original payment or collection this is required for you to process the refund you can make multiple partial refund requests, up to the original transaction amount these scenarios can be used on card apple pay™ google pay™ test transactions to simulate a full or partial refund on the original transaction amount suggested test scenario expected outcome tip process a partial refund you can also make multiple test partial refund requests 200 successful ensure you have the correct receiptid for the original payment or collection, to process the partial refund if you are testing multiple partial refund requests, ensure the combined requests do not exceed the original transaction amount process a full refund 200 successful ensure you have the correct receiptid for the original payment or collection, to process the full refund request parameters sandbox endpoint https //api sandbox judopay com/transactions/refunds http method post header parameters for more information, see authentication methods docid\ ylkw5coh5nqnfq3j wjk2 api version 6 23 for the latest version of the judopay transaction api, see transaction api reference docid\ bcxnm5keok nlnrztafut content type application/json accept application/json authorization method tokensecretauth in the authorization header supply basic { authstring } example basic txpfdpdrszwmsgk4djhxetpjbts4yjq5otdkzmo7ctk1yte0oweymdg1mmy3ywyyzweyztcwymqyzgy3o replace { authstring } with base64 encoding of api token api token (username) colon colon api secret (password) example mzpdkqk1mgi8v3ky mzpdkqk1mgi8v3ky y158n4732dfc7595a149a20381f7af2ea2e70gr6df794b8rnwc019cc5f799kk3 body parameters ensure you have the correct receiptid for the original transaction to process the full or partial refund configuration property descriptions parameter description receiptid string required required judopay's reference for the transaction that is to be refunded amount decimal required required the amount to refund format two decimal places for currencies using a different structure please contact judopay for support currency string required required if specified, the currency must match the original transaction if not specified, the currency of the original transaction will be used any iso 4217 alphabetic currency code gbp usd eur yourpaymentreference string required required your unique reference for this refund format maximum length 50 characters this is not the yourpaymentreference of the original transaction refund request example { "receiptid" "675014982672486400", "amount" 10 99, "currency" "gbp", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134" } response example { "receiptid" "914572343442046976", "originalreceiptid" "914572313402441728", "yourpaymentreference" "9b3855ae cae6 4342 a503 2908e3a1593f", "type" "refund", "createdat" "2022 11 28t17 43 58 9941+00 00", "result" "success", "message" "refund successful", "judoid" 100502814, "merchantname" "shodan cybersource routing", "appearsonstatementas" "apl /shodancybersourcero", "originalamount" "5 00", "netamount" "0 00", "amount" "5 00", "currency" "gbp", "acquirertransactionid" "7016975398", "externalbankresponsecode" "", "carddetails" { "cardlastfour" "1111", "enddate" "1222", "cardtoken" "endper5kpglawedhdj3lzkj5zecqpr4s", "cardtype" 1, "cardscheme" "visa", "cardfunding" "credit", "cardcategory" "", "cardcountry" "us", "bank" "jpmorgan chase bank, n a " }, "consumer" { "yourconsumerreference" "cardswithmultipleconsumers2" } } card refund scenarios (negative flow) declines can occur for various reasons, it can be impossible to simulate all the negative flows in a sandbox environment important to consider how your app handles negative flows your customer's experience should a negative flow occur logic to communicate error messages customise how your app responds how to maintain application consistency follow our suggested guidelines to simulate negative scenarios, to test your app’s error handling suggested negative test scenario expected error code error description attempt a refund on a preauth that has not yet been collected for a preauth that has not yet been collected, follow the testing voids docid\ dmbakskjll551suxqipum 67 sorry, but your refund request was not valid please check that the original transaction was a sale or collection, has not previously been refunded, was not for a lesser amount than your refund request attempt a refund on a preauth that has already been voided 48 sorry, this transaction has been voided you cannot perform a refund on a voided transaction attempt a larger refund amount than the original transaction amount 49 sorry, but the amount you're trying to refund is greater than the original transaction attempt a refund using the incorrect receiptid use the preauth receiptid to simulate the error (for a positive flow, the correct receiptid would be for the original payment or collection) 47 sorry, but it looks like the transaction you are trying to refund is invalid refunds can only be performed on sales and collections where the codes remain fixed, the descriptions may change you should not build any error handling logic based on these descriptions for a list of possible error codes, types and descriptions, see codes and descriptions docid zrsihomuew xnrq4pbtj