| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function run($email, $description = '') |
||
| 38 | { |
||
| 39 | try { |
||
| 40 | |||
| 41 | $response = $this->stripe->customers()->create([ |
||
| 42 | 'email' => $email, |
||
| 43 | 'description' => $description, |
||
| 44 | ]); |
||
| 45 | |||
| 46 | } catch (Exception $e) { |
||
| 47 | throw (new StripeApiErrorException('Stripe API error (createCustomer)'))->debug($e->getMessage(), true); |
||
| 48 | } |
||
| 49 | |||
| 50 | if ($response['status'] != 'succeeded') { |
||
| 51 | throw new StripeApiErrorException('Stripe response status not succeeded (createCustomer)'); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $response; |
||
| 55 | } |
||
| 56 | |||
| 58 |