2020-06-16 02:21:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\PaymentDrivers\Authorize;
|
|
|
|
|
2020-06-16 02:31:05 +02:00
|
|
|
use App\Models\ClientGatewayToken;
|
2020-06-16 02:21:40 +02:00
|
|
|
use App\PaymentDrivers\AuthorizePaymentDriver;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class BaseDriver
|
|
|
|
* @package App\PaymentDrivers
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class AuthorizeCreditCard
|
|
|
|
{
|
|
|
|
public $authorize;
|
|
|
|
|
|
|
|
public function __construct(AuthorizePaymentDriver $authorize)
|
|
|
|
{
|
|
|
|
$this->authorize = $authorize;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processPaymentView($data)
|
|
|
|
{
|
2020-06-16 02:31:05 +02:00
|
|
|
$tokens = ClientGatewayToken::where('client_id', $this->authorize->client->id)
|
|
|
|
->where('company_gateway_key', $this->authorize->company_gateway->gateway_key)
|
|
|
|
->where('gateway_type_id', $this->authorize->payment_method_id)
|
|
|
|
->get();
|
|
|
|
|
|
|
|
$data['tokens'] = $tokens;
|
|
|
|
$data['gateway'] = $this->authorize->company_gateway;
|
|
|
|
|
|
|
|
return render('portal.ninja202.gateways.authorize.credit_card_payment', $data);
|
2020-06-16 02:21:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|