New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 745749 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 660926



Sign in to add a comment

Mastercard modifier does not apply

Project Member Reported by rouslan@chromium.org, Jul 18 2017

Issue description

Chrome Version       : 61.0.3153.4
OS Version: Ubuntu 14.04.5 LTS
URL: 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 mastercard payment method.

What is the expected result?
Mastercard discount should apply.

What happens instead of that?
Mastercard discount does not apply.

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 + '\'');
  }
 

Comment 1 by ma...@chromium.org, Jul 18 2017

At least in my testing, in certain cases the card type from Google Payments was UNKNOWN, which caused the modifiers not to apply. 

On another account, the card type was properly set for Google Payments cards, which applied the discount.

Comment 2 by ma...@chromium.org, Jul 18 2017

Cc: jsaul@google.com
+Jared, any idea why this would happen?
In my testing, I added a fake MasterCard "5555 5555 5555 4444" and the discount did not apply on https://rsolomakhin.github.io/pr/, even though it has supportedNetworks: ['mastercard'] modifier.

Comment 4 by ma...@chromium.org, Jul 18 2017

This would be normal because type is UNKNOWN for local cards, right?
Although type is UNKOWN, the network is "mastercard", so that filter should match.
I think we settled on not matching any modifiers for local cards. Did I misunderstand something or did our stance on that change?

Anthony Vallee-dubois
Jul 6, 12:03 PM
One more question: how should we behave with local cards? We don't know their type so should they just not match any modifier?

Anthony Vallee-dubois
Jul 6, 12:03 PM
*Any that specify "supportedTypes"

Rouslan Solomakhin
Jul 6, 12:07 PM
That one option that's acceptable. That would be the simplest implementation. Given that no partners are clamoring for this, I'm OK with this implementation. 
Sorry, that must've been miscommunication on my part. Local cards have "unknown" card type, so their type cannot be used in filtering. However, all cards in PaymentRequest have a type, so we should probably filter on that.

This task is not _super_ urgent. I was going through https://chromestatus.com today in prep for the M-61 branch point and noticed that modifiers are not enabled yet. Tested it out: looks not ready to ship yet. Hence this bug.

Comment 8 by ma...@chromium.org, Jul 20 2017

I still can't parse what we need to do for modifiers here. Few questions:

1) If you have a local card (Mastercard, UNKNOWN type) and the website specifies they accept Mastercard+All-types, BUT have a Mastercard+Debit discount modifier, we still allow the card to be chosen, but do not apply the discount?
2) If using the same card the website has a Mastercard+All-types discount, do we apply the discount?
Yes to both questions.
> Local cards have "unknown" card type, so their type cannot be used in filtering. However, all cards in PaymentRequest have a type, so we should probably filter on that.

Spotted a typo. The last instance of the word "type" should be "issuer network." The second sentence should be:

"All cards in PaymentRequest have an issuer network, so we should filter on that."

Comment 11 by ma...@chromium.org, Jul 24 2017

Cc: zkoch@chromium.org
+zach to weigh in
Status: Fixed (was: Assigned)
This was fixed in https://chromium-review.googlesource.com/c/602610

Sign in to add a comment