feat: integrate Stripe payment module with API + UI components
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Stripe configuration (frontend) for the Payments module.
|
||||
*
|
||||
* Only the PUBLISHABLE key lives on the frontend — it is safe to expose. The
|
||||
* Secret Key and Webhook Secret are backend-only (see /api/payments/*).
|
||||
*
|
||||
* Set in `.env` (see .env.example):
|
||||
* VITE_STRIPE_PUBLISHABLE_KEY=pk_test_… or pk_live_…
|
||||
*
|
||||
* Until a real key is provided, `isConfigured` is false and the UI shows a
|
||||
* clear "configure Stripe" notice rather than attempting a broken redirect.
|
||||
*/
|
||||
|
||||
const PLACEHOLDER = 'pk_test_REPLACE_WITH_YOUR_PUBLISHABLE_KEY';
|
||||
|
||||
const publishableKey = import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || PLACEHOLDER;
|
||||
|
||||
export const stripeConfig = {
|
||||
publishableKey,
|
||||
|
||||
// Base path for the payment API endpoints (Vercel serverless functions).
|
||||
apiBase: '/api/payments',
|
||||
|
||||
// True only when a real publishable key is present.
|
||||
isConfigured:
|
||||
typeof publishableKey === 'string' &&
|
||||
publishableKey.startsWith('pk_') &&
|
||||
publishableKey !== PLACEHOLDER,
|
||||
|
||||
currency: 'usd',
|
||||
locale: 'en-US',
|
||||
|
||||
merchant: {
|
||||
name: 'LynkedUp Pro Roofing',
|
||||
supportEmail: 'billing@lynkeduppro.com',
|
||||
},
|
||||
};
|
||||
|
||||
export default stripeConfig;
|
||||
Reference in New Issue
Block a user