|
@@ -183,7 +183,7 @@ class Afterpay extends Payment
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function capture($token)
|
|
|
|
|
|
|
+ public function capture($token, $methodType = 'Afterpay')
|
|
|
{
|
|
{
|
|
|
$client = new Client();
|
|
$client = new Client();
|
|
|
$response = $client->request('POST', $this->capturePaymentUlr, [
|
|
$response = $client->request('POST', $this->capturePaymentUlr, [
|
|
@@ -197,7 +197,7 @@ class Afterpay extends Payment
|
|
|
'verify' => false
|
|
'verify' => false
|
|
|
]);
|
|
]);
|
|
|
$responseBody = $response->getBody()->getContents();
|
|
$responseBody = $response->getBody()->getContents();
|
|
|
- Log::channel('payment')->info('Afterpay capture response', [
|
|
|
|
|
|
|
+ Log::channel('payment')->info("{$methodType} capture response", [
|
|
|
'token' => $token,
|
|
'token' => $token,
|
|
|
'status' => $response->getStatusCode(),
|
|
'status' => $response->getStatusCode(),
|
|
|
'body' => $responseBody,
|
|
'body' => $responseBody,
|
|
@@ -207,7 +207,7 @@ class Afterpay extends Payment
|
|
|
if ($resultObject->status == 'APPROVED') {
|
|
if ($resultObject->status == 'APPROVED') {
|
|
|
return ['transaction_id' => $resultObject->token, 'amount' => $resultObject->events[0]->amount->amount];
|
|
return ['transaction_id' => $resultObject->token, 'amount' => $resultObject->events[0]->amount->amount];
|
|
|
} else {
|
|
} else {
|
|
|
- throw new \Exception('afterpay capture is error');
|
|
|
|
|
|
|
+ throw new \Exception("{$methodType} capture is error");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|