1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Apply style fixes

This commit is contained in:
Benjamin Beganović 2021-10-25 17:45:25 +02:00
parent 987cb01ca3
commit 90ecdc1074

View File

@ -12,8 +12,6 @@
namespace App\PaymentDrivers;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
use App\Jobs\Util\SystemLogger;
use App\Models\ClientGatewayToken;
use App\Models\GatewayType;
@ -27,7 +25,6 @@ use App\PaymentDrivers\Braintree\CreditCard;
use App\PaymentDrivers\Braintree\PayPal;
use Braintree\Gateway;
use Exception;
use Illuminate\Http\Request;
class BraintreePaymentDriver extends BaseDriver
{
@ -118,8 +115,7 @@ class BraintreePaymentDriver extends BaseDriver
]);
if ($result->success) {
$address = $this->gateway->address()->create([
$address = $this->gateway->address()->create([
'customerId' => $result->customer->id,
'firstName' => $this->client->present()->name,
'streetAddress' => $this->client->address1,
@ -135,12 +131,9 @@ class BraintreePaymentDriver extends BaseDriver
{
$this->init();
try{
try {
$response = $this->gateway->transaction()->refund($payment->transaction_reference, $amount);
} catch (Exception $e) {
$data = [
'transaction_reference' => null,
'transaction_response' => json_encode($e->getMessage()),
@ -154,9 +147,7 @@ class BraintreePaymentDriver extends BaseDriver
return $data;
}
if($response->success)
{
if ($response->success) {
$data = [
'transaction_reference' => $payment->transaction_reference,
'transaction_response' => json_encode($response),
@ -168,10 +159,7 @@ class BraintreePaymentDriver extends BaseDriver
SystemLogger::dispatch(['server_response' => $response, 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_BRAINTREE, $this->client, $this->client->company);
return $data;
}
else{
} else {
$error = $response->errors->deepAll()[0];
$data = [
@ -185,7 +173,6 @@ class BraintreePaymentDriver extends BaseDriver
SystemLogger::dispatch(['server_response' => $response, 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_BRAINTREE, $this->client, $this->client->company);
return $data;
}
}