Payment acceptance phase of the order lifecycle for credit cards
Order Creation or Update
API Response
payment.preparation
object that your
application uses to render the Stripe payment element.Render Stripe Payment Element
stripePublishableKey
and stripeClientSecret
returned in the API response to render the credit card
checkout form.User Completes Payment
Poll for Status
quote
phase of the order the payment status will be requires-quote
.awaiting-payment
, which indicates that the order is ready to be paid.
See below the full list of possible statuses:
Payment Status | Explanation |
---|---|
requires-quote | still in the quote phase |
awaiting-payment | ready to submit payment |
completed | order is in the delivery or order completion phase |
completed with payment.refunded | payment was completed but has been refunded |
order.payment.preparation
object, which contains two important properties to render the payment element. These properties are named: stripePublishableKey
and stripeClientSecret
. You can use these with the Stripe Payment Element package to collect the user’s credit card payment.
Example response
key
property on the Elements
component is important to re-render the payment element if either the
stripeClientSecret
or stripePublishableKey
change, as these fields can't be 'live' updated@stripe/react-stripe-js
to be:
SubmitButton
component with the following code:
order.payment.preparation
in order to see the live Payment Element).
GET
https://staging.crossmint.com/api/2022-06-09/orders/<orderId>
payment.status
is completed
but the order also contains a payment.refunded
property. This indicates that the payment was initially successful but has since been refunded.
payment.refunded
object includes the following fields:
amount
: The amount that was refundedcurrency
: The currency of the refundtxId
: The on-chain transaction ID the refund was sent inchain
: The blockchain where the refund transaction occurredtxId
) so users can verify the refund on-chain