Catch when braintree does not create the customer

This commit is contained in:
David Bomba 2022-08-12 11:02:16 +10:00
parent e4017cdf39
commit 45df81ceab

View File

@ -126,6 +126,17 @@ class BraintreePaymentDriver extends BaseDriver
return $result->customer;
}
//12-08-2022 catch when the customer is not created.
$data = [
'transaction_reference' => null,
'transaction_response' => $result,
'success' => false,
'description' => 'Could not create customer',
'code' => 500,
];
SystemLogger::dispatch(['server_response' => $result, 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_BRAINTREE, $this->client, $this->client->company);
}
public function refund(Payment $payment, $amount, $return_client_response = false)