On This Page
Example: Unified Checkout without Service
Orchestration
Unified Checkout
without Service
OrchestrationCapture Context Request
{ "targetOrigins" : [ "https://test.com" ], "clientVersion": "0.31", "buttonType": "CHECKOUT_AND_CONTINUE", "allowedCardNetworks": [ "VISA", "MASTERCARD" ], "allowedPaymentTypes": [ "PANENTRY", "CLICKTOPAY", "APPLEPAY", "GOOGLEPAY" ], "country": "US", "locale": "en_US", "captureMandate": { "billingType": "FULL", "requestEmail": true, "requestPhone": true, "requestShipping": true, "shipToCountries": [ "US", "GB" ], "showAcceptedNetworkIcons": true }, "data": { "orderInformation": { "billTo": { "country": "US", "firstName": "NEW", "lastName": "Test", "phoneNumber": "1234567890", "address2": "Desk M3-5573", "address1": "901 Metro Center Blvd", "buildingNumber": "150", "postalCode": "94404", "locality": "Foster City", "administrativeArea": "CA", "email": "test@example.com" }, "shipTo": { "country": "US", "firstName": "NEW", "lastName": "Test", "address2": "Desk M3-5573", "address1": "901 Metro Center Blvd", "buildingNumber": "150", "postalCode": "94404", "locality": "Foster City", "administrativeArea": "CA" }, "amountDetails": { "totalAmount": "13.00", "currency": "USD" } }, "clientReferenceInformation": { "code": "TAGX001" } } }
JavaScript
<script type="text/javascript"> const sidebar = true; const captureContext = document.getElementById("captureContext").value; const showArgs = { containers: { paymentSelection: "#buttonPaymentListContainer" } }; async function launchCheckout() { try { const accept = await Accept(captureContext); const up = await accept.unifiedPayments(sidebar); const tt = await up.show(showArgs); console.log(tt); // merchant logic for passing the Transient token to their backend for service orchestration } catch (error) { // merchant logic for handling issues console.error("something went wrong: " + error); } } // Call the function launchCheckout(); </script>