Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. \Stripe\Stripe::setApiKey($this->config->stripe['sk']);
  2.  
  3. if($company->getStripeId() == null) {
  4.     $customer = \Stripe\Customer::create([
  5.         "email" => $company->getEmail(),
  6.         "description" => $company->getName(),
  7.         "tax_info"=> ["tax_id" => $company->getVat(), "type" => "vat"]
  8.     ]);
  9.  
  10.     $company->setStripeId($customer->id);
  11.     $companyMapper->edit($company);
  12. }
  13.  
  14. $session = \Stripe\Checkout\Session::create([
  15.     'success_url' => HTTP_PATH.'company/edit?stripe=success',
  16.     'cancel_url' => HTTP_PATH.'company/edit?stripe=cancel',
  17.     'payment_method_types' => ['card'],
  18.     'client_reference_id' => $uniqid,
  19.     'customer' => $company->getStripeId(),
  20.     'locale' => 'fr',
  21.     'line_items' => $items
  22.     ], [
  23.     'stripe_version' => '2018-11-08; checkout_sessions_beta=v1'
  24.     ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement