Checkout with Stripe’s Payment Intents

Since Merx 1.2 there is a new payment method called credit-card-sca and a new Cart method called getStripePaymentIntent() which help you to create a SCA-compliant checkout experience.

Get Payment Intent

Use $cart->getStripePaymentIntent() to get the client_secret and save the Payment Intent ID in a user session.

$paymentIntent = $cart->getStripePaymentIntent();
$clientSecret = $paymentIntent->client_secret;
$kirby->session()->set('paymentIntentId', $paymentIntent->id);

Authorize the Payment Intent

Authorize the Payment Intent by following step 2 to 4 of Stripe’s Payment Intent guide.

Initialize Payment

Use the Payment Intent ID saved in the user’s session and merge it with other user data.

$data = [
  'paymentMethod' => 'credit-card-sca',
  'email' => '',
  'name' => 'Chuck Norris',
$paymentIntentId = $kirby->session()->get('paymentIntentId');
$data = array_merge($data, [
  'stripePaymentIntentId' => $paymentIntentId,
$redirect = merx()->initializePayment($data);