udviklr/laravel-cashier-nets
A Laravel Cashier integration for Nets that brings subscription billing and payment handling to your app. Manage customers, plans, payments, and webhooks through a familiar, fluent Cashier-style API.
Upgrade to v1.5.0 normally; there are no schema, migration, config, or dependency changes called out. The first place to look is the Subscription model/class and the recordCheckoutCharge() implementation, plus the shared checkout/webhook transaction finalization path and the ChargeSucceeded event/listener wiring.
The first practical use case is recovering a captured initial checkout payment when the charge webhook was missed. Fetch the captured provider charge, then record it against the subscription so the local transaction exists and can be refunded through the package’s normal transaction/refund flow:
use Illuminate\Support\Carbon;
$subscription = Subscription::findOrFail($subscriptionId);
$transaction = $subscription->recordCheckoutCharge([
'provider' => 'stripe',
'provider_charge_id' => $chargeId,
'amount' => 4900,
'currency' => 'usd',
'charge' => $capturedChargePayload, // full-charge evidence
'captured_at' => Carbon::parse($capturedAt),
]);
Confirm the exact argument names and payload shape in the package source/docs. Treat the above as the integration shape: provider identity, amount, currency, full-charge evidence, and capture timestamp are required.
recordCheckoutCharge() as the reconciliation/fallback path. A scheduled job can scan checkout charges that have no local transaction and record them.ChargeSucceeded listeners idempotent. Use them for provisioning, receipts, analytics, or notifications, but do not manually dispatch ChargeSucceeded after recording.ChargeSucceeded is emitted once for a successful recording, and a throwing listener rolls back local recording for retry.Example reconciliation command shape:
foreach ($missingCheckoutCharges as $charge) {
$subscription = Subscription::findOrFail($charge->subscription_id);
if ($subscription->transactions()->where('provider_charge_id', $charge->id)->exists()) {
continue;
}
$subscription->recordCheckoutCharge([
'provider' => $charge->provider,
'provider_charge_id' => $charge->id,
'amount' => $charge->amount,
'currency' => $charge->currency,
'charge' => $charge->provider_payload,
'captured_at' => $charge->captured_at,
]);
}
ChargeSucceeded should be emitted once for a successful recording. If a listener throws, local recording rolls back so retry is possible, but any external side effects already performed by that listener are not rolled back. Design listeners defensively.recordCheckoutCharge(), and keep business reactions in idempotent ChargeSucceeded listeners rather than duplicating transaction creation logic.How can I help you explore Laravel packages today?