Conditions | 2 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
52 | public function createOrder(string $body, array $headers = []): object|null |
||
53 | { |
||
54 | try { |
||
55 | $request = new OrdersCreateRequest(); |
||
56 | $request->body = $body; |
||
57 | $request->headers = array_merge($request->headers, $headers); |
||
58 | $client = $this->getHttpClient(); |
||
59 | $response = $client->execute($request); |
||
60 | } catch (Exception $e) { |
||
61 | $this->logger->error('Error on PayPal::createOrder = ' . $e->getMessage()); |
||
62 | return null; |
||
63 | } |
||
64 | |||
65 | return $response->result; |
||
66 | } |
||
68 |