On This Page
JavaScript Example: Processing a Payment
Payment is initiated when
Unified Checkout
captures the customer's
payment information by calling the client.createCheckout()
. When
autoProcessing
is set to true
, the payment
is completed. When autoProcessing
is set to
false
, you can manually complete the payment using
checkout.complete(token)
. See Authorizations with a Transient Token.// Automatic (default when completeMandate is in session) const checkout = await client.createCheckout({ autoProcessing: true }); const result = await checkout.mount('#buttons'); // result is the completed transaction — no need to call complete() // Manual - similar to v0 const checkout = await client.createCheckout({ autoProcessing: false }); const token = await checkout.mount('#buttons'); const result = await checkout.complete(token);