craftcms / commerce-stripe

Stripe payment gateway for Craft Commerce
https://plugins.craftcms.com/commerce-stripe
MIT License
31 stars 48 forks source link

Apple Pay with Stripe plugin not supported? #222

Closed philipboomy closed 1 year ago

philipboomy commented 1 year ago

Description

I am trying to get Apple Pay working but when I pass in the token I get from Stripe to commerce/payments/pay I am getting this error:

A token may not be passed in as a PaymentMethod. Instead, use payment_method_data with type=card and card[token]=tok_xxxxxxxxxLIVKdQECvF.

I am wondering if the Commerce Stripe plugin is supporting Apple Pay?

A quick search shows this: https://stackoverflow.com/questions/72043013/a-token-may-not-be-passed-in-as-a-paymentmethod-instead-use-payment-method-da

Additional info

pdaleramirez commented 1 year ago

@philipboomy Commerce stripe plugin only supports credit card payments for now. We have plan to add more payment integration but can't give a specific timeline.

philipboomy commented 1 year ago

As mentioned in my email as well then I am not happy about this.

Every competitor to Craft Commerce has supported Apple Pay for years. Woocommerce SnipCart Foxy Cart Shopify and so on.

I believe this is something the Stripe plugin should support since Stripe provides this payment type. With the amount of mobile shoppers it is not good that Craft Commerce does not support this instead of for example doing a Shopify integration.

andykearney commented 1 year ago

+1

ryssbowh commented 1 year ago

This is a problem for us too. I managed to integrate Google pay with some custom code but that last bit I can't get over. The key payment_method is hardcoded there https://github.com/craftcms/commerce-stripe/blob/develop/src/gateways/PaymentIntents.php#L498 and we can't change it. Until google pay is supported can you add an event to modify the requestData before it's sent to Stripe ?

ryssbowh commented 1 year ago

For others that may need this, I managed to get this working by cloning the plugin and replacing this line 498 by :

if (substr($paymentMethodId, 0, 4) == 'tok_') {
    $requestData['payment_method_data'] = [
        'type' => 'card',
        'card' => [
            'token' => $paymentMethodId
        ]
    ];
} else {
    $requestData['payment_method'] = $paymentMethodId;
}
philipboomy commented 1 year ago

For others that may need this, I managed to get this working by cloning the plugin and replacing this line 498 by :

if (substr($paymentMethodId, 0, 4) == 'tok_') {
    $requestData['payment_method_data'] = [
        'type' => 'card',
        'card' => [
            'token' => $paymentMethodId
        ]
    ];
} else {
    $requestData['payment_method'] = $paymentMethodId;
}

Thanks for sharing this. I am still waiting for core team to sort this out. They have promised it several times and over many months so I am sure it will come soon.

moldedjelly commented 1 year ago

We've been wanting this too. It would be great if the plugin was upgraded to support the newer Payment Element approach

pxel commented 1 year ago

+1 eager to have this also.

sparkalow commented 1 year ago

+1
We had to go with WP for apply pay due to timing and I hated every minute of it.

lukeholder commented 1 year ago

Good news! See our announcement:

https://craftcms.com/blog/commerce-4-3-stripe-4

pxel commented 1 year ago

👏 Awesome news