Payment Confirmation
Review screen before submitting a payment. Shows invoice details, selected payment method, and payment amount.
Usage
const confirmation = client.components.paymentConfirmation({
containerId: 'confirmation',
invoiceId: 'inv_xxx',
paymentMethodId: 'pm_xxx',
customerId: 'cus_xxx',
onPaymentSuccess: (payment) => {
console.log('Payment successful:', payment.id);
},
onPaymentError: (error) => {
console.error('Payment failed:', error);
},
onBack: () => {
console.log('Back clicked');
},
});Configuration
PaymentConfirmationConfig
containerId
string
Yes
ID of the container element
invoiceId
string
Yes
Invoice being paid
paymentMethodId
string
Yes
Selected payment method
customerId
string
Yes
Customer making the payment
theme
ThemeConfig
No
Custom theme configuration
onConfirm
() => void
No
Called when payment is initiated
onBack
() => void
No
Called when "Back" is clicked
onPaymentSuccess
(payment: Payment) => void
No
Called when payment succeeds
onPaymentError
(error: Error) => void
No
Called when payment fails
onError
(error: Error) => void
No
Called on other errors
Payment Object
The onPaymentSuccess callback receives a Payment object:
Example
Display
The confirmation screen shows:
Invoice summary (number, amount, due date)
Selected payment method details
Total amount to be charged
"Pay Now" button to submit payment
"Back" button to return to previous screen
Last updated
Was this helpful?
