Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/some-berries-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@godaddy/react": patch
"@godaddy/localizations": patch
---

Implementation of mercadopago
60 changes: 46 additions & 14 deletions examples/nextjs/app/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,52 @@ export function CheckoutPage({ session }: { session: CheckoutSession }) {
<Checkout
session={session}
checkoutFormSchema={customSchema}
squareConfig={{
appId: process.env.NEXT_PUBLIC_SQUARE_APP_ID || '',
locationId: process.env.NEXT_PUBLIC_SQUARE_LOCATION_ID || '',
}}
stripeConfig={{
publishableKey: process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || '',
}}
godaddyPaymentsConfig={{
businessId: process.env.NEXT_PUBLIC_GODADDY_BUSINESS_ID || '',
appId: process.env.NEXT_PUBLIC_GODADDY_APP_ID || '',
}}
paypalConfig={{
clientId: process.env.NEXT_PUBLIC_PAYPAL_CLIENT_ID || '',
}}
squareConfig={
process.env.NEXT_PUBLIC_SQUARE_APP_ID &&
process.env.NEXT_PUBLIC_SQUARE_LOCATION_ID
? {
appId: process.env.NEXT_PUBLIC_SQUARE_APP_ID,
locationId: process.env.NEXT_PUBLIC_SQUARE_LOCATION_ID,
}
: undefined
}
stripeConfig={
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
? {
publishableKey: process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY,
}
: undefined
}
mercadoPagoConfig={
process.env.NEXT_PUBLIC_MERCADOPAGO_PUBLIC_KEY
? {
publicKey: process.env.NEXT_PUBLIC_MERCADOPAGO_PUBLIC_KEY,
country:
(process.env.NEXT_PUBLIC_MERCADOPAGO_COUNTRY as
| 'AR'
| 'BR'
| 'CO'
| 'CL'
| 'PE'
| 'MX') || 'AR',
}
: undefined
}
godaddyPaymentsConfig={
process.env.NEXT_PUBLIC_GODADDY_APP_ID
? {
businessId: process.env.NEXT_PUBLIC_GODADDY_BUSINESS_ID || '',
appId: process.env.NEXT_PUBLIC_GODADDY_APP_ID,
}
: undefined
}
paypalConfig={
process.env.NEXT_PUBLIC_PAYPAL_CLIENT_ID
? {
clientId: process.env.NEXT_PUBLIC_PAYPAL_CLIENT_ID,
}
: undefined
}
/>
);
}
12 changes: 4 additions & 8 deletions examples/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ export default async function Home() {
processor: 'godaddy',
checkoutTypes: ['standard'],
},
express: {
processor: 'godaddy',
checkoutTypes: ['express'],
mercadopago: {
processor: 'mercadopago',
checkoutTypes: ['standard'],
},
paypal: {
processor: 'paypal',
checkoutTypes: ['standard'],
},
offline: {
processor: 'offline',
checkoutTypes: ['standard'],
checkoutTypes: ['express', 'standard'],
},
},
operatingHours: {
Expand Down
5 changes: 1 addition & 4 deletions examples/nextjs/app/store/product/[productId]/product.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ export default function Product({ productId }: { productId: string }) {
<ArrowLeft className='h-4 w-4' />
Back to Store
</Link>
<ProductDetails
productId={productId}
onAddToCartSuccess={openCart}
/>
<ProductDetails productId={productId} onAddToCartSuccess={openCart} />
</div>
);
}
36 changes: 18 additions & 18 deletions examples/nextjs/biome.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.3/schema.json",
"extends": ["biome-config-godaddy/biome.json"],
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
},
"files": {
"includes": ["**/*", "!!**/src/globals.css"]
},
"linter": {
"rules": {
"correctness": {
"useUniqueElementIds": "off"
}
}
}
"$schema": "https://biomejs.dev/schemas/2.3.3/schema.json",
"extends": ["biome-config-godaddy/biome.json"],
"css": {
"parser": {
"cssModules": true,
"tailwindDirectives": true
}
},
"files": {
"includes": ["**/*", "!!**/src/globals.css"]
},
"linter": {
"rules": {
"correctness": {
"useUniqueElementIds": "off"
}
}
}
}
4 changes: 4 additions & 0 deletions examples/nextjs/env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ NEXT_PUBLIC_GODADDY_APP_ID=
NEXT_PUBLIC_SQUARE_APP_ID=
NEXT_PUBLIC_SQUARE_LOCATION_ID=
NEXT_PUBLIC_PAYPAL_CLIENT_ID=

# MercadoPago Credentials
NEXT_PUBLIC_MERCADOPAGO_PUBLIC_KEY=
NEXT_PUBLIC_MERCADOPAGO_COUNTRY=AR
3 changes: 3 additions & 0 deletions packages/localizations/src/deDe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const deDe = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Offline-Zahlungen',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -114,6 +115,8 @@ export const deDe = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Verwende das MercadoPago-Formular unten, um deinen Kauf sicher abzuschließen.',
},
noMethodsAvailable: 'Keine Zahlungsmethoden verfügbar',
cardNumber: 'Kartennummer',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/enIe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const enIe = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Offline payments',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -114,6 +115,8 @@ export const enIe = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Use the MercadoPago form below to complete your purchase securely.',
},
noMethodsAvailable: 'No payment methods available',
cardNumber: 'Card number',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/enUs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const enUs = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Offline payments',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -114,6 +115,8 @@ export const enUs = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Use the MercadoPago form below to complete your purchase securely.',
},
noMethodsAvailable: 'No payment methods available',
cardNumber: 'Card number',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esAr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esAr = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos en efectivo',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esAr = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esCl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esCl = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos offline',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esCl = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esCo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esCo = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos sin conexión',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esCo = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esEs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esEs = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos sin conexión',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esEs = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esMx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esMx = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos fuera de línea',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esMx = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esPe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esPe = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos en efectivo',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esPe = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/esUs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const esUs = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagos offline',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const esUs = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa el formulario de MercadoPago a continuación para completar tu compra de forma segura.',
},
noMethodsAvailable: 'No hay métodos de pago disponibles',
cardNumber: 'Número de tarjeta',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/frCa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const frCa = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Paiements hors ligne',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const frCa = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Utilisez le formulaire MercadoPago ci-dessous pour finaliser votre achat en toute sécurité.',
},
noMethodsAvailable: 'Aucune méthode de paiement disponible',
cardNumber: 'Numéro de carte',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/frFr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const frFr = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Paiements hors ligne',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const frFr = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Utilisez le formulaire MercadoPago ci-dessous pour finaliser votre achat en toute sécurité.',
},
noMethodsAvailable: 'Aucune méthode de paiement disponible',
cardNumber: 'Numéro de carte',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/idId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const idId = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pembayaran offline',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -114,6 +115,8 @@ export const idId = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Gunakan formulir MercadoPago di bawah untuk menyelesaikan pembelian Anda dengan aman.',
},
noMethodsAvailable: 'Tidak ada metode pembayaran tersedia',
cardNumber: 'Nomor kartu',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/itIt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const itIt = {
googlePay: 'Google Pay',
paze: 'Paze',
offline: 'Pagamenti offline',
mercadopago: 'Mercado Pago',
},
descriptions: {
creditCard: '',
Expand All @@ -115,6 +116,8 @@ export const itIt = {
googlePay: '',
paze: '',
offline: '',
mercadopago:
'Usa il modulo MercadoPago qui sotto per completare l’acquisto in modo sicuro.',
},
noMethodsAvailable: 'Nessun metodo di pagamento disponibile',
cardNumber: 'Numero della carta',
Expand Down
Loading