Search code examples
javascriptstripe-paymentspayment

Google Pay in Stripe setupIntents payment_method_types


When setting up a Stripe SetupIntend for triggering later payment, I can choose from a bunch of payment methods which are seen here:

https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method_options

So something like this can be done:

$setupIntents = $stripe->setupIntents->create([
    'customer' => $customer_id,
    'description' => 'abcdefgh',
    'payment_method_types' => ['card', 'sepa_debit', 'ideal', 'bancontact'],
    'metadata' => [
        "lastname" => $item->name,
        "email" => $item->email,
        ],
], [
    'idempotency_key' =>  vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)),
]);

Everything works great, but how can Google Pay be integrated here? Isn't Google Pay or Apple Pay possible to be used as a payment method here?


Solution

  • Apple Pay and Google Pay are included in the card payment method type, so you don’t need to explicitly pass Apple Pay and Google Pay here. As long as you met the requirements such as enabling Wallets Payment Methods, https://dashboard.stripe.com/test/settings/payment_methods and have a card on your Google Pay account or add a card to your Wallet for Safari etc., it would show up.