Updated ABACATEPAY_SETUP.md with comprehensive setup guide, including environment variables, API key instructions, webhook configuration, donation flow, and field details for better integration clarity. Added required fields (phone, CPF/CNPJ) to the donation form in app/[locale]/apoiar/page.tsx to collect essential donor information and improve compliance. This ensures smoother setup and more robust donation processing.
90 lines
1.6 KiB
TypeScript
90 lines
1.6 KiB
TypeScript
export interface DonationTier {
|
|
id: string;
|
|
amount?: number;
|
|
title: string;
|
|
description: string;
|
|
icon: "coffee" | "pizza" | "heart";
|
|
badge?: string;
|
|
highlighted?: boolean;
|
|
}
|
|
|
|
export interface DonationData {
|
|
amount: number;
|
|
donorName?: string;
|
|
donorEmail?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export const DONATION_PRODUCTS = {
|
|
coffee: {
|
|
id: "prod_6ryJmhfZGNJGjNaYaA1YqhDn",
|
|
name: "Doação Café",
|
|
amount: 5,
|
|
price: 500, // centavos
|
|
},
|
|
snack: {
|
|
id: "prod_FpLxKWgmHXbj2Ghwxa0BsFph",
|
|
name: "Doação Lanche",
|
|
amount: 10,
|
|
price: 1000,
|
|
},
|
|
lunch: {
|
|
id: "prod_czgg0YjKBp3GpsFYpSp3M1TZ",
|
|
name: "Doação Almoço",
|
|
amount: 25,
|
|
price: 2500,
|
|
},
|
|
} as const;
|
|
|
|
export type DonationTierId = keyof typeof DONATION_PRODUCTS;
|
|
|
|
export interface DonorData {
|
|
name: string;
|
|
phone: string;
|
|
email?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export interface DonationResponse {
|
|
success: boolean;
|
|
pixId?: string;
|
|
brCode?: string;
|
|
brCodeBase64?: string;
|
|
expiresAt?: string;
|
|
error?: string;
|
|
}
|
|
|
|
export interface BillingStatus {
|
|
id: string;
|
|
amount: number;
|
|
status: "PENDING" | "PAID" | "EXPIRED" | "CANCELLED";
|
|
pixCode: string;
|
|
pixQrCode: string;
|
|
expiresAt: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface DonationStats {
|
|
totalSupporters: number;
|
|
totalRaised: number;
|
|
monthsOnline: number;
|
|
uptime: number;
|
|
}
|
|
|
|
export interface TransparencyData {
|
|
hosting: number;
|
|
development: number;
|
|
support: number;
|
|
emergency: number;
|
|
}
|
|
|
|
export interface Supporter {
|
|
id: string;
|
|
name: string;
|
|
avatar?: string;
|
|
amount: number;
|
|
message?: string;
|
|
createdAt: string;
|
|
anonymous?: boolean;
|
|
}
|