Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoreChargeResult default true #49

Merged
merged 6 commits into from
Apr 26, 2024
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
13 changes: 8 additions & 5 deletions src/GuSubscriptionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,23 @@ public function markAsCancelled()
/**
* Resume the cancelled subscription.
*
* @param bool $ignoreChargeResult
* @return $this
*
* @throws \LogicException
*/
public function resume()
public function resume($ignoreChargeResult = true)
{
$subscription = $this->asIuguSubscription();

$subscription->activate();

// Finally, we will remove the ending timestamp from the user's record in the
// local database to indicate that the subscription is active again and is
// no longer "cancelled". Then we will save this record in the database.
$this->fill(['ends_at' => null])->save();
if ($ignoreChargeResult) {
// Finally, we will remove the ending timestamp from the user's record in the
// local database to indicate that the subscription is active again and is
// no longer "cancelled". Then we will save this record in the database.
$this->fill(['ends_at' => null])->save();
}

return $this;
}
Expand Down
Loading