Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management

Stripe payments with Visa CheckoutDeprecated

Accept payments via Visa Checkout in your existing Stripe integration.

Warning

Visa terminated support for Visa Checkout in favor of Secure Remote Commerce, which delivers unified online checkout supporting multiple of card brands. Stripe doesn’t support new Visa Checkout integrations and existing Visa Checkout integrations must migrate to Secure Remote Commerce as soon as possible.

Visa Checkout guidelines

Before implementing, please refer to the Visa Checkout terms of service and user interface guidelines.

Visa Checkout is a third-party service that stores payment and shipping information for its users in order to streamline the checkout process. Instead of entering payment information on your checkout page, users can click the Visa Checkout button instead. Your Stripe integration receives a unique ID that it can use to create a charge against the payment information stored in the user’s Visa Checkout account.

Integrating the Visa Checkout button

To get started, generate your Visa Checkout API key in the Dashboard. There are two keys, a sandbox key that you can use while testing, and a production key that works in live mode.

To use Visa Checkout on your website, add the following script tag to the end of your document’s body tag:

<script type="text/javascript" src="https://sandbox-assets.secure.checkout.visa.com/checkout-widget/resources/js/integration/v1/sdk.js"></script>

To display the Visa Checkout button, use the following image:

<img alt="Visa Checkout" class="v-button" role="button" src="https://sandbox.secure.checkout.visa.com/wallet-services-web/xo/button.png">

To initialize the button, add an onVisaCheckoutReady function that invokes V.init:

function onVisaCheckoutReady() { V.init({ apikey: '{{VISA_CHECKOUT_ID}}', paymentRequest:{ subtotal: '10.00', currencyCode: 'USD' }, settings: { displayName: 'My Website' } }); }

The Visa Checkout JavaScript SDK automatically invokes the onVisaCheckoutReady function when it finishes loading. The paymentRequest property accepted by V.init requires the following parameters:

ParameterDescription
subtotalThe amount of the transaction, expressed in decimal format
currencyCodeThe currency in which to perform the transaction

By default, American Express, MasterCard, Visa, and Discover card brands are accepted, all shipping and billing countries are also enabled.

For more details about the V.init function and the parameters that it accepts, refer to Visa’s documentation. There are optional paymentRequest properties that support a range of other features, including promotions, discounts, and taxes. There are also optional settings properties that allow you to control the shipping information options.

Completing the payment

When the user clicks the Visa Checkout button on your checkout page, it opens a lightbox where they can select an existing payment method from their account or input a new one. When the user completes the process, the Visa Checkout JavaScript SDK in the browser emits a payment.success event with a unique ID that your application can use to complete the transaction.

The following code shows how to handle the payment.success event and confirm the PaymentIntent you created at the beginning of the checkout flow. See accept a payment to learn how to manage your checkout flow using Payment Intents.

// PaymentIntent client secret passed from server-side. // See: https://stripe.com/docs/payments/accept-a-payment?platform=web // for more information on how to do this. const clientSecret = '{{CLIENT_SECRET}}'; V.on('payment.success', async (payment) => { const intent = await stripe.confirmCardPayment(clientSecret, { payment_method: { card: { visa_checkout: { callid: payment.callid, }, }, }, }); // Perform logic for payment completion here });

Testing Visa Checkout

To test your integration against Visa Checkout’s sandbox, create a new Visa Checkout user account during the checkout process on your website. Configure the account to use the test card number 4242 4242 4242 4242, a random three-digit CVC number, and any expiration date in the future. Complete the checkout process as normal. If everything works correctly, Visa Checkout redirects you back to your application, which creates the charge as expected.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc