Testing your Integration
...
Testing Overview
Testing your Direct (API) Inte...
Testing Merchant Initiated Transactions
testing merchant initiated transactions these scenarios do not include 3d secure 2 authentication testing see testing 3d secure 2 authentication docid\ bdcgiyqdm3mle ubxp1yr for 3d secure 2 authentication testing for your app merchant initiated transactions (mit) scenarios (positive flow) the first subscription payment must have followed the 3d secure 2 flow contact developer support mailto\ developersupport\@judopay com if you have any queries on initial mit payments see merchant initiated transactions docid\ ek1dldo8cgr9di226zlyf for more information important to consider provide the following fields and associated values in your mit requests recurringpayment indicates if this is a recurring payment relatedreceiptid the receiptid returned from the first subscription payment must be as a result of the initial transaction being processed through a 3d secure 2 flow recurringpaymenttype indicates the type of recurring payment this can be set to 'recurring' (for scheduled payments) or 'mit' (for unscheduled payments) store the cardtoken and relatedreceiptid , as they will be required for future transactions the relatedreceiptid must be as a result of an initial transaction processed from a 3d secure 2 flow you need to tag your mit / recurring transactions correctly using the relatedreceiptid this is to ensure your transactions are not declined by your customers’ issuing bank the relatedreceiptid is the receiptid returned from the first subscription payment it references all subsequent recurring transactions to the original transaction following testing mit transactions in the sandbox environment, it is critical these are tested again with live transaction tests prior to formally going live , as sandbox behaviour differs slightly to live batch based mit tests due to rate limits applied in both sandbox and production, we recommend adding pauses between each mit batch transaction otherwise the quota limit may block transactions and cause undesirable results suggested test scenario expected outcome tip perform a card token payment this will check the card token is valid and matches the stored card details 200 successful ensure you have provided the following fields relatedreceiptid {{receiptid}} recurringpayment true recurringpaymenttype mit example schema { "cardtoken" "va8hcyhapcnekjlmqcymffdlu7njkz9a", "judoid" 100100100, "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134", "currency" "gbp", "amount" 1 01, "recurringpayment" true, "recurringpaymenttype" "mit", "relatedreceiptid" "689469972283396100" } when making token payments, yourconsumerreference must match the original reference when the token was initially created perform a card pan payment 200 successful ensure you have provided the following fields relatedreceiptid {{receiptid}} recurringpayment true recurringpaymenttype mit example schema { "cardnumber" "4111111111111111", "judoid" 100100100, "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134", "currency" "gbp", "amount" 1 01, "recurringpayment" true, "recurringpaymenttype" "mit", "relatedreceiptid" "689469972283396100" } perform a card token preauth this will check the card token is valid and matches the stored card details 200 successful ensure you have provided the following fields relatedreceiptid {{receiptid}} recurringpayment true recurringpaymenttype mit example schema { "cardnumber" "4111111111111111", "judoid" 100100100, "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134", "currency" "gbp", "amount" 1 01, "recurringpayment" true, "recurringpaymenttype" "mit", "relatedreceiptid" "689469972283396100" } when making token preauths, yourconsumerreference must match the original reference when the token was initially created perform a card pan preauth 200 successful ensure you have provided the following fields relatedreceiptid {{receiptid}} recurringpayment true recurringpaymenttype mit example schema { "cardtoken" "va8hcyhapcnekjlmqcymffdlu7njkz9a", "judoid" 100100100, "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134", "currency" "gbp", "amount" 1 01, "recurringpayment" true, "recurringpaymenttype" "mit", "relatedreceiptid" "689469972283396100" } test card data to simulate a successful mit payment use the test cards docid obafnuc1umhk vihhs5d mit request parameters sandbox endpoint https //api sandbox judopay com/transactions/payments sandbox endpoint https //api sandbox judopay com/transactions/preauths http method post header parameters depending on how you integrate with judopay, you can authenticate requests by /paymentsession , or tokensecretauth the token and secret pair for more information, see authentication methods docid\ ylkw5coh5nqnfq3j wjk2 api version 6 22 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 authorization method paymentsessionauthtoken for payment session authentication in the api token header supply the token used to authenticate the call to generate a payment session the payment session header value must also be supplied authorization method paymentsessionauthreference for payment session authentication in the payment session header supply the reference returned in the create payment session response the api token header value must also be supplied body parameters configuration property descriptions parameter description cardtoken string required required a randomly generated string linked to a card saved securely within the judopay card vault judoid string required required unique id supplied by judopay specific to a merchant and/or location format 100100100 maximum length 9 characters do not include spaces or dashes amount decimal required required the amount to process format two decimal places for currencies using a different structure please contact judopay for support currency string required required the currency of the transaction any iso 4217 alphabetic currency code gbp usd eur yourconsumerreference string required required unique reference to anonymously identify your customer advisable to use guids must be below 40 characters yourpaymentreference string required required your unique reference for this payment format maximum length 50 characters this value should be unique in order to protect your customers against duplicate transactions with a server side integration, if a payment reference is not supplied, the transaction will not be processed recurringpayment string optional optional indicates if this is a recurring payment recurringpaymenttype string optional optional indicates the type of recurring payment that the merchant is attempting to process this can be set to recurring (for scheduled payments) or mit (for unscheduled payments) relatedreceiptid string optional optional the receiptid returned from the first subscription payment adding the relatedreceiptid references the subsequent recurring transactions to the original transaction mit request example { "cardnumber" 4111111111111111, "cv2" "838" "expirydate" "01/25", "cardaddress" { "address1" "cardholder house", "address2" "1 cardholder street", "town" "cardholder town", "postcode" "ab1 2cd", "countrycode" 826 }, "judoid" 100502814, "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "yourpaymentreference" "6482c678 cad3 4efd b081 aeae7a89a134", "yourpaymentmetadata" { "internallocationref" "example", "internalid" 99 }, "amount" 1 01, "currency" "gbp", "cardholdername" "john doe", "mobilenumber" 7999999999, "phonecountrycode" 44, "emailaddress" "test user\@judopay com", "shippingaddress" { "isbillingaddress" true }, "threedsecure" { "authenticationsource" "browser", "methodnotificationurl" "https //api sandbox judopay com/order/3ds/methodnotification", "challengenotificationurl" "https //api sandbox judopay com/order/3ds/challengenotification", "methodcompletion" false, "challengerequestindicator" "challengeasmandate" } } response example { "receiptid" "914568453493526528", "yourpaymentreference" "34a73594 f3b2 414c a5c9 58679530b418", "type" "payment", "result" "success", "judoid" 100502814, "originalamount" "5 00", "netamount" "5 00", "amount" "5 00", "currency" "gbp", "carddetails" { "cardlastfour" "1111", "enddate" "1222", "cardtoken" "sof xfmzmenor sj9mtrcvrxhw", "cardtype" 1, "cardscheme" "visa", "cardfunding" "credit", "cardcategory" "", "cardcountry" "us", "bank" "jpmorgan chase bank, n a " }, "cardaddress" { "address1" "cardholder house", "address2" "1 cardholder street", "town" "cardholder town", "postcode" "ab1 2cd", "countrycode" 826 }, "consumer" { "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", }, } merchant initiated transactions (mit) 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 payment with an invalid relatedreceiptid 20026 the receipt id specified is not valid for the request you are attempting attempt a payment where the relatedreceiptid for the original transaction, did not follow the 3d secure 2 flow 185 authentication rejected by the issuer as card authentication has failed attempt a payment with an incorrect yourconsumerreference 154 your provided consumer reference is incorrect, please check your details and try again 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