swap stripe subscription

This commit is contained in:
Čarodej
2022-03-04 18:51:06 +01:00
parent ad5b741feb
commit ae138bb4d4
4 changed files with 5 additions and 6 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -130,11 +130,9 @@ export default {
}, },
payByStripe() { payByStripe() {
axios axios
.post('/api/stripe/checkout', { .post(`/api/subscriptions/swap/${this.selectedPlan.data.id}`)
planCode: this.selectedPlan.data.meta.driver_plan_id.stripe,
})
.then((response) => { .then((response) => {
window.location = response.data.url console.log(response);
}) })
}, },
payByPaystack() { payByPaystack() {
@@ -26,6 +26,7 @@ class SubscriptionEventSubscriber
public function handleSubscriptionWasExpired($event) public function handleSubscriptionWasExpired($event)
{ {
// TODO: set default team members
$event->subscription->user->limitations()->update([ $event->subscription->user->limitations()->update([
'max_storage_amount' => get_settings('default_max_storage_amount') ?? 5, 'max_storage_amount' => get_settings('default_max_storage_amount') ?? 5,
'max_team_members' => 5, 'max_team_members' => 5,