Testing your Integration
...
Testing Overview
Testing your Wallet Payment In...

Testing Digital Wallet Payments - via Web SDK

testing digital wallet payments via web sdk make sure you are using web sdk version 0 0 18 (or higher) decline scenarios for wallet payments cannot be tested in the sandbox environment testing card payments for your digital wallet payments via judopay's web sdk integration apple pay™ prerequisites from the web sdk integration guide web sdk docid 40dwe6lbub7vdkza1qydc web sdk docid 40dwe6lbub7vdkza1qydc to hide the payment form iframe, use \<div id="payment iframe" style="position\ absolute;width 0;height 0;border 0;">\</div> the payment form iframe must be loaded onto the page in order for payments to work however displaying the form to the consumer is not required for this transaction type web sdk docid 40dwe6lbub7vdkza1qydc web sdk docid 40dwe6lbub7vdkza1qydc web sdk docid 40dwe6lbub7vdkza1qydc direct from judopay judopay judoid a valid apple developer merchantid domain association get it web sdk docid 40dwe6lbub7vdkza1qydc from the merchant domain(s) being used for apple pay™ these are the domain(s) where the apple pay™ button will be displayed, for example the checkout page these must be ssl enabled domains, apple will not allow non encrypted domains to be used account(s) being used for apple pay™ for a successful end to end wallet payment testing journey, it is recommended to perform wallet test scenarios in a production environment use live cards to process test payments and preauths google pay™ prerequisites from the web sdk integration guide web sdk docid 40dwe6lbub7vdkza1qydc web sdk docid 40dwe6lbub7vdkza1qydc to hide the payment form iframe, use \<div id="payment iframe" style="position\ absolute;width 0;height 0;border 0;">\</div> the payment form iframe must be loaded onto the page in order for payments to work however displaying the form to the consumer is not required for this transaction type web sdk docid 40dwe6lbub7vdkza1qydc direct from judopay judopay account (sandbox and eventually live) judopay judoid merchant requirement (google requirement) prior to going live with google pay™ web payments, you must have a valid google verified live merchant id to receive your live merchant id follow google pay™'s integration checklist, to ensure you have completed all the required steps in your integration begin the process to obtain production access from google, here to add your test card suite to your digital wallet to process test payments and preauths, register your google pay wallet details for the cards in your test card suite are hard coded into the test wallet, therefore some negative scenarios cannot be simulated, due to limitations to google pay™s test environment for example you cannot simulate an incorrect cv2, or insufficient funds you will only receive a success response no charge will be made on the test cards wallet payment scenarios (positive flow) the digital wallet payment flow provides consumers with an extra layer of security, encrypting and decrypting the card details sent in the payload by replacing the consumer's card details with a device token, or dynamic security code apple pay™ and google pay™ scenarios suggested test scenario expected outcome process an apple pay™ wallet payment 200 successful process an apple pay™ wallet preauth 200 successful process a google pay™ wallet payment 200 successful process a google pay™ wallet preauth 200 successful for more information on api credentials and permissions, see introduction docid\ s 8hoamytkgy13t0p657 calling the web sdk functions apple pay™ configuration object parameters paymentrequestapplepay parameter description 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 initiativecontext string optional optional your fully qualified domain name associated with your apple pay merchant identity certificate the default is window\ location hostname for example initiativecontext ="web judopay com" methodconfiguration object optional optional this parameter contains the following fields version number supportednetworks array containing any of the following strings “amex” “chinaunionpay” “discover” “mastercard” “visa” “maestro” “jcb” merchantcapabilities array containing any of the following strings "supports3ds" "supportscredit" "supportsdebit" "supportsemv" countrycode string details object optional optional provides information about the specific transaction use this object to supply the information for recurring payments for more information, see apple pay™ for web docid\ oelqjygambce2048qcjp1 see here for more details on the parameter fields options object optional optional enables you to set options to control the behaviour of the user agent see here for more details on the parameter fields onshippingaddresschange method optional optional dispatched when the user changes their shipping address see here for more details on this parameter onshippingoptionchange method optional optional dispatched when the user changes a shipping option see here for more details on this parameter delayedauthorisation boolean optional optional for preauths only set to true to authenticate a card holder with 3d secure, without performing payment authorisation when set to true, the 3d secure authentication status is returned in the response the payment authorisation is carried out at the stage when you are ready to collect the amount from the customer the default value = false initialrecurringpayment boolean optional optional indicates if this initial payment is part of a recurring payment for more information, see apple pay™ for web docid\ oelqjygambce2048qcjp1 google pay™ configuration object parameters paymentrequestgooglepay parameter description 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 paymentsession string required required a unique string that references the payment session of this transaction the paymentsession will expire in 30 minutes , unless an expirydate is set in the /paymentsession request body to get the reference use any google merchant id when creating a google pay™ transaction request in sandbox use your verified live merchant id when creating a live google pay™ transaction request choose from the following transaction modes payment pre auth use the paymentsession response reference to populate this field transactionmode string required required represents type of transaction values payment pre auth onsuccess function required required set as the function you want called when the transaction is successful the response object will be passed as a parameter for more information on how to handle the response, testing digital wallet payments via web sdk docid\ t13itu 7qx7ylrxgvj5jt onerror function required required set as the function you want called when there is an error the error object will be passed as a parameter for more information on how to handle the response, see testing digital wallet payments via web sdk docid\ t13itu 7qx7ylrxgvj5jt paymentrequest object required required use this to configure your site's support for the google pay™ api for more information on this parameter and the fields it can contain, see paymentdatarequest (for example, if you include the optional flags, such as emailrequired (default=true), this will affect whether the related information (e g the google pay email) is available in the result object, which is returned when the transaction is complete) you are required to provide the following mandatory fields merchantinfo to process payments, set the merchantid attribute in this object use the merchantid provided after registering with google pay™ this is a requirement for processing a google pay™ payment in production allowedpaymentmethods\[ ] the only mandatory attribute to be provided parameters allowedcardnetworks transactioninfo the example paymentrequest object snippet in step one, shows the fields that must be provided (judopay will provide the other required fields) environment string optional optional represents the environment type google pay™ will run in values production test buttonstyle object optional optional change the style of the google pay™ button for more details on the fields you can set, see google pay™ for web docid\ docx7icjrl11phchkz y onpaymentdatachanged function optional optional used when payment data changes in the payment form, for example shipping address shipping options for more information on this parameter, see onpaymentdatachanged onpaymentauthorized function optional optional used when a payment is authorized in the payment form for more information on this parameter, see onpaymentauthorized onreadytopaychange function optional optional used when the consumer's isreadytopay state changes change the application's behaviour, based on whether or not the consumer is ready to pay when existingpaymentmethodrequired = true, inspect both result isreadytopay and result paymentmethodpresent to determine if the consumer isreadytopay and has a paymentmethodpresent alternatively result isbuttonvisibl e can be used to determine whether or google pay™ button will be displayed existingpaymentmethodrequired is taken into account with result isbuttonvisible also raised as event " readytopaychange " for more information on this parameter, see button element challengerequestindicator string optional optional indicates the type of challenge request you wish to apply values nopreference nochallenge no challenge required challengepreferred a challenge is preferred for this transaction challengeasmandate must challenge this transaction this should not be included in the same configuration object as scaexemption scaexemption string optional optional to apply for an exemption from sca, for a customer initiated transaction values lowvalue transactions up to €45 do not require sca, up to a maximum of five consecutive transactions, or a cumulative limit of €100 securecorporate request exemption for payments made using a corporate card trustedbeneficiary provides the cardholder the option to add the merchant to their trusted list transactionriskanalysis allows for certain remote transactions to be exempt from sca, provided a robust risk analysis is performed this should not be included in the same configuration object as challengerequestindicator delayedauthorisation boolean optional optional for preauths only set to true to authenticate a card holder with 3d secure, without performing payment authorisation when set to true, the 3d secure authentication status is returned in the response the payment authorisation is carried out at the stage when you are ready to collect the amount from the customer the default value = false initialrecurringpayment boolean optional optional indicates if this initial payment is part of a recurring payment apple pay request example //4 called when the apple pay button is clicked function handleapplepaybuttonclick() { let applepayconfiguration = { amount 'amount', currency 'currency', yourconsumerreference 'yourconsumerreference', yourpaymentreference 'yourpaymentreference', judoid 'judoid', initiativecontext 'yourdomainname' } //trigger websdk apple pay payment with apple pay configuration object judo digitalwallets invokepaymentwithapplepay(paymentsession, configuration) then(handlesuccess) // judopay receipt object will be returned catch(handleerror) // judopay error object will be returned } //1 create apple pay button with styling object var button = judo digitalwallets getapplepaybutton({ height 38, width 240, language 'en', style 'black', type 'buy'}); //2 set the function to be called when the apple pay button is clicked button onclick = handleapplepaybuttonclick //3 add the apple pay button to your page const container = document getelementbyid('apple pay button container') container append(button) google pay request example const googlepayconfiguration = { judoid "yourjudoid", amount "12 99", currency "gbp", yourpaymentreference "yourpaymentreferenc", yourconsumerreference "yourconsumerreference", paymentsession "yourpaymentsession", environment "test", transactionmode "payment", buttonstyle { type "buy", sizemode "static", locale "en", width "200", height "36" } paymentrequest = { merchantinfo { merchantid 'yourmerchantid' //issued after registration }, allowedpaymentmethods \[{ parameters { allowedcardnetworks \['visa', 'mastercard', 'amex'] } }], transactioninfo { totalpricestatus 'final', totalprice '1 0', currencycode 'gbp', countrycode 'gb' } } onsuccess handlesuccess, // judopay receipt object will be returned onerror handleerror // judopay error object will be returned } //1 initialize google pay button with google pay configuration object (includes logic to trigger the payment when clicked) const button = judo digitalwallets getgooglepaybutton(googlepayconfiguration) //2 add the google pay button to your page const container = document getelementbyid('google pay button container') container append(button) response example (judopay receipt object) { "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", }, } once the authorisation is complete you will receive either a json object response (a judopay receipt object) example in the code snippet above an error object the consumer should be redirected to the outcome screen and the response/error should be handled accordingly for example, if the result = success redirect the consumer to the success page, else error for more information on the response codes, see codes and descriptions docid zrsihomuew xnrq4pbtj wallet payment scenarios (negative flow) decline scenarios for wallet payments cannot be tested in the 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 limited test coverage is possible in the sandbox environment the suggested negative test scenarios refer to model and processing error codes and information on why the transaction request failed judopay's validation checks, which are similar to card payment scenarios suggested negative test scenario expected error code error description attempt to perform a wallet payment / preauth request with the incorrect currency entered for the specified transaction default currency = gbp 72 sorry, we're currently unable to route this transaction please check your account details and try again if this issue persists, please contact customer services this is a codes and descriptions docid zrsihomuew xnrq4pbtj attempt to perform a wallet payment / preauth request with the incorrect environment (live or sandbox) for your api token and api secret and configuration 7 sorry, we were unable to authorize this request please check your details and permissions before trying again where the codes remain fixed, the descriptions may change you should not build any error handling logic based on these descriptions for more information on error responses returned, see web sdk docid 40dwe6lbub7vdkza1qydc next steps using the response information from a successful wallet payment test transaction, you can test the following scenarios directly call the transaction api to make a testing collections docid\ yvjgzt2gxwbdxm3m0wemu testing refunds docid\ mebkvlfmxdp3kolys0uda testing voids docid\ dmbakskjll551suxqipum