Web
...
Web SDK
Payment Request
creating a payment / preauth request with the web sdk when authorising /payments or /preauths it is recommended to use paymentsession prerequisites make sure you are using web sdk version 0 0 34 (or higher) from the web sdk integration guide, you have completed the following docid 40dwe6lbub7vdkza1qydc you do not need to include the amount or currency fields in your request body docid 40dwe6lbub7vdkza1qydc step one making a transaction to make a transaction define the paymentconfiguration object for the payment or preauth ensure the details used when creating the paymentsession match the values set in the following configuration payment configuration object example const paymentconfiguration = { judoid "yourjudoid", amount 1 01, currency "gbp", phonecountrycode "44", challengerequestindicator "challengeasmandate", initialrecurringpayment false, yourconsumerreference "yourconsumerreference", yourpaymentreference "yourpaymentreference", billingaddress { address1 "my house", address2 "my street", town "my town", state "my state", //mandatory for us and canada postcode "tr14 8pa", country "826" }, mobilenumber "07999999999", emailaddress "contact\@judopay com", primaryaccountdetails { name "doe", accountnumber "9999999", dateofbirth "1989 09 19", postcode "ab1 2cd" } } web sdk payment parameter descriptions see below for more details on the parameters that create the paymentconfiguration object true 250 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type 2\ in a function, add the invokepayment call this will invoke a payment using the paymentsession and paymentconfiguration invoke payment example function handlepaymentbuttonclick() { judo invokepayment(paymentsession, paymentconfiguration) then(handlesuccess) catch(handleerror) } to invoke a preauth, change the above code to invokepreauth 3\ to call the function (in step 2 above) to invoke the payment or preauth, add the onclick attribute to the payment button \<div> \<button id="submit payment button" onclick="handlepaymentbuttonclick()"> pay now \</button> 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 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 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 docid zrsihomuew xnrq4pbtj