Add Razorpay as a standard checkout payment method. - #1451
pchawla-godaddy wants to merge 16 commits into
Conversation
Wire the C2 checkout UI to authorize, open Razorpay Standard Checkout, encode the signed callback, and confirm, matching the checkout-api contract. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: aff7119 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
rsharma2-godaddy
left a comment
There was a problem hiding this comment.
we might have ro re-attempt this PR, since some changes were requested
can you also add the button to pay with razorpay with the icon in the video
Read the widget key and order id from the authorize response instead of a client config prop, matching the merged checkout-api contract. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Phil Bennett <114938978+pbennett1-godaddy@users.noreply.github.com>
…maining review gaps. Load state now lives in RazorpayLoaderProvider instead of module globals, failed script loads retry with backoff, and payment-method null handling plus create-session Razorpay fields match the checkout-api contract. Co-authored-by: Cursor <cursoragent@cursor.com>
checkout-api now dynamically resolves PayPal's public SDK-bootstrap values (clientId/merchantId/partnerAttributionId/disableFunding) and persists them on the session as paymentProviderConfiguration.paypal (checkout-api PR godaddy#183, "Hosted Checkout Consumption"). Prefer an explicit paypalConfig prop (existing embedded-checkout integrations) and fall back to that session field otherwise, so the hosted checkout URL flow — where no prop is ever supplied — can initialize PayPal too. - Add paymentProviderConfiguration to both the create-session mutation and get-session query selection sets, and regenerate checkout-env.ts against checkout-api's current schema. - Add partnerAttributionId to PayPalConfig and wire it into the PayPal JS SDK's dataPartnerAttributionId option. - Don't offer PayPal as a payment method when neither source has a usable clientId, mirroring the existing GoDaddy CC/ACH gating pattern in payment-form.tsx's availablePaymentMethods. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wcole1-godaddy
left a comment
There was a problem hiding this comment.
Requesting changes for three payment lifecycle issues: the unconditional two-minute widget cutoff, SDK load recovery after remount, and overlapping payment attempts. Details and suggested fixes are inline.
Validation: CI passes. Isolated source-level probes reproduced the stale-script state and duplicate authorization/widget opens, and verified that the timer closes the widget without a payment attempt. Vitest was not run locally because dependencies are not installed; no live gateway transaction was performed.
…back Fall back to session-provided PayPal config when no prop is supplied
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # packages/react/src/components/checkout/payment/payment-form.tsx
Critic reviewReviewed commit [P2] Preserve confirmation errors across the parent's unmount
After Razorpay reports success, Suggested fix: Store the failure in surviving checkout-level state, or keep the Razorpay component mounted during confirmation. Add coverage for a confirmation rejection while the parent transitions into and out of its processing state. [P2] Invalidate pending widget initialization when the selected method unmounts
The payment-method accordion remains enabled while Razorpay authorization is pending. If the shopper switches methods before authorization resolves, the old component's async continuation still constructs and opens the Razorpay widget after unmount, over the newly selected payment flow. Switching away and back also creates a fresh attempt lock while the original continuation remains active. Suggested fix: Invalidate pending attempts on unmount and check attempt identity after asynchronous boundaries, before opening the SDK. Add coverage for switching methods while authorization is pending. Validation
Existing tests miss these lifecycle transitions: the Razorpay unit tests keep |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed both lifecycle findings in
Validation:
The critic findings were a top-level PR comment rather than resolvable review threads. Could you please re-review the latest commit? |
…iguration.paypal exists Session paymentMethods.paypal can be null while paymentProviderConfiguration.paypal is populated (session created with explicit paymentMethods input, discovery still resolves the provider config). Both the accordion's availablePaymentMethods filter and useGetSelectedPaymentMethod's consumer in payment-form.tsx now fall back to a synthesized standard PayPal method config, gated on paypalConfig?.clientId actually being present, so this stays testing-only and never fires for a real absent config. TEMP FOR TESTING — DO NOT COMMIT to a real release; must be reverted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5c2cbb6 to
db8bb69
Compare
…y.configured
Add razorpay { configured } to the checkout session GraphQL queries/mutations
and hand-edit checkout-env.ts to add the corresponding schema type, mirroring
the existing PayPal provider-config pattern. Expose it via checkoutContext as
razorpayConfig (an object, not a bare boolean, so future fields don't require
a signature change) and require it in payment-form's availablePaymentMethods
gating before ever offering the Razorpay button.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Wire the C2 checkout UI to authorize, open Razorpay Standard Checkout, encode the signed callback, and confirm, matching the checkout-api contract.
https://godaddy-corp.atlassian.net/browse/VNEXT-84816
Summary
Changeset
Test Plan
Screen.Recording.2026-09-14.at.4.33.52.PM.mov