Example: Basic Setup Using the Embedded Widget

This example shows a basic setup using the embedded widget.
The main difference between using an embedded widget and the sidebar is that the
object is set to
var authForm = document.getElementById("authForm"); var transientToken = document.getElementById("transientToken"); var cc = document.getElementById("captureContext").value; var showArgs = { containers: { paymentSelection: "#buttonPaymentListContainer", paymentScreen: "#embeddedPaymentContainer" } }; Accept(cc) .then(function(accept) { return accept.unifiedPayments(
); }) .then(function(up) { return; }) .then(function(tt) { transientToken.value = tt; //merchant should handle tt accordingly – for example submit the tt for processing authForm.submit(); }).catch(function(error) { //merchant logic for handling issues alert("something went wrong"); });
Back to top