Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \Stripe\Stripe::setApiKey($this->config->stripe['sk']);
- if($company->getStripeId() == null) {
- $customer = \Stripe\Customer::create([
- "email" => $company->getEmail(),
- "description" => $company->getName(),
- "tax_info"=> ["tax_id" => $company->getVat(), "type" => "vat"]
- ]);
- $company->setStripeId($customer->id);
- $companyMapper->edit($company);
- }
- $session = \Stripe\Checkout\Session::create([
- 'success_url' => HTTP_PATH.'company/edit?stripe=success',
- 'cancel_url' => HTTP_PATH.'company/edit?stripe=cancel',
- 'payment_method_types' => ['card'],
- 'client_reference_id' => $uniqid,
- 'customer' => $company->getStripeId(),
- 'locale' => 'fr',
- 'line_items' => $items
- ], [
- 'stripe_version' => '2018-11-08; checkout_sessions_beta=v1'
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement