Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.
This repository was archived by the owner on Aug 27, 2021. It is now read-only.

Clarify the required behaviour for options parameters #26

Closed

Description

@mattsaxon

The specification does not make it clear what the expected behaviour is for fields that are optional in PaymentResponse. I believe the intention at present is that all the fields that a card has will be returned. For example on a card that has an expiry date, this must be returned even though the IDL has the field as optional.

Activity

  1. ianbjacobs commented on Mar 22, 2017

    @ianbjacobs
    Contributor

    @mattsaxon,

    My understanding of the "optional" part of the WebIDL is that "some systems may not support this" in which case the data will not be returned in the response.

    Question to implementers: is all available data always returned? If so, can we set that expectation clearly in the spec as a requirement?

  2. rsolomakhin commented on Mar 22, 2017

    @rsolomakhin
    Collaborator

    Chrome requires the user to provide all data. This sets up a clear expectation that the merchant website will receive all the data that they have requested, thus reducing possibility of unexpected transaction failure. I recommend that we set this expectation clearly in the spec, as @ianbjacobs proposed.

  3. marcoscaceres commented on Mar 28, 2017

    @marcoscaceres
    Member

    I'm not super comfortable with requiring all fields. The merchant still needs to deal with situations where the returned values are bogus - and it's not that different from dealing with null values.

  4. ianbjacobs commented on Mar 28, 2017

    @ianbjacobs
    Contributor

    @marcoscaceres, I'm not sure to understand your comment. Let me clarify my suggestion:

    • The browser returns all the values it has.
    • Some of those values may be bogus and the merchant or their processor will have to deal with them.
    • Some values may be null, either because the user did not provide data or because the payment network does not use that field. In either case, the browser would return the null value that it has.

    Ian

  5. marcoscaceres commented on Mar 29, 2017

    @marcoscaceres
    Member

    @ianbjacobs then how is that different from what is in the spec? What @rsolomakhin seems to be implying is that Chrome's UI enforces validity checks to make sure the credit card details are accurate, complete, and up-to-date (which is great, btw) - but I don't see how we can mandate that in the spec?

  6. ianbjacobs commented on Mar 29, 2017

    @ianbjacobs
    Contributor

    @marcoscaceres and @rsolomakhin,

    (I hope this summary makes sense!)

    BasicCard implementations (whether browsers or third party payment apps) construct a BasicCardResponse. That is used to populate the Details field of the PaymentResponse.

    EDITORIAL SUGGESTION:
    Change:
    "The BasicCardResponse dictionary contains the response from the PaymentRequest API"
    to
    "The BasicCardResponse dictionary is used to populate the Details field of the PaymentResponse in [Payment Request API]."

    @rsolomakhin has let us know that Chrome REQUIRES that the user provide all five fields, and
    that all five fields are used to populate the PaymentResponse Details. Other implementations
    of Basic Card are licensed to behave differently because the WebIDL defines four of the
    response fields as optional.

    Here are a few options we might consider:

    1. Make all the BasicCardResponse fields required. That would likely increase interop somewhat, but might overconstrain implementations. And my recollection (though I don't have the details) is that some card networks do not use one of the fields and therefore, the implementation cannot collect that piece of data for those networks (and the value would be null).

    2. Leave the WebIDL as is, but state that if an implementation of BasicCard has a value for a BasicCardResponse field, it SHOULD return it.

    3. Leave the WebIDL as is, but state that if an implementation of BasicCard has a value for a BasicCardResponse field, it MUST return it.

    Another view of this is to explain what a "null" value means:

    • If the BasicCard implementation must return data, then null might mean only "the card network does not support this field."

    • If the BasicCard implementation is not required to return data for some fields, then null might mean either "the BasicCard implementation chose not to provide a value for this field" or "the card network does not support this field."

    So:

    Ian

  7. rsolomakhin commented on Mar 29, 2017

    @rsolomakhin
    Collaborator

    Chrome validates basic card data before sending it to the merchant website. We perform Luhn check on the credit card number, for example. We also check that the expiration date is not the past. If validation fails, Chrome UI prompts the user to correct the errors. (In some cases, Chrome can also validate the CVC against the issuing bank. This capability may be hard to implement for some user agents.) Therefore, I don't know whether we should make validation into a hard requirement. I would prefer it, certainly, but I will not block on it. Let's operate based on the lowest common denominator for now and try to gradually raise the bar for ourselves.

  8. mattsaxon commented on Mar 29, 2017

    @mattsaxon
    Author

    @iannjacobs , yes I agree with your write up, with one clarifying comment that your use of the phase 'basic card implementation' refers to the physical card, not the user-agent.

    So a concrete example, if a card has an expiry date, it MUST be returned. NOT if the browser holds the expiry date it just be returned.

  9. ianbjacobs commented on Mar 29, 2017

    @ianbjacobs
    Contributor

    @mattsaxon,

    When I say "Basic Card implementation" I specifically mean any payment app that is populating the BasicCardResponse blob. That will either be a browser (acting as a basic card payment app) or a third party payment app.

    I am not sure I agree with your approach because (and I'm putting quotes here intentionally): "it doesn't matter if the card has an expiry date" if the payment app / browser does not collect it from the user. Thus, the existence of the data is not relevant. What matters is that it has been collected.

    Today the spec does NOT require collection of all pieces of data (cf the "optional" parts of the WebIDL). Therefore, if it does come down to the question of "if the payment app / browser has it, they must return it."

    Ian

  10. mattsaxonwp commented on Apr 3, 2017

    @mattsaxonwp

    The problem with the spec as written is that it doesn't require capture of all the fields that are necessary to make a payment in most common use cases.

    Therefore the payment application (or browser) needs to have the knowledge in it to decide what to capture, however this is not captured in the specification at all.

    On the flip side, the payment applications doesn't have all the context to decide what the merchant needs to complete the payment, commonly this is dictated by if the merchant has Address Verfication or CSC checking enabled, so the payment app needs to play it safe in the absence of this information and assume it needs to capture this data, which could be considered a privacy concern. (see issues #5).

    My proposal would be:

    1. Highlight in the spec that different instruments have different data
    2. Make the payment application responsible for understanding that and by default returning all the data that may be needed for a payment
    3. Allow the merchant to specify in the paymentrequest a set of fields that it doesn't want (most usually y billing address and/or CSC)
  11. rsolomakhin commented on Apr 3, 2017

    @rsolomakhin
    Collaborator

    Should this be a flag in BasicCardRequest?

  12. mattsaxon commented on Apr 3, 2017

    @mattsaxon
    Author

    Yes, it could be there (or potentially generalised into PaymentRequest)

  13. rsolomakhin commented on Apr 3, 2017

    @rsolomakhin
    Collaborator

    Android Pay and Alipay are some examples of apps whose data does not include CSC. I don't think it make sense to generalize the "don't include the CSC" flag in PaymentRequest.

  14. mattsaxon commented on Apr 3, 2017

    @mattsaxon
    Author

    Yep, fair point, I was just thinking that do not include other fields, e.g. billing address may be more applicable. Lets put it in BasicCardRequest and see what other PMIs have the need before any possible generalisation.

  15. ianbjacobs commented on Apr 3, 2017

    @ianbjacobs
    Contributor

    We have strayed from the original issue, so I have started a new issue for @mattsaxon with a proposal for discussion:
    #29

    Meanwhile, for this issue, I think we should:

    1. My my proposed editorial tweak:
      Clarify the required behaviour for options parameters #26 (comment)

    2. Adopt this approach: "Leave the WebIDL as is, but state that if an implementation of BasicCard has a value for a BasicCardResponse field, it SHOULD return it."

    Ian

  16. added this to the CR milestone on Apr 19, 2017
  17. self-assigned this
    on Aug 9, 2017
  18. added 2 commits that reference this issue on Aug 9, 2017
    fc848ac
    b1b756b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions