From 5c90b15b2ed268630fbedcf6abf89533b009db57 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Fri, 27 Mar 2026 15:30:52 +0100 Subject: [PATCH] feat: branded payment tiles, add Google Pay, remove Bank Transfer Replace generic icons with colored brand SVGs (Mastercard, Bancontact, iDEAL, Apple Pay, Google Pay, SEPA). Compact equal-height tiles. --- components/checkout/PaymentForm.tsx | 77 ++++++++++++++++++----------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/components/checkout/PaymentForm.tsx b/components/checkout/PaymentForm.tsx index 83f3c07..1ae156a 100644 --- a/components/checkout/PaymentForm.tsx +++ b/components/checkout/PaymentForm.tsx @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react' import { useRouter } from 'next/navigation' import Script from 'next/script' import { motion, AnimatePresence } from 'framer-motion' -import { CreditCard, Lock, ShieldCheck, Bank } from '@phosphor-icons/react' +import { Lock, ShieldCheck } from '@phosphor-icons/react' import { initMollie, getMollie, MOLLIE_FIELD_STYLES, type MollieComponent } from '@/lib/mollie' import { createEmbeddedCheckout, createCheckoutSession } from '@/lib/api/billing' @@ -16,46 +16,68 @@ interface PaymentFormProps { vatId: string } -const PAYMENT_METHODS: Array<{ id: string; label: string; description?: string; icon: string }> = [ - { id: 'card', label: 'Card', description: 'Visa, Mastercard, Amex', icon: 'card' }, - { id: 'bancontact', label: 'Bancontact', icon: 'bancontact' }, - { id: 'ideal', label: 'iDEAL', icon: 'ideal' }, - { id: 'applepay', label: 'Apple Pay', icon: 'applepay' }, - { id: 'directdebit', label: 'SEPA Direct Debit', icon: 'sepa' }, - { id: 'banktransfer', label: 'Bank Transfer', icon: 'banktransfer' }, +const PAYMENT_METHODS = [ + { id: 'card', label: 'Card' }, + { id: 'bancontact', label: 'Bancontact' }, + { id: 'ideal', label: 'iDEAL' }, + { id: 'applepay', label: 'Apple Pay' }, + { id: 'googlepay', label: 'Google Pay' }, + { id: 'directdebit', label: 'SEPA' }, ] -function MethodIcon({ type, className }: { type: string; className?: string }) { - const cn = className || 'h-6 w-6' +function MethodLogo({ type }: { type: string }) { switch (type) { case 'card': - return + return ( +
+ + + + + +
+ ) case 'bancontact': return ( - - - - + + + + ) case 'ideal': return ( - - - + + + + ) case 'applepay': return ( - - + + + + ) + case 'googlepay': + return ( + + + + + + + ) + case 'directdebit': + return ( + + + + ) - case 'sepa': - case 'banktransfer': - return default: - return + return null } } @@ -227,17 +249,14 @@ export default function PaymentForm({ plan, interval, limit, country, vatId }: P key={method.id} type="button" onClick={() => { setSelectedMethod(method.id); setFormError(null) }} - className={`relative flex flex-col items-center gap-1.5 rounded-xl border px-3 py-3.5 text-xs font-medium transition-all duration-200 ${ + className={`flex flex-col items-center justify-center gap-1 rounded-xl border h-[52px] text-[10px] font-medium transition-all duration-200 ${ isSelected ? 'border-brand-orange bg-brand-orange/5 text-white' : 'border-neutral-700/50 bg-neutral-800/30 text-neutral-400 hover:border-neutral-600 hover:text-neutral-300' }`} > - + {method.label} - {method.description && ( - {method.description} - )} ) })}