laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
238 stars 57 forks source link

after pause subscription, paused() method return false #189

Closed hnasiry closed 1 year ago

hnasiry commented 1 year ago

Cashier Paddle Version

1.7

Laravel Version

10.11

PHP Version

8.2

Database Driver & Version

MySQL 8

Description

after use pause method for subscription, paddle API return status active and store active in paddle_status column. so when determine pause status with paused() method, return false instead of true because only check $this->paddle_status === self::STATUS_PAUSED; for solve this problem or manually store pause status or check base on another column like paused_from

public function paused() { return $this->paddle_status === self::STATUS_PAUSED || $this->onPausedGracePeriod(); }

Steps To Reproduce

1- first subscribe a user on a paddle plan 2- pause the subscription by $user->subscription()->pause(); 3- Determine if the subscription is paused by $user->subscription()->pauseed(); 4- method return false instead of true because dont check paused grace period.