Created
February 15, 2020 00:24
-
-
Save driesvints/78c2ef78c575a428ff4823f0e4b0afbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CashierSubscriptions implements Subscriptions | |
{ | |
public function startSubscription($billable, $subscription, $plan) | |
{ | |
return $billable->newSubscription($subscription, $plan)->create(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Laravel\Cashier\Subscription; | |
class FakeSubscriptions implements Subscriptions | |
{ | |
public function startSubscription($billable, $subscription, $plan) | |
{ | |
return Subscription::create([ | |
'name' => $subscription, | |
'stripe_id' => '', | |
'stripe_status' => 'active', | |
'stripe_plan' => $plan, | |
]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Subscriptions | |
{ | |
public function startSubscription($billable, $subscription, $plan); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment