// Stripe PaymentIntent, using the same amount/currency Attesso authorized.
const paymentIntent = await stripe.paymentIntents.create(
{
amount: 42000, // minor units, matches proposed_action.payment
currency: 'eur',
payment_method: 'pm_...', // the payment method you are charging
confirm: true,
// Server-side execution, no browser to return to: no redirect-based methods.
automatic_payment_methods: { enabled: true, allow_redirects: 'never' },
metadata: {
external_action_reference: 'booking-2026-08-04-001',
attesso_authorization_id: 'aut_01J2...',
},
},
{ idempotencyKey: 'booking-2026-08-04-001' }, // request option, = your external_action_reference
);
// paymentIntent.id is your provider_transaction_reference