Working on tests

This commit is contained in:
Hillel Coren 2018-03-11 08:12:11 +02:00
parent 5477ca84e4
commit 531f3336c5

View File

@ -273,22 +273,23 @@ class BasePaymentDriver
if ($input) { if ($input) {
$this->updateClient(); $this->updateClient();
} }
\Log::info('1');
// load or create token // load or create token
if ($this->isGatewayType(GATEWAY_TYPE_TOKEN)) { if ($this->isGatewayType(GATEWAY_TYPE_TOKEN)) {
\Log::info('2');
if (! $paymentMethod) { if (! $paymentMethod) {
$paymentMethod = PaymentMethod::clientId($this->client()->id) $paymentMethod = PaymentMethod::clientId($this->client()->id)
->wherePublicId($this->sourceId) ->wherePublicId($this->sourceId)
->firstOrFail(); ->firstOrFail();
} }
\Log::info('3');
$invoicRepo = app('App\Ninja\Repositories\InvoiceRepository'); $invoicRepo = app('App\Ninja\Repositories\InvoiceRepository');
$invoicRepo->setGatewayFee($this->invoice(), $paymentMethod->payment_type->gateway_type_id); $invoicRepo->setGatewayFee($this->invoice(), $paymentMethod->payment_type->gateway_type_id);
\Log::info('4');
if (! $this->meetsGatewayTypeLimits($paymentMethod->payment_type->gateway_type_id)) { if (! $this->meetsGatewayTypeLimits($paymentMethod->payment_type->gateway_type_id)) {
// The customer must have hacked the URL // The customer must have hacked the URL
Session::flash('error', trans('texts.limits_not_met')); Session::flash('error', trans('texts.limits_not_met'));
\Log::info('error 1...');
return redirect()->to('view/' . $this->invitation->invitation_key); return redirect()->to('view/' . $this->invitation->invitation_key);
} }
} else { } else {
@ -299,13 +300,12 @@ class BasePaymentDriver
if (! $this->meetsGatewayTypeLimits($this->gatewayType)) { if (! $this->meetsGatewayTypeLimits($this->gatewayType)) {
// The customer must have hacked the URL // The customer must have hacked the URL
Session::flash('error', trans('texts.limits_not_met')); Session::flash('error', trans('texts.limits_not_met'));
\Log::info('error 2...');
return redirect()->to('view/' . $this->invitation->invitation_key); return redirect()->to('view/' . $this->invitation->invitation_key);
} }
} }
\Log::info('capture check...'); \Log::info('5');
if ($this->isTwoStep() || request()->capture) { if ($this->isTwoStep() || request()->capture) {
\Log::info('errro 3...');
return; return;
} }
\Log::info('starting paymnet...'); \Log::info('starting paymnet...');