-
Notifications
You must be signed in to change notification settings - Fork 62
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
How do organizations layer additional information in the core messages? #18
Comments
Yes, developers should be able to encapsulate arbitrary information into the core payment messages.
Linked Data should be the extensibility mechanism. Specifically, JSON-LD.
No, the browser (nor most developers) need to understand the extensibility mechanism. However, there does need to be one and JSON-LD provides a mechanism that looks a great deal like JSON w/o having the extensibility issues that JSON has. |
From Payment Request Architecture
This seems to imply either: a) A registry of JSON field names, or Strong +1 for the latter, since there are many other considerations when attempting to create common registries and do decentralized extensibility other than just the names of the fields themselves. Lots of people have put a great deal of thought into b) after failing (to various degrees) at a). |
From Payment Request Architecture:
You can have well-known short strings for payment methods via a JSON-LD Context (another reason to use JSON-LD). For example, this is easy to do: {
"@context": "https://w3c.org/vocabs/payments/v1",
"type": "PaymentInstrument",
"method": "Visa",
"paymentService": "https://psp.example.com/pay"
} which formally means (via a JSON-LD Context): "https://w3c.org/vocabs/payments#method": "https://visa.com/vocabs#Visa"
"https://w3c.org/vocabs/payments#paymentService": "https://psp.example.com/pay" No danger of conflicts, formal meaning for what "Visa" means, and the benefit that the browser nor developers need to care about those details (they use the markup at the top, which looks more or less like JSON, which they're used to). |
+1 to JSON-LD context w/ well-known short strings. Has both the advantage that machines can process it and that developers don't need to care about it if they don't want to. |
I am not convinced of the need for decentralised extensibility of the messages. The message extensions will be defined by the publishers of a payment method specification and the implementors of that payment method will reference that specification. It's possible that the developers of a payment method specification may choose to use JSON-LD for their payment method so that it can be arbitrarily extended by others but that would be a special case for that payment method. I worry that if we say the messages use JSON-LD but also say:
Then we run the risk of developers assuming they can use the full features of JSON-LD or passing the JSON-LD data through a library that de-references keys or similar and outputs valid JSON-LD but the browser or PSP that consumes it is unable to parse it because they are not treating it as JSON-LD. |
Migrated to w3c/payment-request#40 |
If we have a core set of payment messages, are they extensible?
If they are extensible, what is the extensibility mechanism?
Is the browser required to understand this extensibility mechanism?
The text was updated successfully, but these errors were encountered: