PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

Date discrepancy when user cancels subscription

Solved
produkt

Mar 3rd, 2025 07:33 PM

I am testing subscription functionality and when I sign up (through Stripe) for a monthly subscription, and then cancel, my /settings/subscription page reflects the subscription's updated_at date, not the ends_at date when warning me that the subscription is scheduled to cancel. When I search the project for the text Your subscription is scheduled to cancel on I am lead to update.blade.php. Here, it shows this code: Your subscription is scheduled to cancel on {{ \Carbon\Carbon::parse($subscription_ends_at)->format('F jS, Y') }}. Click the manage subscription button to re-activate/renew your subscription. However, I can't find where it's getting $subscription_ends_at because it does not appear to be getting the correct database column. Screenshot 2025-03-03 at 10.29.54 PM.png Screenshot 2025-03-03 at 10.29.10 PM.png Screenshot 2025-03-03 at 10.28.48 PM.png

bobbyiliev

Mar 4th, 2025 03:32 AM

Best Answer

Hey!

Ah good find! I think I see the issue:

src/Http/Livewire/Billing/Update.php

In this file, in the mount can you try the following:

public function mount(){
    $this->subscription = auth()->user()->subscription;

    if(config('wave.billing_provider') == 'paddle' && auth()->user()->subscriber()){
        // Keep existing Paddle logic
    } elseif (config('wave.billing_provider') == 'stripe') {
        // Correctly fetch Stripe's `ends_at`
        $this->subscription_ends_at = optional($this->subscription)->ends_at;
    }
}

That way the subscription_ends_at will be set for the Stripe integration, at the moment, as far as I can tell we are only setting it for Paddle so the blade view just displays the current date rather than the ends_at.

Let me know if this works! If so we could submit a PR with that fix.

- Bobby

produkt

Mar 4th, 2025 05:57 AM

Awesome, it worked.

Report
1
bobbyiliev

Mar 5th, 2025 03:40 AM

No problem! Happy to hear that!

Thanks for submitting the PR!