question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not expose Payment metadata in Shop API

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chladogcommented, Sep 23, 2020

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) and public JSONs so resulting object looks like

Payment {
   metadata {
      public { ... }
      private { ... }
   }
}

Then developer can decide where each subset of metadata belongs to and the terminology makes clear statement on accessibility.

0reactions
michaelbromleycommented, Oct 6, 2020

@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:

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found