import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import { CreditCardIcon, BuildingLibraryIcon, CheckCircleIcon, ArrowTopRightOnSquareIcon, } from '@heroicons/react/24/outline'; import { Event, PaymentOptionsConfig } from '@/lib/api'; import { formatPrice, getTpagoLink } from '@/lib/utils'; import type { BookingResult } from '../_types'; interface ManualPaymentStepProps { bookingResult: BookingResult; event: Event; paymentConfig: PaymentOptionsConfig; locale: string; paidUnderDifferentName: boolean; setPaidUnderDifferentName: (value: boolean) => void; payerName: string; setPayerName: (value: string) => void; markingPaid: boolean; onMarkPaymentSent: () => void; } export function ManualPaymentStep({ bookingResult, event, paymentConfig, locale, paidUnderDifferentName, setPaidUnderDifferentName, payerName, setPayerName, markingPaid, onMarkPaymentSent, }: ManualPaymentStepProps) { const isBankTransfer = bookingResult.paymentMethod === 'bank_transfer'; const isTpago = bookingResult.paymentMethod === 'tpago'; const ticketCount = bookingResult.ticketCount || 1; const totalAmount = (event?.price || 0) * ticketCount; const tpagoLink = getTpagoLink(paymentConfig, ticketCount); return (
{isBankTransfer ? ( ) : ( )}

{locale === 'es' ? 'Completa tu Pago' : 'Complete Your Payment'}

{locale === 'es' ? 'Sigue las instrucciones para completar tu pago' : 'Follow the instructions to complete your payment'}

{/* Amount to pay */}

{locale === 'es' ? 'Monto a pagar' : 'Amount to pay'}

{event?.price !== undefined ? formatPrice(totalAmount, event.currency) : ''}

{ticketCount > 1 && (

{ticketCount} tickets × {formatPrice(event?.price || 0, event?.currency || 'PYG')}

)}
{/* Bank Transfer Details */} {isBankTransfer && (

{locale === 'es' ? 'Datos Bancarios' : 'Bank Details'}

{paymentConfig.bankName && (
{locale === 'es' ? 'Banco' : 'Bank'}: {paymentConfig.bankName}
)} {paymentConfig.bankAccountHolder && (
{locale === 'es' ? 'Titular' : 'Account Holder'}: {paymentConfig.bankAccountHolder}
)} {paymentConfig.bankAccountNumber && (
{locale === 'es' ? 'Nro. Cuenta' : 'Account Number'}: {paymentConfig.bankAccountNumber}
)} {paymentConfig.bankAlias && (
Alias: {paymentConfig.bankAlias}
)} {paymentConfig.bankPhone && (
{locale === 'es' ? 'Teléfono' : 'Phone'}: {paymentConfig.bankPhone}
)}
{(locale === 'es' ? paymentConfig.bankNotesEs : paymentConfig.bankNotes) && (

{locale === 'es' ? paymentConfig.bankNotesEs : paymentConfig.bankNotes}

)}
)} {/* TPago Link */} {isTpago && (

{locale === 'es' ? 'Pago con Tarjeta' : 'Card Payment'}

{tpagoLink && ( {locale === 'es' ? 'Abrir TPago para Pagar' : 'Open TPago to Pay'} )} {(locale === 'es' ? paymentConfig.tpagoInstructionsEs : paymentConfig.tpagoInstructions) && (

{locale === 'es' ? paymentConfig.tpagoInstructionsEs : paymentConfig.tpagoInstructions}

)}
)} {/* Reference */}

{locale === 'es' ? 'Referencia de tu reserva' : 'Your booking reference'}

{bookingResult.qrCode}

{/* Manual verification notice */}

{locale === 'es' ? 'Verificación manual' : 'Manual verification'}

{locale === 'es' ? 'El equipo de Spanglish revisará el pago manualmente. Tu reserva solo será confirmada después de recibir un email de confirmación de nuestra parte.' : 'The Spanglish team will review the payment manually. Your booking is only confirmed after you receive a confirmation email from us.'}

{/* Paid under different name option */}
{paidUnderDifferentName && (
setPayerName(e.target.value)} placeholder={locale === 'es' ? 'Nombre completo del titular de la cuenta' : 'Full name of account holder'} required />
)}
{/* Warning before I Have Paid button */}

{locale === 'es' ? 'Solo haz clic aquí después de haber completado el pago.' : 'Only click this after you have actually completed the payment.'}

{/* I Have Paid Button */}

{locale === 'es' ? 'Tu reserva será confirmada una vez que verifiquemos el pago' : 'Your booking will be confirmed once we verify the payment'}

); }