Alternative Payments
PayPal
paypal paypal is currently in beta paypal is a popular ewallet, whereby their users are able to send and receive money using funds directly from their wallet and / or from their credit / debit card link your existing paypal account to judopay, to enable an easy integration of paypal alongside other payment methods reconcile your paypal payments within the judopay portal integrating paypal (beta) integrate paypal using our web sdk contact developer support to link your production paypal account to your judopay account currently, you are only able to link your production paypal account for more details on testing , contact developer support prerequisites make sure you are using web sdk version 0 0 18 (or higher) make sure you have implemented the following prerequisites from the web sdk integration guide web sdk docid 40dwe6lbub7vdkza1qydc web sdk docid 40dwe6lbub7vdkza1qydc 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 to hide the payment form iframe, use \<div id="payment iframe" style="position\ absolute;width 0;height 0;border 0;">\</div> to automatically receive non breaking changes, you can pin to the minor version (0 0) rather than the current patch version ( 0 0 45 ) step one display the paypal button currently /payments (immediate capture) is supported when implementing paypal via the web sdk make sure the following parameters are the same values as those entered in web sdk docid 40dwe6lbub7vdkza1qydc otherwise the transaction will fail merchantpaymentreference merchantconsumerreference judoid currency amount this is used to cross reference the validity of the transaction your backend server should store the paymentsession response reference returned by judopay's api use this reference from the response to populate yourpaymentsession make sure you replace the paypalconfiguration object values with your own display the paypal button \<body> \<div id="#paypal button container" >\</div> \<script> const paypalconfiguration = { style {color 'blue', height 34}, merchantid 'yourpaypalmerchantid', amount '1 01', currency 'gbp', merchantpaymentreference 'yourpaymentreference', judoid 'yourjudoid', dynamicdescriptor 'dynamicdescriptor', paymentsession 'yourpaymentsession', consumer { merchantconsumerreference 'yourconsumerreference', firstname 'john', surname 'doe', emailaddress 'example\@domain com' }, billingaddress { address1 'my house', address2 'my street', city 'my city', country 'gb', postcode 'tr14 8pa', }, shippingaddress { address1 'my house', address2 'my street', city 'my city', country 'gb', postcode 'tr14 8pa', }, onsuccess handlesuccess, onerror handleerror } judo getpaypalbutton(paypalconfiguration) then(button => { button render(document getelementbyid("#paypal button container")); }) catch(error => handleerror(error)) \</script> \</body> when the paypal button is clicked, the web sdk will call the method to make the transaction for more information on the paypal button, see paypal's documentation button render options see below for more details on the parameters that create the paypalconfiguration object paypal configuration parameter descriptions true false 239false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type step two handle the response all the judopay web sdk transaction methods return a promise once the authorisation is complete, the promise will be either fulfilled or rejected fulfilled you will receive a json object response (a judopay receipt object) for more information and schema on the json object, see transaction api reference docid\ bcxnm5keok nlnrztafut depending on the result the consumer should be redirected to the appropriate outcome page for example, if the result = success redirect the consumer to the success page this page should display the necessary transaction information (found in the judopay receipt object) rejected you will receive an error object for more information on error responses returned, see payment form error messages docid\ qfxawpaql 2evfp8y94d the consumer should be redirected to an error page response example const onfulfillment = (receiptobject) => { const { result } = receiptobject //redirect to appropriate page depending on the result (success/failure/declined page) } const onrejection = (error) => { //redirect to error page and handle error } for more information on the response codes, see codes and descriptions docid zrsihomuew xnrq4pbtj