@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $paymentIntent = $event->data->object; |
64 | 64 | // ... handle other event types |
65 | 65 | default: |
66 | - echo 'Received unknown event type ' . $event->type; |
|
66 | + echo 'Received unknown event type '.$event->type; |
|
67 | 67 | } |
68 | 68 | $pi = $paymentIntent->id; |
69 | 69 | $request = $this->confirmByPaymentIntent($pi); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | if (isset($response->getData()['error']['message']) || isset($response->getData()['last_payment_error']['message'])) { |
114 | 114 | $message = $response->getData()['error']['message'] ?? $response->getData()['last_payment_error']['message']; |
115 | - throw new MeaningfulForUserMerchantException("Failed to charge card:\n" . $message); |
|
115 | + throw new MeaningfulForUserMerchantException("Failed to charge card:\n".$message); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | throw new MerchantException('Failed to charge card'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | throw new MerchantException('Response is not successful'); |
93 | 93 | } |
94 | 94 | } catch (Exception $exception) { |
95 | - throw new MerchantException('Failed to refund a card: ' . $exception->getMessage(), $exception->getCode(), $exception); |
|
95 | + throw new MerchantException('Failed to refund a card: '.$exception->getMessage(), $exception->getCode(), $exception); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | throw new MerchantException($response->getData()['message']); |
109 | 109 | } |
110 | 110 | } catch (Exception $exception) { |
111 | - throw new MerchantException('Failed to remove a card: ' . $exception->getMessage(), $exception->getCode(), $exception); |
|
111 | + throw new MerchantException('Failed to remove a card: '.$exception->getMessage(), $exception->getCode(), $exception); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'confirm' => true, |
128 | 128 | ], $ignore3dSecure))->send(); |
129 | 129 | } catch (Exception $exception) { |
130 | - throw new MerchantException('Failed to charge a card: ' . $exception->getMessage(), $exception->getCode(), $exception); |
|
130 | + throw new MerchantException('Failed to charge a card: '.$exception->getMessage(), $exception->getCode(), $exception); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if ($response->isRedirect()) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | 'capture_method' => 'manual', |
287 | 287 | ], $ignore3dSecure))->send(); |
288 | 288 | } catch (Exception $exception) { |
289 | - throw new MerchantException('Failed to authorize a payment card: ' . $exception->getMessage(), |
|
289 | + throw new MerchantException('Failed to authorize a payment card: '.$exception->getMessage(), |
|
290 | 290 | $exception->getCode(), |
291 | 291 | $exception); |
292 | 292 | } |
@@ -330,10 +330,10 @@ discard block |
||
330 | 330 | ])->send(); |
331 | 331 | |
332 | 332 | if (!$response->isCancelled()) { |
333 | - throw new MerchantException('Payment has not been canceled, actual status: ' . $response->getStatus()); |
|
333 | + throw new MerchantException('Payment has not been canceled, actual status: '.$response->getStatus()); |
|
334 | 334 | } |
335 | 335 | } catch (Exception $exception) { |
336 | - throw new MerchantException('Failed to cancel a card authorization: ' . $exception->getMessage(), |
|
336 | + throw new MerchantException('Failed to cancel a card authorization: '.$exception->getMessage(), |
|
337 | 337 | $exception->getCode(), |
338 | 338 | $exception); |
339 | 339 | } |