Skip to content

docs: describe idempotent POST charge external IDs#36

Open
EfeDurmaz16 wants to merge 2 commits into
tempoxyz:mainfrom
EfeDurmaz16:docs/idempotent-post-external-id
Open

docs: describe idempotent POST charge external IDs#36
EfeDurmaz16 wants to merge 2 commits into
tempoxyz:mainfrom
EfeDurmaz16:docs/idempotent-post-external-id

Conversation

@EfeDurmaz16
Copy link
Copy Markdown

Summary

Documents how to use ChargeParams.ExternalID for idempotent paid POST routes and agent tool calls.

The Go SDK already includes ExternalID in the charge request and echoes it back in the Payment-Receipt. This README section shows how to pass an existing Idempotency-Key header through as the stable operation ID so retries can be distinguished from different paid operations.

Changes

  • Add an Idempotent POST Charges section to the README
  • Show Idempotency-Key mapped into ChargeParams.ExternalID
  • Clarify that retries should reuse the same value and different operations should not share one value

Verification

  • git diff --check
  • go test ./...

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 780d3a3c54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated
Comment on lines +138 to +140
stable `ExternalID`. The value is included in the MPP charge request and echoed
back in the `Payment-Receipt`, so servers can distinguish a safe retry from a
different paid operation.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clarify that ExternalID does not enforce idempotency

For paid POST retries, ExternalID is only serialized into the challenge/receipt; server.Mpp.Charge does not persist or reject previously seen IDs, so a retry after the paid operation succeeds but the response is lost can still run the POST side effect again unless the application keeps its own idempotency record keyed by Idempotency-Key. This wording makes the new section sound like passing the header through is enough to make retries safe, so it should explicitly mention the required app-side idempotency/cache check before performing the operation.

Useful? React with 👍 / 👎.

@EfeDurmaz16
Copy link
Copy Markdown
Author

Addressed the ExternalID/idempotency clarification in commit d7dce81. The README now states that ExternalID is receipt metadata only and that applications still need their own idempotency record/cache before running paid side effects. Verified with git diff --check and go test ./....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant