Skip to content

Commit eaa8496

Browse files
asaini-godaddycursoragentpbennett1-godaddy
authored
feat(checkout): add CCAvenue payment provider and cookie-session retu… (#1291)
* feat(checkout): add CCAvenue payment provider and cookie-session return 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> * feat(checkout): CCAvenue improvements and example config - 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> * feat(react): set CCAvenue redirect URL in payment component by environment - Make CCAvenueConfig.redirectURL optional; derive gateway URL from apiHost (prod: secure.ccavenue.com, test: test.ccavenue.com) like Square CDN - Consumer only passes accessCodeId; example checkout no longer needs NEXT_PUBLIC_CCAVENUE_REDIRECT_URL Co-authored-by: Cursor <cursoragent@cursor.com> * chore(react): CCAvenue cleanup - remove redirectURL from config, debug log, and label fallback - Remove optional redirectURL from CCAvenueConfig (always use derived gateway URL) - Remove console.log from CCAvenue checkout button - Use translation only for CCAvenue payment method label in payment form Co-authored-by: Cursor <cursoragent@cursor.com> * disable form and mutations if confirmingCheckout * feat(ccavenue): add shipping validation and jwt auth support - CCAvenueCheckoutButton: require shipping methods when delivery is SHIP before allowing payment; use env-based redirect URL - CCAvenueReturnProvider: support jwt as auth fallback when session token unavailable for confirm checkout - checkout-env: formatting (quotes) Co-authored-by: Cursor <cursoragent@cursor.com> * lint fix * chore: add changeset for CCAvenue checkout improvements Made-with: Cursor --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Phil Bennett <pbennett1@godaddy.com> Co-authored-by: Phil Bennett <114938978+pbennett1-godaddy@users.noreply.github.com>
1 parent dc5bcd1 commit eaa8496

39 files changed

+358
-23
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@godaddy/react": patch
3+
"@godaddy/localizations": patch
4+
---
5+
6+
Add CCAvenue payment provider support and improvements
7+
8+
**@godaddy/react**
9+
- Add CCAvenue checkout button with shipping validation (require shipping methods when delivery is SHIP)
10+
- Add CCAvenueReturnProvider for return flow with JWT auth support and confirm checkout loader
11+
- Use env-based redirect URL for CCAvenue gateway
12+
- Disable form and mutations when confirming checkout
13+
14+
**@godaddy/localizations**
15+
- Add CCAvenue payment method labels and descriptions for all supported locales

examples/nextjs/app/checkout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ export function CheckoutPage({ session }: { session: CheckoutSession }) {
6060
}
6161
: undefined
6262
}
63+
ccavenueConfig={
64+
process.env.NEXT_PUBLIC_CCAVENUE_ACCESS_CODE_ID
65+
? {
66+
accessCodeId:
67+
process.env.NEXT_PUBLIC_CCAVENUE_ACCESS_CODE_ID,
68+
}
69+
: undefined
70+
}
6371
/>
6472
);
6573
}

examples/nextjs/app/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ export default async function Home() {
6262
processor: 'mercadopago',
6363
checkoutTypes: ['standard'],
6464
},
65+
ccavenue: {
66+
processor: 'ccavenue',
67+
checkoutTypes: ['standard'],
68+
},
6569
paypal: {
6670
processor: 'paypal',
6771
checkoutTypes: ['express', 'standard'],

examples/nextjs/app/store/actions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export async function checkoutWithOrder(orderId: string) {
5151
processor: 'godaddy',
5252
checkoutTypes: ['standard'],
5353
},
54+
ccavenue: {
55+
processor: 'ccavenue',
56+
checkoutTypes: ['standard'],
57+
},
5458
express: {
5559
processor: 'godaddy',
5660
checkoutTypes: ['express'],

packages/localizations/src/deDe.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const deDe = {
107107
paze: 'Paze',
108108
offline: 'Offline-Zahlungen',
109109
mercadopago: 'Mercado Pago',
110+
ccavenue: 'Mit CCAvenue bezahlen',
110111
},
111112
descriptions: {
112113
creditCard: '',
@@ -117,6 +118,7 @@ export const deDe = {
117118
offline: '',
118119
mercadopago:
119120
'Verwende das MercadoPago-Formular unten, um deinen Kauf sicher abzuschließen.',
121+
ccavenue: '',
120122
},
121123
noMethodsAvailable: 'Keine Zahlungsmethoden verfügbar',
122124
cardNumber: 'Kartennummer',

packages/localizations/src/enIe.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const enIe = {
107107
paze: 'Paze',
108108
offline: 'Offline payments',
109109
mercadopago: 'Mercado Pago',
110+
ccavenue: 'Pay with CCAvenue',
110111
},
111112
descriptions: {
112113
creditCard: '',
@@ -117,6 +118,7 @@ export const enIe = {
117118
offline: '',
118119
mercadopago:
119120
'Use the MercadoPago form below to complete your purchase securely.',
121+
ccavenue: '',
120122
},
121123
noMethodsAvailable: 'No payment methods available',
122124
cardNumber: 'Card number',

packages/localizations/src/enUs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const enUs = {
107107
paze: 'Paze',
108108
offline: 'Offline payments',
109109
mercadopago: 'Mercado Pago',
110+
ccavenue: 'Pay with CCAvenue',
110111
},
111112
descriptions: {
112113
creditCard: '',
@@ -117,6 +118,7 @@ export const enUs = {
117118
offline: '',
118119
mercadopago:
119120
'Use the MercadoPago form below to complete your purchase securely.',
121+
ccavenue: '',
120122
},
121123
noMethodsAvailable: 'No payment methods available',
122124
cardNumber: 'Card number',

packages/localizations/src/esAr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const esAr = {
108108
paze: 'Paze',
109109
offline: 'Pagos en efectivo',
110110
mercadopago: 'Mercado Pago',
111+
ccavenue: 'الدفع عبر CCAvenue',
111112
},
112113
descriptions: {
113114
creditCard: '',
@@ -118,6 +119,7 @@ export const esAr = {
118119
offline: '',
119120
mercadopago:
120121
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
122+
ccavenue: '',
121123
},
122124
noMethodsAvailable: 'No hay métodos de pago disponibles',
123125
cardNumber: 'Número de tarjeta',

packages/localizations/src/esCl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const esCl = {
108108
paze: 'Paze',
109109
offline: 'Pagos offline',
110110
mercadopago: 'Mercado Pago',
111+
ccavenue: 'Pagar con CCAvenue',
111112
},
112113
descriptions: {
113114
creditCard: '',
@@ -118,6 +119,7 @@ export const esCl = {
118119
offline: '',
119120
mercadopago:
120121
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
122+
ccavenue: '',
121123
},
122124
noMethodsAvailable: 'No hay métodos de pago disponibles',
123125
cardNumber: 'Número de tarjeta',

packages/localizations/src/esCo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const esCo = {
108108
paze: 'Paze',
109109
offline: 'Pagos sin conexión',
110110
mercadopago: 'Mercado Pago',
111+
ccavenue: 'Pagar con CCAvenue',
111112
},
112113
descriptions: {
113114
creditCard: '',
@@ -118,6 +119,7 @@ export const esCo = {
118119
offline: '',
119120
mercadopago:
120121
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
122+
ccavenue: '',
121123
},
122124
noMethodsAvailable: 'No hay métodos de pago disponibles',
123125
cardNumber: 'Número de tarjeta',

0 commit comments

Comments
 (0)