@glad hamlet pressed the 🧑💻 Code button in https://discord.com/channels/841573134531821608/842637025524842496 to ask a question:
Code
public function stripeCheckoutSession($customerId, $p_info, $metaData, $baseUrl = '')
{
try {
$successUrl = $baseUrl . '?method=0&token={CHECKOUT_SESSION_ID}';
$cancelUrl = $baseUrl . '?method=0&token={CHECKOUT_SESSION_ID}';
$sessions = $this\-\>stripe\-\>checkout\-\>sessions\-\>create\(\[
'customer' =\> $customerId,
'payment\_method\_types' =\> \['card'\], // Enables GPay and Apple Pay automatically
Question
Hi, I’m currently using Checkout Session with the hosted Stripe payment page.
Right now, all payment methods (GPay, Apple Pay, and card) appear together under one button.
I want to show separate buttons — for example:
When the user clicks “Pay with GPay”, only GPay should show.
When the user clicks “Pay with Apple Pay”, only Apple Pay should show.
When the user clicks “Pay with Card”, only the card option should show.
Is this possible using Checkout Session?
What have you already attempted?
When the user clicks on the Pay button, a Stripe Checkout Session is created, and the user is redirected to a Stripe-hosted page that displays all available payment methods.
What are you working on?
I’m developing a module for a medical project that allows patients to pay online and book their appointments.