Payment Request Button

Created on 30 May 2019, over 5 years ago
Updated 21 September 2023, about 1 year ago

This would be a great freature und would be a huge improvement for the users in the checkout process. We would be able to get the users credit card information with nearly one click. I think the most of the shop users have already a google pay or apple pay wallet registered, at least on their smartphones.

Try it out (e.g. on your smartphone)

https://stripe.com/docs/stripe-js/elements/payment-request-button

What do you think? Could that be integrated into this module?

Feature request
Status

Needs work

Version

1.0

Component

Payment Element

Created by

🇨🇭Switzerland handkerchief

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇦Ukraine leevan Lutsk

    Hi! Here is the patch that integrates Google/Apple Pay (Stripe Payment Request Button) into this module. Tested with anonymous customers and with or without the Commerce Shipping module. In case of Commerce Shipping is enabled, the shipping profile is taken from the Shipping Information form, and the billing profile is taken from Google/Apple Pay response. When the shipping method is changed on the order_information page, payment information is refreshed via Ajax, to set the updated order total amount for the Google/Apple Pay payment request. In the Payment information form, there is a "Pay with Google/Apple Pay" checkbox. If the shipping form is not filled out, or the shipping method is not selected it will ask to do it, before showing Google/Apple Pay button. If the customer is not able to pay with a digital wallet, a "not available" message will be shown.
    It is implemented without a "Review" checkout page, as it does not make sense, and Google/Apple pay popups are like Review types of panes. After payment is processed, it will redirect to the Complete checkout page.
    Here is some instruction on how to configure this patch:
    1. Apply the patch.
    2. Clear Drupal cache.
    3. Go to edit Stripe payment gateway configurations page.
    4. Enable "Enable the possibility to pay with Google/Apple pay" checkbox.
    5. Fill "Stripe Account ID" input and save the updated Stripe payment gateway settings.

  • 🇬🇧United Kingdom johnhannawin

    We've tested the patch from #8 and it works as described: PHP 8.1.14, MariaDB 10.3.38

    Thank you!

  • 🇺🇦Ukraine leevan Lutsk

    A little change for a checkbox title in the #8 patch.

  • 🇬🇧United Kingdom johnhannawin

    Tested patch from #10 on 9.5.7 with PHP 8.1.14 and PostgreSQL 10.22

  • Status changed to Needs review over 1 year ago
  • The last submitted patch, 8: stripe-google-apple-pay-integration-3058094-8.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • The last submitted patch, 10: stripe-google-apple-pay-integration-3058094-10.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Status changed to Needs work over 1 year ago
  • 🇺🇦Ukraine leevan Lutsk

    Code improvements and phpcs fixes.

  • 🇪🇬Egypt Ahmed Eldesoky

    #15 causes JS issues with Drupal 10 , because jquery.once is removed
    this is Drupal 10 JS compatible version of #15

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    20 pass, 2 fail
  • 🇪🇬Egypt Ahmed Eldesoky

    The previous patch had some missing files, fixed in this version

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    20 pass, 2 fail
  • 🇬🇧United Kingdom GillMead

    We have now discovered an issue with patch stripe-google-apple-pay-integration-3058094-15.patch. When used on a site that does not use the commerce_shipping module (e.g. for services/digital products rather than physical goods), enabling the payment request button forces the removal of the billing information form. This prevents users from paying by credit/debit card. This is in commerce_stripe.module.
    " // Hide billing information form if enable_payment_request_button enabled
    // because billing profile is getting from Google/Apple Pay response."

    Ideally the billing information form would only be removed when the customer ticks the box on the front-end site to indicate they want to pay by ApplePay etc, and then restored if it is unticked again.

  • 🇺🇦Ukraine abramm Lutsk

    The patch here has a few issues.

    1) The 'stripe' payment gateway ID is hardcoded.
    2) The billing profile is completely hidden from the checkout form even if a different payment method is used; thus installing the patch and adding a payment request button
    3) Checkout flow steps IDs are hardcoded; also the URL are made by concatenating the checkout page URL and payment step ID instead of providing the step as route parameter, e.g.:

    Url::fromRoute('commerce_checkout.form', ['commerce_order' => $order->id()])
      ->toString() . '/payment',
    

    4) I don't think the StripePaymentRequestButtonController is necessary. Current code does the following:
    - Collects payment intent data from Stripe JS.
    - Sends data to StripePaymentRequestButtonController via custom fetch request to store the Stripe data in the order.
    - Confirms payment via JS API (conditionally this may display 3DS confirmation but I'm not sure if this would work with current code).
    - Redirects user to the Payment checkout step (which is hardcoded).

    Instead, I think it should do the following:
    - Collect payment indent data from Stripe JS and store it to the hidden field.
    - Redirect to the payment step (by triggering click on the submit button the way the original module code does).
    - Process payment on backend, use existing stripe_review checkout pane to ensure 3DS is handled.

    A part of existing code should be reused but in fact the payment request button has its own code path. It looks like the patch was made for a specific use case and is not applicable for all cases.

    As for the billing profile handling, the billing info pane shouldn't be hidden/unset/etc as payment method definition already has requires_billing_information = FALSE and it may be simply disabled in configuration if the site owner prefers handling it on Stripe side.

  • 🇺🇦Ukraine marchuk.vitaliy Rivne, UA

    Hello guys,
    We have just finished integrating the Payment Element and all our work is in the 8.x-1.x branch (it has integration with Apple Pay/Google Pay/PayPal for smartphones).
    Regarding the Payment Request button, have you seen this comparison? Do you think this is still relevant? It makes more sense to implement the Express Checkout Element.

  • 🇺🇦Ukraine abramm Lutsk

    Hi @vmarchuk, thanks for pointing on this!

    I've tested the Payment Element in 1.x and while it's slightly different from the Payment Request button (which someone may still want to have), it clearly works with Google Pay and Apple Pay so I'm happy to switch.

Production build 0.71.5 2024