Do not expose Payment metadata in Shop API
See original GitHub issueIs your feature request related to a problem? Please describe.
The Payment
GraphQL type includes the metadata
field in both the Admin and Shop APIs. This metadata field can be used (depending on the specifics on the PaymentMethodHandler) to store potentially sensitive data returned by the payment provider. This should not be accessible publicly over the Shop API, even to the owner of that payment.
Describe the solution you’d like Only include it in the Admin API.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why Not Store in Metadata? : r/stripe - Reddit
The PaymentIntent ID is not sensitive, but there's not much need to expose it to users. You shouldn't store sensitive information in the ......
Read more >The Payment Intents API | Stripe Documentation
Stripe supports adding metadata to the most common requests you make, such as processing payments. Metadata isn't shown to customers or factored into...
Read more >Metadata Types | Metadata API Developer Guide
Metadata API enables you to access some entities and feature settings that you can customize in the user interface. Metadata type names are...
Read more >RESTful web API design - Best Practices - Microsoft Learn
The purpose of REST is to model entities and the operations that an application can perform on those entities. A client should not...
Read more >REST API Developer Guide
Although REST API is great for accessing and querying records, other Salesforce APIs, such as Bulk 2.0 API, Metadata API, and Connect.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For some payment providers exatly those metadata are needed for handling the payment on client-side (e.g. URL to gateway, lang, available methods of payment… that we got from server-provider communication but want to pass along to user).
Describe the solution you’d like change metadata object to hold properties
private
(accessible only over AdminAPI) andpublic
JSONs so resulting object looks likeThen developer can decide where each subset of metadata belongs to and the terminology makes clear statement on accessibility.
@chladog thank you for the clear explanation.
For reference, here are some more examples of similar flows where data from the provider is required in the storefront: