Local mastercard is not triggering modifiers |
|||||||
Issue descriptionChrome Version : 62.0.3172.0 (canary) OS Version: Android 7.1.2; Nexus 6P Build/N2G47G URLs (if applicable) : https://rsolomakhin.github.io/pr/ What steps will reproduce the problem? 1. Enable chrome://flags/#enable-experimental-web-platform-features and chrome://flags/#web-payments-modifiers. 2. Add MasterCard to Autofill settings: 5555 5555 5555 4444 3. Open https://rsolomakhin.github.io/pr/. 4. Click "Buy" on page. 5. Select the "Mastercard****4444" card, if not already selected. What is the expected result? Payment should be discounted to USD $50.00 from original USD $55.00. The MasterCard discount should be one of the line items. What happens instead of that? Payment is still USD $55.00. The MasterCard discount is not being applied. Please provide any additional information below. Attach a screenshot if possible. UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.13 Safari/537.36 Code used by the page: /** * Initializes the payment request object. * @return {PaymentRequest} The payment request object. */ function buildPaymentRequest() { if (!window.PaymentRequest) { return null; } const supportedInstruments = [{ supportedMethods: ['https://android.com/pay'], data: { merchantName: 'Rouslan Solomakhin', merchantId: '00184145120947117657', allowedCardNetworks: ['AMEX', 'MASTERCARD', 'VISA', 'DISCOVER'], paymentMethodTokenizationParameters: { tokenizationType: 'GATEWAY_TOKEN', parameters: { 'gateway': 'stripe', 'stripe:publishableKey': 'pk_live_lNk21zqKM2BENZENh3rzCUgo', 'stripe:version': '2016-07-06', }, }, }, }, { supportedMethods: ['basic-card'], }]; const details = { total: { label: 'Donation', amount: { currency: 'USD', value: '55.00', }, }, displayItems: [{ label: 'Original donation amount', amount: { currency: 'USD', value: '65.00', }, }, { label: 'Friends and family discount', amount: { currency: 'USD', value: '-10.00', }, }], modifiers: [{ supportedMethods: ['basic-card'], data: { supportedTypes: ['debit'], }, total: { label: 'Debit card discounted donation', amount: { currency: 'USD', value: '45.00', }, }, additionalDisplayItems: [{ label: 'Debit card discount', amount: { currency: 'USD', value: '-10.00', }, }], }, { supportedMethods: ['basic-card'], data: { supportedNetworks: ['mastercard'], }, total: { label: 'MasterCard discounted donation', amount: { currency: 'USD', value: '50.00', }, }, additionalDisplayItems: [{ label: 'MasterCard discount', amount: { currency: 'USD', value: '-5.00', }, }], }], }; let request = null; try { request = new PaymentRequest(supportedInstruments, details); if (request.canMakePayment) { request.canMakePayment().then(function(result) { info(result ? 'Can make payment' : 'Cannot make payment'); }).catch(function(err) { error(err); }); } } catch (e) { error('Developer mistake: \'' + e + '\''); } return request; } let request = buildPaymentRequest(); /** * Launches payment request that does not require shipping. */ function onBuyClicked() { // eslint-disable-line no-unused-vars if (!window.PaymentRequest || !request) { error('PaymentRequest API is not supported.'); return; } try { request.show() .then(function(instrumentResponse) { window.setTimeout(function() { instrumentResponse.complete('success') .then(function() { done('This is a demo website. No payment will be processed.', instrumentResponse); }) .catch(function(err) { error(err); request = buildPaymentRequest(); }); }, 2000); }) .catch(function(err) { error(err); request = buildPaymentRequest(); }); } catch (e) { error('Developer mistake: \'' + e + '\''); request = buildPaymentRequest(); } }
,
Aug 1 2017
Anthony: Same issue happens on desktop with local cards. (Server cards are fine.)
,
Aug 1 2017
,
Aug 1 2017
,
Aug 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/854935d9f04be5c429e4c1bdabe541f08f00d985 commit 854935d9f04be5c429e4c1bdabe541f08f00d985 Author: gogerald <gogerald@google.com> Date: Wed Aug 02 14:40:14 2017 [Payments] Do not check supported card type for modifier if unspecified Bug: 751226 Change-Id: I84b42c04c16d3b5662ed6a5bf5d491b031b3c84a Reviewed-on: https://chromium-review.googlesource.com/597014 Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Ganggui Tang <gogerald@chromium.org> Cr-Commit-Position: refs/heads/master@{#491369} [modify] https://crrev.com/854935d9f04be5c429e4c1bdabe541f08f00d985/chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentApp.java [modify] https://crrev.com/854935d9f04be5c429e4c1bdabe541f08f00d985/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java [modify] https://crrev.com/854935d9f04be5c429e4c1bdabe541f08f00d985/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndBasicCardWithModifiersTest.java [modify] https://crrev.com/854935d9f04be5c429e4c1bdabe541f08f00d985/components/test/data/payments/bobpay_and_basic_card_with_modifiers.js [modify] https://crrev.com/854935d9f04be5c429e4c1bdabe541f08f00d985/components/test/data/payments/payment_request_bobpay_and_basic_card_with_modifiers_test.html
,
Aug 2 2017
Fixed this on Android, pass it to anthonyvd@ for desktop,
,
Aug 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6fae0475a09388e17c07ba6fed383bb1e0eead2a commit 6fae0475a09388e17c07ba6fed383bb1e0eead2a Author: Anthony Vallee-Dubois <anthonyvd@chromium.org> Date: Mon Aug 07 16:51:35 2017 [Web Payments] Match modifiers with local cards if no type specified Bug: 751226 Change-Id: If1598d21747ab14fdf7a54055c8f2c66be5426ef Reviewed-on: https://chromium-review.googlesource.com/602610 Reviewed-by: mahmadi <mahmadi@chromium.org> Reviewed-by: Mathieu Perreault <mathp@chromium.org> Commit-Queue: Anthony Vallee-Dubois <anthonyvd@chromium.org> Cr-Commit-Position: refs/heads/master@{#492340} [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/chrome/browser/ui/views/payments/modifiers_browsertest.cc [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/components/payments/content/payment_request_spec.cc [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/components/payments/core/autofill_payment_instrument.cc [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/components/payments/core/autofill_payment_instrument.h [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/components/payments/core/payment_instrument.h [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/ios/chrome/browser/payments/ios_payment_instrument.h [modify] https://crrev.com/6fae0475a09388e17c07ba6fed383bb1e0eead2a/ios/chrome/browser/payments/ios_payment_instrument.mm
,
Aug 7 2017
,
Aug 14 2017
Anthony, I cannot seem to get the mastercard modifier working on https://rsolomakhin.github.io/pr/ using two local cards: a 4242 4242 4242 4242 visa and a 5555 5555 5555 4445 mastercard. Can you verify that it's working?
,
Aug 14 2017
Did you enable the flags? chrome://flags#web-payments-modifiers and chrome://flags#experimental-web-platform-features
,
Aug 14 2017
Doh! That was it, thank you. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by gogerald@chromium.org
, Aug 1 2017