This commit is contained in:
ct
2025-07-01 20:54:26 +08:00
parent 70898ccd4c
commit 79e7d7a49e
42 changed files with 2742 additions and 97 deletions

127
config/cashier.php Normal file
View File

@@ -0,0 +1,127 @@
<?php
use Laravel\Cashier\Console\WebhookCommand;
use Laravel\Cashier\Invoices\DompdfInvoiceRenderer;
return [
/*
|--------------------------------------------------------------------------
| Stripe Keys
|--------------------------------------------------------------------------
|
| The Stripe publishable key and secret key give you access to Stripe's
| API. The "publishable" key is typically used when interacting with
| Stripe.js while the "secret" key accesses private API endpoints.
|
*/
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
/*
|--------------------------------------------------------------------------
| Cashier Path
|--------------------------------------------------------------------------
|
| This is the base URI path where Cashier's views, such as the payment
| verification screen, will be available from. You're free to tweak
| this path according to your preferences and application design.
|
*/
'path' => env('CASHIER_PATH', 'stripe'),
/*
|--------------------------------------------------------------------------
| Stripe Webhooks
|--------------------------------------------------------------------------
|
| Your Stripe webhook secret is used to prevent unauthorized requests to
| your Stripe webhook handling controllers. The tolerance setting will
| check the drift between the current time and the signed request's.
|
*/
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
'events' => WebhookCommand::DEFAULT_EVENTS,
],
/*
|--------------------------------------------------------------------------
| Currency
|--------------------------------------------------------------------------
|
| This is the default currency that will be used when generating charges
| from your application. Of course, you are welcome to use any of the
| various world currencies that are currently supported via Stripe.
|
*/
'currency' => env('CASHIER_CURRENCY', 'usd'),
/*
|--------------------------------------------------------------------------
| Currency Locale
|--------------------------------------------------------------------------
|
| This is the default locale in which your money values are formatted in
| for display. To utilize other locales besides the default en locale
| verify you have the "intl" PHP extension installed on the system.
|
*/
'currency_locale' => env('CASHIER_CURRENCY_LOCALE', 'en'),
/*
|--------------------------------------------------------------------------
| Payment Confirmation Notification
|--------------------------------------------------------------------------
|
| If this setting is enabled, Cashier will automatically notify customers
| whose payments require additional verification. You should listen to
| Stripe's webhooks in order for this feature to function correctly.
|
*/
'payment_notification' => env('CASHIER_PAYMENT_NOTIFICATION'),
/*
|--------------------------------------------------------------------------
| Invoice Settings
|--------------------------------------------------------------------------
|
| The following options determine how Cashier invoices are converted from
| HTML into PDFs. You're free to change the options based on the needs
| of your application or your preferences regarding invoice styling.
|
*/
'invoices' => [
'renderer' => env('CASHIER_INVOICE_RENDERER', DompdfInvoiceRenderer::class),
'options' => [
// Supported: 'letter', 'legal', 'A4'
'paper' => env('CASHIER_PAPER', 'letter'),
'remote_enabled' => env('CASHIER_REMOTE_ENABLED', false),
],
],
/*
|--------------------------------------------------------------------------
| Stripe Logger
|--------------------------------------------------------------------------
|
| This setting defines which logging channel will be used by the Stripe
| library to write log messages. You are free to specify any of your
| logging channels listed inside the "logging" configuration file.
|
*/
'logger' => env('CASHIER_LOGGER'),
];

View File

@@ -2,4 +2,6 @@
return [
'enable_test_routes' => env('ENABLE_TEST_ROUTES', false),
'authed_route_redirect' => 'home',
];

View File

@@ -0,0 +1,37 @@
<?php
return [
[
'id' => 'ala-500-credits',
'show_in_pricing' => true,
'type' => 'alacarte_credits',
'enabled' => true,
'name' => '500 Credit Packs',
'description' => 'Use credits to automatically generate captions & backgrounds for your memes.',
'amount' => 4,
'currency' => 'usd',
'symbol' => '$',
'system' => [
'credits' => 500,
'stripe' => [
'product_id' => [
'test' => 'prod_SaY9YLBtUR5Ucb',
'prod' => 'prod_XXXXXXXXXXXXX',
],
'current_stripe_price_id' => [
'test' => 'price_1RfN37EEXQJo9EEOb6UCQVEx',
'prod' => 'price_XXXXXXXXXXXXX',
],
'stripe_price_ids' => [
'test' => [
'price_1RfN37EEXQJo9EEOb6UCQVEx',
],
'prod' => [
'price_XXXXXXXXXXXX',
],
],
],
],
],
];

View File

@@ -0,0 +1,134 @@
<?php
// (Personal|Business) (Starter|Creator|Pro)
return [
[
'id' => 'free',
'show_in_pricing' => false,
'type' => 'subscription_plans',
'enabled' => true,
'name' => 'Free',
'amount' => 0,
'currency' => 'usd',
'symbol' => '$',
'primary_interval' => 'month',
'features' => [
[
'text' => 'Unlimited watermarked videos',
'available' => true,
],
[
'text' => 'Memes & Background Libraries',
'available' => true,
],
],
'system' => [
'non_watermark_videos' => 0,
],
],
[
'id' => 'personal-creator',
'show_in_pricing' => true,
'type' => 'subscription_plans',
'enabled' => true,
'name' => 'Personal Creator',
'amount' => 4,
'currency' => 'usd',
'symbol' => '$',
'primary_interval' => 'month',
'features' => [
[
'text' => '50 non-watermarked videos',
'available' => true,
],
],
'system' => [
'non_watermark_videos' => 50,
'stripe' => [
'product_id' => [
'test' => [
'month' => 'prod_SaY8TGjiPi5hWu',
],
'prod' => [
'month' => 'prod_XXXXXXXXXXXXX',
],
],
'current_stripe_price_id' => [
'test' => [
'month' => 'price_1RfN2VEEXQJo9EEOzjPI2HGt',
],
'prod' => [
'month' => 'price_XXXXXXXXXXXXX',
],
],
'stripe_price_ids' => [
'test' => [
'month' => [
'price_1RfN2VEEXQJo9EEOzjPI2HGt',
],
],
'prod' => [
'month' => [
'price_XXXXXXXXXXXX',
],
],
],
],
],
],
[
'id' => 'sub-500-credits',
'show_in_pricing' => false,
'type' => 'subscription_credits',
'enabled' => true,
'name' => '500 Credits / month',
'amount' => 3,
'currency' => 'usd',
'symbol' => '$',
'primary_interval' => 'month',
'features' => [
[
'text' => '500 Credits',
'available' => true,
],
],
'system' => [
'credits' => 500,
'stripe' => [
'product_id' => [
'test' => [
'month' => 'prod_XXXXXXXXXXXXX',
],
'prod' => [
'month' => 'prod_XXXXXXXXXXXXX',
],
],
'current_stripe_price_id' => [
'test' => [
'month' => 'price_XXXXXXXXXXXXX',
],
'prod' => [
'month' => 'price_XXXXXXXXXXXXX',
],
],
'stripe_price_ids' => [
'test' => [
'month' => [
'price_XXXXXXXXXXXXX',
'price_XXXXXXXXXXXXX',
],
],
'prod' => [
'month' => [
'price_XXXXXXXXXXXX',
'price_XXXXXXXXXXXXX',
],
],
],
],
],
],
];

View File

@@ -47,4 +47,10 @@
'api_key' => env('OPENAI_API_KEY'),
],
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('GOOGLE_CLIENT_REDIRECT_URI'),
],
];