Skip to content

add stripe 3ds support - #1450

Open
pbennett1-godaddy wants to merge 1 commit into
mainfrom
add-stripe-3ds-support
Open

add stripe 3ds support#1450
pbennett1-godaddy wants to merge 1 commit into
mainfrom
add-stripe-3ds-support

Conversation

@pbennett1-godaddy

@pbennett1-godaddy pbennett1-godaddy commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds backward-compatible Stripe 3DS support to the React checkout card flow.

When checkout confirmation returns a valid PAYMENT_ACTION_REQUIRED GraphQL error from checkout-api, the frontend now:

  1. Preserves and validates the GraphQL error extensions.
  2. Keeps checkout locked while customer authentication is in progress.
  3. Calls stripe.handleNextAction with the returned client secret.
  4. Retries checkout confirmation using the resulting Stripe PaymentIntent ID.
  5. Completes tracking and redirects only after final confirmation succeeds.

Stripe next actions are only invoked when the response contains the complete expected contract:

  • code = PAYMENT_ACTION_REQUIRED
  • paymentResult.status = ACTION_REQUIRED
  • paymentResult.provider = STRIPE
  • nextStep.type = SDK_ACTION
  • nextStep.sdk = STRIPE_JS
  • nextStep.action = HANDLE_NEXT_ACTION
  • a non-empty nextStep.clientSecret

Existing payment success and error behavior remains unchanged for older checkout-api responses, non-Stripe providers, and malformed action-required responses. Stripe failures and repeated
action-required responses fail safely and unlock checkout without entering a retry loop.

The Stripe card button also uses the local payment-processing state to prevent duplicate submissions during tokenization and 3DS authentication.

Changeset

  • Changeset added (docs)

Added a patch changeset for @godaddy/react.

Test Plan

  • Added coverage verifying GraphQL error extensions, including nested paymentResult.nextStep, are preserved.
  • Added Stripe checkout integration coverage for:
    • valid 3DS response handling
    • calling stripe.handleNextAction with the client secret
    • retrying confirmation with the returned pi_* PaymentIntent ID
    • retaining existing behavior for legacy GraphQL errors
    • rejecting malformed action-required responses
    • unlocking checkout when Stripe authentication fails
  • Ran React package typecheck successfully:

pnpm --dir packages/react typecheck

  • Ran the React test suite successfully:

pnpm --dir packages/react test

Result: 58 test files passed, 578 tests passed.

  • Verified no whitespace errors with:

git diff --check

@pbennett1-godaddy
pbennett1-godaddy requested a review from a team as a code owner September 8, 2026 19:22
@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24015a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@godaddy/react Patch
nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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