mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Paytrace sandbox
This commit is contained in:
parent
c9e66b34ec
commit
ed4db8963b
@ -11,18 +11,19 @@
|
|||||||
|
|
||||||
namespace App\PaymentDrivers;
|
namespace App\PaymentDrivers;
|
||||||
|
|
||||||
use App\Exceptions\SystemError;
|
use App\Models\Invoice;
|
||||||
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
|
||||||
use App\Jobs\Util\SystemLogger;
|
|
||||||
use App\Models\ClientGatewayToken;
|
|
||||||
use App\Models\GatewayType;
|
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
|
use App\Utils\CurlUtils;
|
||||||
|
use App\Models\SystemLog;
|
||||||
|
use App\Models\GatewayType;
|
||||||
use App\Models\PaymentHash;
|
use App\Models\PaymentHash;
|
||||||
use App\Models\PaymentType;
|
use App\Models\PaymentType;
|
||||||
use App\Models\SystemLog;
|
use App\Exceptions\SystemError;
|
||||||
use App\PaymentDrivers\PayTrace\CreditCard;
|
use App\Jobs\Util\SystemLogger;
|
||||||
use App\Utils\CurlUtils;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Models\ClientGatewayToken;
|
||||||
|
use App\PaymentDrivers\PayTrace\CreditCard;
|
||||||
|
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
||||||
|
|
||||||
class PaytracePaymentDriver extends BaseDriver
|
class PaytracePaymentDriver extends BaseDriver
|
||||||
{
|
{
|
||||||
@ -125,14 +126,26 @@ class PaytracePaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||||
|
|
||||||
|
$_invoice = collect($payment_hash->data->invoices)->first();
|
||||||
|
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
||||||
|
|
||||||
|
if ($invoice) {
|
||||||
|
$invoice_id = ctrans('texts.invoice_number').'# '.$invoice->number;
|
||||||
|
}
|
||||||
|
|
||||||
|
$invoice_id = ctrans('texts.invoice_number').'# '.substr($payment_hash->hash, 0, 6);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'customer_id' => $cgt->token,
|
'customer_id' => $cgt->token,
|
||||||
'integrator_id' => $this->company_gateway->getConfigField('integratorId'),
|
'integrator_id' => $this->company_gateway->getConfigField('integratorId'),
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
|
'invoice_id' => $invoice_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data);
|
$response = $this->gatewayRequest('/v1/transactions/sale/by_customer', $data);
|
||||||
|
|
||||||
|
nlog($response);
|
||||||
|
|
||||||
if ($response && $response->success) {
|
if ($response && $response->success) {
|
||||||
$data = [
|
$data = [
|
||||||
'gateway_type_id' => $cgt->gateway_type_id,
|
'gateway_type_id' => $cgt->gateway_type_id,
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('gateway_footer')
|
@section('gateway_footer')
|
||||||
<script src="https://protect.paytrace.com/js/protect.min.js"></script>
|
@if($gateway->company_gateway->getConfigField('testMode'))
|
||||||
|
<script src='https://protect.sandbox.paytrace.com/js/protect.min.js'></script>
|
||||||
|
@else
|
||||||
|
<script src='https://protect.paytrace.com/js/protect.min.js'></script>
|
||||||
|
@endif
|
||||||
<script src="{{ asset('js/clients/payments/paytrace-credit-card.js') }}"></script>
|
<script src="{{ asset('js/clients/payments/paytrace-credit-card.js') }}"></script>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -59,6 +59,10 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('gateway_footer')
|
@section('gateway_footer')
|
||||||
|
@if($gateway->company_gateway->getConfigField('testMode'))
|
||||||
|
<script src='https://protect.sandbox.paytrace.com/js/protect.min.js'></script>
|
||||||
|
@else
|
||||||
<script src='https://protect.paytrace.com/js/protect.min.js'></script>
|
<script src='https://protect.paytrace.com/js/protect.min.js'></script>
|
||||||
|
@endif
|
||||||
<script src="{{ asset('js/clients/payments/paytrace-credit-card.js') }}"></script>
|
<script src="{{ asset('js/clients/payments/paytrace-credit-card.js') }}"></script>
|
||||||
@endsection
|
@endsection
|
||||||
|
Loading…
Reference in New Issue
Block a user