Last active
February 28, 2019 19:35
-
-
Save Brotzka/d330368b1d03579ce92f13ba4e0175b4 to your computer and use it in GitHub Desktop.
FAAREN Subscription error
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
Stripe::setApiKey(config('services.stripe.secret')); | |
$subscription = $this->getSubscription(); // This is the subscription from our database | |
$customer = Customer::retrieve($subscription->consumer->stripe_id); | |
//dd($customer); | |
$plan = Plan::create([ | |
'amount' => $subscription->price * 100, | |
'interval' => 'month', | |
'product' => $subscription->vehicle->stripe_id, | |
'currency' => 'eur', | |
'billing_scheme' => 'per_unit' | |
]); | |
$stripeSubscription = \Stripe\Subscription::create([ | |
//'customer' => $subscription->consumer->stripe_id, | |
'customer' => $customer, | |
'application_fee_percent' => ($subscription->bookedMonth->faaren_surcharge - 1) * 100, | |
'billing' => 'charge_automatically', | |
'tax_percent' => 0, | |
'items' => [ | |
['plan' => $plan->id] | |
] | |
], ["stripe_account" => $subscription->producer->stripe_id]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment