Merge pull request #6899 from beganovich/sentry-11793

Fix for accesing `response_summary` on payment object
This commit is contained in:
David Bomba 2021-10-26 07:55:30 +11:00 committed by GitHub
commit 5b1cd55745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -84,8 +84,7 @@ trait Utilities
public function processUnsuccessfulPayment(Payment $_payment, $throw_exception = true)
{
$this->getParent()->sendFailureMail($_payment->status . " " . $_payment->response_summary);
$this->getParent()->sendFailureMail($_payment->status . " " . optional($_payment)->response_summary);
$message = [
'server_response' => $_payment,
@ -102,7 +101,7 @@ trait Utilities
);
if ($throw_exception) {
throw new PaymentFailed($_payment->status . " " . $_payment->response_summary, $_payment->http_code);
throw new PaymentFailed($_payment->status . " " . optional($_payment)->response_summary, $_payment->http_code);
}
}

View File

@ -338,7 +338,9 @@ class CheckoutComPaymentDriver extends BaseDriver
$this->setPaymentHash($request->getPaymentHash());
try {
$payment = $this->gateway->payments()->details($request->query('cko-session-id'));
$payment = $this->gateway->payments()->details(
$request->query('cko-session-id')
);
if ($payment->approved) {
return $this->processSuccessfulPayment($payment);