JavaScript Example: Processing a Payment {#uc-getting-started-cs-js-payment-example}
====================================================================================

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](/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-tokens-intro/uc-auth-tokens.md "").

```
// 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);
```

