TL;DR: If you don’t use canMakePayment() and languageCode, you can stop reading now.
Here are the new features shipped in Chrome 74 (on April 30th):
A new method PaymentRequest.hasEnrolledInstrument() is shipped and behaves the same as the old method PaymentRequest.canMakePayment() -- it checks for instrument presence.
To adapt to the hasEnrolledInstrument() roll out, change your code that looks like this:
// Checking for instrument presence before M74. request.canMakePayment().then(handleInstrumentPresence).catch(handleError); |
Into code that looks like this:
// Checking for instrument presence. // In M74 and after. request.hasEnrolledInstrument().then(handleInstrumentPresence).catch(handleError); } else { // Before M74. request.canMakePayment().then(handleInstrumentPresence).catch(handleError); } |
The new PaymentRequest.canMakePayment() method no longer checks for instrument presence, only for payment app availability.
// Checking for payment app availability without checking for instrument presence. if (request.hasEnrolledInstrument) { // In M74 and after. request.canMakePayment().then(handlePaymentAppAvailable).catch(handleError); } else { // Before M74. console.log(“Cannot check for payment app availability without checking for instrument presence before M74.”); } |
PaymentAddress.languageCode is removed from shipping addresses and billing addresses for basic-card. The billing addresses of other payment methods (such as Google Pay) are not affected.