Prerequisites
- A connected customer (via
client.getConnection()orclient.connect()). - A UI surface where you can render the widget frame (for example, a modal or full-screen container).
Get a quote
Request a quote for the transaction. The widget requires an executable quote, so pass both awallet and a paymentMethod. A quote that is not
executable will not render in the widget.
Get quote
For the current list of supported
paymentMethod.type values, see the Get a
quote API reference, which
renders the enum from the live OpenAPI spec. The widget collects payment for
the method in the quote: apple_pay renders Apple Pay, including in browsers
the headless Apple Pay flow doesn’t
support. In those browsers, the customer approves the payment by scanning a QR
code with their iPhone.Render the widget
Pass the quote signature tosetupWidget. The widget handles the
entire purchase flow inside the iframe.
Widget
Transaction statuses
- waitingAuthorization: The transaction has been created but the customer needs to complete an authorization step (for example, 3-D Secure).
- Pending: The payment has been accepted and the assets are being transferred.
- Complete: The transaction is finalized and the assets have been delivered.
- Failed: The transaction has failed. No payment was applied.
Compare payment methods
The widget is one of five ways to run a buy. See Choose a payment method to compare it with Apple Pay, Google Pay, card, and the buy button. UsegetPaymentMethods() to
determine which methods are available and choose the flow that fits your
experience.