Date discrepancy when user cancels subscription
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.

Hey!
Ah good find! I think I see the issue:
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
No problem! Happy to hear that!
Thanks for submitting the PR!
