Skip to content

docs(secure-payments): document redirectUrl + redirectLabel#93

Open
rodrigopavezi wants to merge 1 commit into
docs/revamp-verifyfrom
docs/revamp-redirect-url
Open

docs(secure-payments): document redirectUrl + redirectLabel#93
rodrigopavezi wants to merge 1 commit into
docs/revamp-verifyfrom
docs/revamp-redirect-url

Conversation

@rodrigopavezi
Copy link
Copy Markdown
Member

The Request API now accepts an optional redirectUrl (and matching
redirectLabel) on POST /v2/secure-payments and POST /v2/secure-payments/
payouts. After a successful payment, the secure payment app renders a
button on the success screen that takes the payer back to the URL —
explicit user action, not an auto-redirect.

Documented across three pages so the API surface, payer-side UI, and
integration story all line up:

  • api-reference/secure-payments.mdx — added redirectUrl + redirectLabel
    ParamFields on both POST endpoints, with the exact validation rules:
    http(s) only, no HTML/script payload chars; redirectLabel is 1–255
    chars and rejected without a redirectUrl.
  • tools/secure-payments.mdx — Confirm step now mentions the back-to-site
    button, default copy ("Go Back and Close"), and the redirectLabel
    override.
  • use-cases/programmatic-payment-links.mdx — added a "Send the customer
    back to your site after payment" section with a TS snippet and the
    full validation/error-string list, plus a note that the same fields
    apply to /payouts.

The Request API now accepts an optional redirectUrl (and matching
redirectLabel) on POST /v2/secure-payments and POST /v2/secure-payments/
payouts. After a successful payment, the secure payment app renders a
button on the success screen that takes the payer back to the URL —
explicit user action, not an auto-redirect.

Documented across three pages so the API surface, payer-side UI, and
integration story all line up:

- api-reference/secure-payments.mdx — added redirectUrl + redirectLabel
  ParamFields on both POST endpoints, with the exact validation rules:
  http(s) only, no HTML/script payload chars; redirectLabel is 1–255
  chars and rejected without a redirectUrl.
- tools/secure-payments.mdx — Confirm step now mentions the back-to-site
  button, default copy ("Go Back and Close"), and the redirectLabel
  override.
- use-cases/programmatic-payment-links.mdx — added a "Send the customer
  back to your site after payment" section with a TS snippet and the
  full validation/error-string list, plus a note that the same fields
  apply to /payouts.
This was referenced May 8, 2026
Copy link
Copy Markdown
Member Author

rodrigopavezi commented May 8, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR documents the new optional redirectUrl and redirectLabel fields on POST /v2/secure-payments and POST /v2/secure-payments/payouts, which render a back-to-site button on the payment success screen instead of performing an automatic redirect.

  • api-reference/secure-payments.mdx — Added ParamField entries for both fields on both POST endpoints, including validation rules and updated cURL examples.
  • tools/secure-payments.mdx — Expanded the Confirm step to describe the optional button and its default label.
  • use-cases/programmatic-payment-links.mdx — Added a new "Send the customer back to your site after payment" section with a TypeScript snippet and the full validation/error-string list; the snippet currently discards the fetch response, leaving no way to retrieve securePaymentUrl.

Confidence Score: 4/5

Safe to merge after fixing the incomplete TypeScript snippet; the missing response capture means developers copying the new example have no way to retrieve the payment URL.

The new TypeScript snippet in the use-case page discards the fetch response entirely, so a developer following the example cannot obtain securePaymentUrl — the only output that matters. Every other code sample on the same page captures and uses the response. The redirectUrl ParamField description also opens with 'the payer is redirected to,' which directly contradicts the '(no auto-redirect)' clarification in the same sentence.

use-cases/programmatic-payment-links.mdx (incomplete code example) and api-reference/secure-payments.mdx (contradictory redirectUrl description)

Important Files Changed

Filename Overview
api-reference/secure-payments.mdx Added redirectUrl and redirectLabel ParamFields to both POST endpoints with examples; opening description of redirectUrl says "the payer is redirected to" but then clarifies "no auto-redirect" in the same sentence — self-contradictory phrasing.
use-cases/programmatic-payment-links.mdx New "Send the customer back to your site" section added; the TypeScript snippet discards the fetch response, leaving developers with no way to retrieve securePaymentUrl — inconsistent with every other code example on this page.
tools/secure-payments.mdx One-line update to the Confirm step description mentioning the optional back-to-site button; accurate and consistent with the rest of the PR.

Sequence Diagram

sequenceDiagram
    participant M as Merchant Backend
    participant API as Request API
    participant P as Payer (pay.request.network)
    participant S as Merchant Site

    M->>API: "POST /v2/secure-payments {redirectUrl, redirectLabel}"
    API-->>M: "{securePaymentUrl, token}"
    M->>P: Share securePaymentUrl with customer
    P->>P: Connect wallet and confirm payment
    P->>P: Show success screen with button
    P-->>S: Payer clicks button, navigates to redirectUrl
    API-->>M: Webhook: payment.confirmed
Loading

Reviews (1): Last reviewed commit: "docs(secure-payments): document redirect..." | Re-trigger Greptile

Comment thread api-reference/secure-payments.mdx
Comment thread use-cases/programmatic-payment-links.mdx
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