W3C Payment API changes in Chrome 80

31 views
Skip to first unread message

Eiji Kitamura

unread,
Dec 11, 2019, 12:52:02 AM12/11/19
to payment...@chromium.org

The following changes are coming to Chrome 80.


Canary: today  | Beta: 19th Dec, 2019  | Stable: 4th Feb, 2020


Changes enabled by default:

  • Shipping address and contact info collection can now be delegated to a payment handler.


Documentation and other updates:

  • Android payment app's sample code is now public.

  • Payment app handling code is being unified across platforms to increase team velocity and code health.

Shipping address and contact info collection can now be delegated to a payment handler.

Starting M80, payment handlers will be able to provide the response when the merchant’s website requests shipping address and/or payer’s contact information via PaymentOptions. This is part of our larger effort to reduce checkout friction.


Without this change, the browser is responsible for providing address and contact information. This means that checkouts with shipping and/or contact info will always involve at least two steps: a user must first confirm the browser-supplied information on Chrome’s payment sheet before they can complete the payment flow in the payment handler window. The new delegation allows the user to skip directly to the payment handler’s window if there is only a single available payment app for a given request and it has declared delegations support.


To declare delegations support, payment handlers can use the following code during installation. For further information and detailed examples please check out the explainer, spec changes, and demo payment handlers for simple delegation, shipping address change, and shipping option change.

registration.paymentManager.enableDelegations(

    [‘shippingAddress’, ‘payerName’, ‘payerEmail’, ‘payerPhone’])

  .then(()=> {

    console.log(‘Enabled delegations’);

  });


Android payment app's sample code is now public.

At TPAC, we got the feedback that many native payment apps are interested in integrating with the web via Payment Request API but don’t know how to get started. Chrome has supported native Android payment apps since M60. This month, we  published a sample Android payment app that can be used as a reference implementation for integrating with Chrome at https://github.com/GoogleChromeLabs/android-web-payment. Additional developer documentation is available at https://developers.google.com/web/fundamentals/payments/payment-apps-developer-guide/android-payment-apps


Improving code health of Chrome’s PaymentAppFactory

Desktop Chrome and Android Chrome historically used separate code paths for talking to payment apps. This has been a source of occasional cross-platform bugs and slowed down our development of new payment app features. We have started work to unify desktop and Android code paths into a single cross-platform PaymentAppFactory component with unified testing (design doc). This will reduce the likelihood of new bugs, allow us to move faster in enabling new payment app features, and also make it easier for Chromium-based browsers to reuse the payment app implementation on all Chromium platforms.




Reply all
Reply to author
Forward
0 new messages