feat(checkout): add CCAvenue payment provider and cookie-session retu…#1291
feat(checkout): add CCAvenue payment provider and cookie-session retu…#1291asaini-godaddy wants to merge 2 commits intogodaddy:mainfrom
Conversation
…rn flow - Add CCAvenue checkout button, icon, and return provider - Wrap with CCAvenueReturnProvider only when ccavenueConfig.accessCodeId is set - Use session from context (cookie) on CCAvenue return; remove sessionStorage token flow - Register CCAvenue in lazy-payment-loader, payment-form, types, and GraphQL - Update conditional-providers and use-confirm-checkout for CCAvenue - Add ccavenue localizations across locales - Update nextjs example and store actions Co-authored-by: Cursor <cursoragent@cursor.com>
|
packages/react/src/components/checkout/payment/utils/ccavenue-return-provider.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/payment-form.tsx
Outdated
Show resolved
Hide resolved
| __schema: { | ||
| queryType: { | ||
| name: 'Query', | ||
| "name": "checkout-api", |
There was a problem hiding this comment.
run pnpm lint:fix in packages/react to clean this up.
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/components/checkout/payment/checkout-buttons/ccavenue/ccavenue.tsx
Outdated
Show resolved
Hide resolved
- Pass ccavenueConfig from env in Next.js example (accessCodeId, redirectURL) - CCAvenue button: user-friendly message for AUTHORIZATION_FAILED, remove debug logs - CCAvenue return: use useConfirmCheckout.mutateAsync for redirect and error handling - Remove Record typecasting for payment.methods.ccavenue and descriptions in payment-form Co-authored-by: Cursor <cursoragent@cursor.com>
| ? { | ||
| accessCodeId: | ||
| process.env.NEXT_PUBLIC_CCAVENUE_ACCESS_CODE_ID, | ||
| redirectURL: process.env.NEXT_PUBLIC_CCAVENUE_REDIRECT_URL, |
There was a problem hiding this comment.
I think we should be setting the redirectURL in the payment component itself how we load payment method js files for example. The consumer of checkout shouldn't have to know what URL ccavanue needs to use to create their checkout.
const squareCDN =
apiHost && !apiHost.includes('test') && !apiHost.includes('dev')
? 'https://web.squarecdn.com/v1/square.js'
: 'https://sandbox.web.squarecdn.com/v1/square.js';
| type='button' | ||
| size='lg' | ||
| className={cn('w-full')} | ||
| disabled={isPaymentDisabled || isBusy} |
There was a problem hiding this comment.
isPaymentDisabled is already part of isBusy
| disabled={isPaymentDisabled || isBusy} | |
| disabled={isBusy} |
…rn flow
Summary
Changeset
Test Plan