Repository navigation
Add merchant metadata to payment intents - #925
Open
bumblebee-2020 wants to merge 1 commit into
Open
bumblebee-2020 wants to merge 1 commit into
bumblebee-2020 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add merchant metadata to payment intents
What was solved
#890 — Payment intents can't carry merchant metadata (order ID, customer reference, description)
Add optional merchant metadata to payment intents: accept a validated flat string→string
metadataobject onPOST /v1/payments, persist it in a new additivemetadata TEXT(JSON) column onpayments, return it from the authenticatedGET /v1/payments/{id}and list endpoints, and include it in every webhook payload (covered by HMAC). The public unauthenticated projection must never expose it. Limit violations return400 invalid_metadatanaming the offending key. Document the no-secrets/no-card-data rule inopenapi.yamland README.Addressed:
metadatafield toCreatePaymentRequest(flat JSON object, string keys to string values).400 invalid_metadatanaming the offending key on violation.metadata TEXT(JSON) column onpayments.Changes
README.md(modify)Approach
metadatatoCreatePaymentRequestinsrc/api/payments.rswith validation (≤20 keys, key ≤40, value ≤500, serialized total ≤4 KiB) returning400 invalid_metadatanaming the offending key.metadata TEXT(JSON) column onpayments, and persist/parse metadata on create.GET /v1/payments/{id}and list endpoints, while keeping the public unauthenticated projection free of metadata.src/webhook.rsso it is covered by the HMAC signature.openapi.yamlandREADME.md.Issues
Closes #890