nerdysouth/stripe-bundle
A Laravel bundle that integrates the Stripe PHP SDK with configuration, a service provider, and facades for quick payment setup. Simplifies charges, subscriptions, and webhooks, letting you add Stripe billing to your app with minimal boilerplate.
composer require <vendor>/<package> (check Packagist for the exact name; the release notes refer to createPaymentUrl).php artisan vendor:publish --tag=<package>-config) and add credentials to .env — typically an API key, secret, and a sandbox/production flag.README and config/<package>.php. Confirm the exact namespace, facade/service binding, and the signature of createPaymentUrl (the v0.1.2 release adds an optional trial-days argument).use Vendor\Package\Facades\Payment;
$url = Payment::createPaymentUrl([
'amount' => 1999, // check units: cents vs decimal
'currency' => 'USD',
'reference'=> 'order_123',
'callback' => route('payments.callback'),
]);
return redirect()->away($url);
$url = Payment::createPaymentUrl([
'amount' => 1999,
'currency' => 'USD',
'reference' => 'order_123',
'trial_days'=> 14,
'callback' => route('payments.callback'),
]);
PaymentService so you can swap gateways and test with a fake.createPaymentUrl returns a URL. The typical flow is: validate order → persist a pending transaction record with your own reference → call createPaymentUrl → redirect. Treat the redirect as fire-and-forget; the authoritative confirmation comes from the gateway callback/webhook.trial_days option only when the gateway and your business model support delayed first charge. Persist the trial end date locally (now()->addDays($trialDays)) so you can reconcile subscriptions, send reminders, and handle cancellation before the first charge.Payment::verifyCallback() or similar), then mark the transaction paid/failed idempotently. Always return the gateway’s expected response (200 or a specific body) to avoid retries.Payment::fake() if provided) and assert the generated URL contains the expected amount, currency, and trial days. For integration tests, use the sandbox mode and a local tunnel (ngrok/Expose) for callbacks.trial_days may mean “no charge for N days” or “first charge deferred,” and some gateways require a subscription/plan ID rather than a one-off payment. Confirm the package/gateway behaviour before relying on it.19.99 instead of 1999 is a common source of silent over/under-charging. Check the config or method docs.route() is fine, but avoid localhost in sandbox testing unless you use a tunnel. Some gateways reject URLs with query strings or non-HTTPS schemes.createPaymentUrl again..env.testing or a sandbox callback pointing at production.beforeRedirect hook. Use these for metadata (order ID, customer ID) rather than forking the package. If the package dispatches events (e.g. PaymentCreated), hook into them for audit logs.composer.json and review changelogs before upgrading, as method signatures may still change.How can I help you explore Laravel packages today?