Conditions | 4 |
Paths | 3 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function listCustomers() |
||
19 | { |
||
20 | $customers = []; |
||
21 | $customersList = $this->gateway->customer()->search([ |
||
22 | |||
23 | ]); |
||
24 | foreach ($customersList as $customer) { |
||
25 | $customer = [ |
||
26 | 'id' => $customer->id, |
||
27 | 'full_name' => $customer->firstName . ' ' . $customer->lastName, |
||
28 | 'email' => $customer->email, |
||
29 | 'available_payment_methods' => count($customer->paymentMethods) |
||
30 | ]; |
||
31 | |||
32 | if ($customer['full_name'] && $customer['email']) { |
||
33 | array_unshift($customers, $customer); |
||
34 | } |
||
35 | } |
||
36 | return $customers; |
||
37 | } |
||
38 | |||
54 |