JavaScript Example: Setting Up with Full Sidebar

<html> <head> <script src="[INSERT clientLibrary VALUE HERE]" integrity="[INSERT clientLibraryIntegrity VALUE HERE]” crossorigin=”anonymous" ></script> </head> <body> <h1>Unified Checkout Integration</h1> <input type="hidden" name="captureContext" value="[INSERT captureContext HERE]" /> <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); const completeResponse = await up.complete(tt); console.log(completeResponse); // merchant logic for handling complete response } catch (error) { // merchant logic for handling issues console.error("something went wrong: " + error); } } // Call the function launchCheckout(); </script> </body>