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

Application-specific data in a JWT? #4

Open
msporny opened this issue May 6, 2013 · 3 comments
Open

Application-specific data in a JWT? #4

msporny opened this issue May 6, 2013 · 3 comments
Labels
Milestone

Comments

@msporny
Copy link
Member

msporny commented May 6, 2013

Is it possible for a developer to include application-specific data in a payment JWT? For example, PaySwarm allows a developer to include application-specific data using a Linked Data approach. This means that a 3D printing store, for example, could include the color and dimensions of the final printed object in the product description. How would a developer include such a thing in the .payment() JWT?

@kumar303
Copy link
Member

Yes, it is possible with request.productData in the JWT. This is a 255 char string which might be used by an application such as user_id=123&transaction_id=XYZ. We could perhaps enhance this into something bigger or just make it a freeform JSON object with infinite depth.

@davidlehn
Copy link
Member

Google in-app payment spec has a similar sellerData field which is forced to a string no more than 200 characters. I'm guessing this is a database implementation detail leaking out to their API. It seems like a poor choice to force developers to encode and decode structured data into a string from within JSON. I'd suggest allowing any JSON value in there or maybe require a top level object. I'm unsure how that might effect issues like JWT size restrictions. Maybe that check can move to some other processing stage.

@kumar303
Copy link
Member

the goal of productData for us (and probably Google) was simply to let merchants do reconciliation, not to declare data that others will consume. For example they might do something like productData='my_transaction_id=123' so that they can look up all details in their own db.

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

No branches or pull requests

3 participants