mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Apply style fixes
This commit is contained in:
parent
987cb01ca3
commit
90ecdc1074
@ -12,8 +12,6 @@
|
|||||||
|
|
||||||
namespace App\PaymentDrivers;
|
namespace App\PaymentDrivers;
|
||||||
|
|
||||||
|
|
||||||
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
|
||||||
use App\Jobs\Util\SystemLogger;
|
use App\Jobs\Util\SystemLogger;
|
||||||
use App\Models\ClientGatewayToken;
|
use App\Models\ClientGatewayToken;
|
||||||
use App\Models\GatewayType;
|
use App\Models\GatewayType;
|
||||||
@ -27,7 +25,6 @@ use App\PaymentDrivers\Braintree\CreditCard;
|
|||||||
use App\PaymentDrivers\Braintree\PayPal;
|
use App\PaymentDrivers\Braintree\PayPal;
|
||||||
use Braintree\Gateway;
|
use Braintree\Gateway;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class BraintreePaymentDriver extends BaseDriver
|
class BraintreePaymentDriver extends BaseDriver
|
||||||
{
|
{
|
||||||
@ -118,8 +115,7 @@ class BraintreePaymentDriver extends BaseDriver
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if ($result->success) {
|
if ($result->success) {
|
||||||
|
$address = $this->gateway->address()->create([
|
||||||
$address = $this->gateway->address()->create([
|
|
||||||
'customerId' => $result->customer->id,
|
'customerId' => $result->customer->id,
|
||||||
'firstName' => $this->client->present()->name,
|
'firstName' => $this->client->present()->name,
|
||||||
'streetAddress' => $this->client->address1,
|
'streetAddress' => $this->client->address1,
|
||||||
@ -135,12 +131,9 @@ class BraintreePaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
try{
|
try {
|
||||||
|
|
||||||
$response = $this->gateway->transaction()->refund($payment->transaction_reference, $amount);
|
$response = $this->gateway->transaction()->refund($payment->transaction_reference, $amount);
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'transaction_reference' => null,
|
'transaction_reference' => null,
|
||||||
'transaction_response' => json_encode($e->getMessage()),
|
'transaction_response' => json_encode($e->getMessage()),
|
||||||
@ -154,9 +147,7 @@ class BraintreePaymentDriver extends BaseDriver
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($response->success)
|
if ($response->success) {
|
||||||
{
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'transaction_reference' => $payment->transaction_reference,
|
'transaction_reference' => $payment->transaction_reference,
|
||||||
'transaction_response' => json_encode($response),
|
'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);
|
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;
|
return $data;
|
||||||
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
|
|
||||||
$error = $response->errors->deepAll()[0];
|
$error = $response->errors->deepAll()[0];
|
||||||
|
|
||||||
$data = [
|
$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);
|
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;
|
return $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user