Requirements
Before you begin, take into account the following requirements, limitations, and preparations.How it works
- On your checkout page, collect the shopper’s payment details, and show a custom button that redirects shoppers to an additional order review page.
- When the shopper selects the button, store the payment data on your server, and redirect them to a page where they can review their payment and order details.
- On the review page, show the information that you want to include, and a Pay button.
- When the shopper selects Pay, make a /payments request using the payment data you stored.
Modify your checkout page
A two-step checkout flow starts with the same steps as the standard checkout flow. You make a /paymentMethods request to get the available payment methods, and present the payment methods and the checkout form with our Web Drop-in or Components. After the shopper selects a payment method, modify your checkout page to implement a two-step checkout flow.-
In your Drop-in or Components
configurationobject, setshowPayButtonto false to hide the default Pay button. Hide the default pay buttonThis hides the default Pay button that otherwise triggers theonSubmitevent when payment details are valid, and makes a payment request. When configuring Drop-in/Components for cards, you can configure optional events that let you show additional information on the review page later. -
On the page where the shopper enters their payment details, show your custom button. Implement your button with a function to:
- Validate the shopper input in the payment form.
-
Store the payment data on your server to use it in your /payments request later.
-
For Drop-in, store the
dropin.activePaymentMethod.data. -
For Components, store the
datafrom the payment method component. For example, storecard.datafor the card component. The payment data expires after an hour. If you submit a payment request with it after it expires, the request fails. After the payment data expires, the shopper must repeat the checkout process from the beginning.
-
For Drop-in, store the
- Redirect the shopper to your review page.
handleGoToReviewfor Drop-in. Implement the custom function for Drop-in -
In your Drop-in or Components
configurationobject, call your custom function from theonEnterKeyPressedcallback. Call your custom function
Implement a review page
-
On the review page, create a new instance of checkout.
-
Only if you use Web Drop-in v6 or later, and import Drop-in with individual payment methods, you need to register the payment methods used in the Drop-in.
Register the payment methods for Drop-in
-
Only if you use Web Drop-in v6 or later, and import Drop-in with individual payment methods, you need to register the payment methods used in the Drop-in.
Register the payment methods for Drop-in
- When the shopper selects the Pay button on your review page, make a /payments request. Use the payment data you stored.
-
Handle the /payments response. Implement logic to handle the response with and without the
actionobject.Handle the /payments response