Add Razorpay as a standard checkout payment method. - #1451
pchawla-godaddy wants to merge 17 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 <[email protected]>
🦋 Changeset detectedLatest commit: 8e34575 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 <[email protected]>
Co-authored-by: Phil Bennett <[email protected]>
…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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Co-authored-by: Cursor <[email protected]> # 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 <[email protected]>
|
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 <[email protected]>
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 <[email protected]>
PayPalCheckoutButton only suppressed the shipping address for local pickup (application_context.shipping_preference and purchase_units[].shipping were keyed off isPickup alone). A digital-only order never collects a shipping address either, but use-build-payment-request.ts still builds a country-code-only shipping stub for it, which PayPal validates as a "provided" address and rejects with POSTAL_CODE_REQUIRED. Extend the existing suppression to digital-only orders via the same isDigitalOnlyOrder helper checkout-form.tsx already uses, instead of adding a parallel check. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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