Mastercard modifier is selected for all cards and apps |
|||
Issue descriptionChrome Version : Canary OS Version: Android 7.1.2 Nougat URLs (if applicable) : https://rsolomakhin.github.io/pr/ What steps will reproduce the problem? 1. Enable chrome://flags/#enable-experimental-web-platform-features 2. Open https://rsolomakhin.github.io/pr/. 3. Click "Buy". 4. If not already selected, select a non-mastercard payment method. What is the expected result? Mastercard discount should not be applied. What happens instead of that? Mastercard discount is applied. JS code: 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', }, }], }], }; try { PaymentRequest(supportedInstruments, details).show(); } catch (e) { error('Developer mistake: \'' + e + '\''); }
,
Jul 18 2017
,
Jul 18 2017
This might because we only checked payment method when applying modifier but not network name if the payment method is 'basic-card'
,
Jul 18 2017
We should check both network name and card type for basic-card.
,
Jul 18 2017
,
Jul 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/40f1cec4298466b9efc25ff0f58e5ef447b42185 commit 40f1cec4298466b9efc25ff0f58e5ef447b42185 Author: gogerald <gogerald@google.com> Date: Sat Jul 22 03:31:07 2017 [Payments] Check supported card type and issuer network for modifiers Bug: 745745 Change-Id: Ia503f80cf5b8844b8293959092b6def584fc21bb Reviewed-on: https://chromium-review.googlesource.com/579570 Commit-Queue: Ganggui Tang <gogerald@chromium.org> Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Cr-Commit-Position: refs/heads/master@{#488849} [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndBasicCardWithModifiersTest.java [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestRule.java [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/chrome/browser/ui/views/payments/modifiers_browsertest.cc [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/components/payments/core/BUILD.gn [delete] https://crrev.com/2e59602847f8073dc1f2a58d15697c470a710327/components/test/data/payments/bobpay_and_basic_card_with_basic_card_modifiers.js [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/components/test/data/payments/bobpay_and_basic_card_with_modifiers.js [delete] https://crrev.com/2e59602847f8073dc1f2a58d15697c470a710327/components/test/data/payments/payment_request_bobpay_and_basic_card_with_basic_card_modifiers_test.html [modify] https://crrev.com/40f1cec4298466b9efc25ff0f58e5ef447b42185/components/test/data/payments/payment_request_bobpay_and_basic_card_with_modifiers_test.html
,
Jul 24 2017
Fixed?
,
Jul 24 2017
yes, |
|||
►
Sign in to add a comment |
|||
Comment 1 by rouslan@chromium.org
, Jul 18 2017