Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need a PaymentAppResponseData dictionary #81

Closed
tommythorsen opened this issue Jan 10, 2017 · 4 comments
Closed

We need a PaymentAppResponseData dictionary #81

tommythorsen opened this issue Jan 10, 2017 · 4 comments
Assignees

Comments

@tommythorsen
Copy link
Member

tommythorsen commented Jan 10, 2017

When the payment mediator invokes a payment app, it does not pass the PaymentRequest instance to the app. Instead it passes a PaymentAppRequestData structure (as defined here).

Likewise, when the payment app passes response data back to the mediator, it should use a PaymentAppResponseData structure instead of creating a PaymentResponse. I have two reasons for this:

  1. Symmetry. The more symmetrical we can make the request and response, the easier it will be for developers to understand and use the API.
  2. Serializability. The data that is passed between the mediator and the payment app needs to be json-serializable. The complete method of the PaymentResponse makes this object not serializable.

I have assigned this issue to myself, and unless I'm hearinging objections to the addition of this structure, I plan to make a PR soon.

@tommythorsen tommythorsen self-assigned this Jan 10, 2017
@tommythorsen
Copy link
Member Author

I propose that PaymentAppResponseData look something like this:

dictionary PaymentAppResponseData {
    DOMString paymentRequestID;
    DOMString methodName;
    object details;
};

@tommythorsen
Copy link
Member Author

I created PR #84 for this. As I was making the change, I couldn't really see any reason for having the paymentRequestID property in this dictionary, so it has been omitted, leaving methodName and details.

There might be a point in having paymentRequestID in the PaymentAppRequestData dictionary, since the payment app might need to know this ID, but since it shouldn't be able to change the ID, there is no point having it in PaymentAppResponseData.

@ianbjacobs
Copy link
Contributor

I'm ok with omitting it.

Ian

@ianbjacobs
Copy link
Contributor

We closed this issue today by adopting PR #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants