Automattic/woocommerce-payments

Spike: Apple/Google Pay as an individual payment gateway

Opened this issue · 0 comments

Description

We would like to implement Apple/Google Pay in their own payment gateway, rather than an EPM button. Stripe has somewhat opened the door for this integration by allowing us to support wallet payment options within the payment element. This spike is to explore the feasibility of this integration and to potentially plot a path towards implementing it.

We managed to create a PoC in pbIwZe-2tA-p2#comment-1195, but Apple/Google Pay was still presented in an accordion alongside the card payment method.

Acceptance criteria

Here is what we would like in an optimal implementation.

  • Wallet options available in their own payment gateway, without card payment method.
  • When no wallet options are supported by shopper's browser, payment gateway will not appear.
  • Order will be updated using billing and shipping options selected in wallet modal checkout.
  • All checkout fields--including custom fields--validated prior to initiating wallet modal checkout.

This spike is essentially to explore and confirm whether all these goals are achievable. If any are not achievable, but workarounds may be available, these should be explored. Satisfactory outcomes of this spike would be either a P2 post or a detailed comment on this issue, if the findings won't fill up enough space to merit a P2.

Dev notes

Stripe wallet documentation indicating card must be presented as a payment_method_type value in order to support wallet options.

By default, the Payment Element will display all the payment methods that the underlying Payment Intent was created with.

However, wallets like Apple Pay and Google Pay are not payment methods per the Payment Intent API. They will show when the Payment Intent has the card payment method and the customer is using a supported platform and have an active card in their account.

Additional context

Relevant thread: pbIwZe-2tA-p2#comment-1178