Skip to content

Commit

Permalink
Allow syncStripePauseCollection only if owner present
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslawww committed Dec 6, 2023
1 parent d8c11a5 commit de0f9a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 0 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="TestSuite">
<directory>tests</directory>
Expand Down
8 changes: 5 additions & 3 deletions src/Eloquent/UsesPauseCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ public function unpause(): static
*/
public function syncStripePauseCollection(): static
{
$subscription = $this->asStripeSubscription();
if($this->owner) {
$subscription = $this->asStripeSubscription();

$this->pause_collection = $subscription->pause_collection?->toArray();
$this->save();
$this->pause_collection = $subscription->pause_collection?->toArray();
$this->save();
}

return $this;
}
Expand Down

0 comments on commit de0f9a7

Please sign in to comment.