Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/join-block/src/Services/StripeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@ public static function handleWebhook($event)
$invoice = $event['data']['object'] ?? null;
$customerId = $invoice['customer'] ?? '(unknown)';

if (($invoice['billing_reason'] ?? null) === 'subscription_create') {
$joinBlockLog->info("Skipping invoice.payment_failed lapsing for Stripe customer $customerId: subscription_create invoice, /join endpoint will handle Action Network state.");
Comment on lines 786 to +790
break;
}
Comment on lines +789 to +792

if (empty($invoice['next_payment_attempt'])) {
$joinBlockLog->warning("Final payment attempt failed for Stripe customer $customerId. No retries will be attempted.");
if (!empty($invoice['customer'])) {
Expand All @@ -811,6 +816,10 @@ public static function handleWebhook($event)
$invoice = $event['data']['object'] ?? null;
$customerId = $invoice['customer'] ?? '(unknown)';
$joinBlockLog->info("Invoice paid for Stripe customer $customerId");
if (($invoice['billing_reason'] ?? null) === 'subscription_create') {
$joinBlockLog->info("Skipping invoice.paid un-lapsing for Stripe customer $customerId: subscription_create invoice, /join endpoint will handle Action Network state.");
break;
}
if (!empty($invoice['customer'])) {
$email = self::getEmailForCustomer($customerId);
if ($email) {
Expand Down
Loading