mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 06:44:37 -04:00
add padding to tables
This commit is contained in:
parent
e21d425093
commit
bbe5049a2d
@ -22,6 +22,20 @@ use Omnipay\Omnipay;
|
|||||||
/**
|
/**
|
||||||
* Class BasePaymentDriver
|
* Class BasePaymentDriver
|
||||||
* @package App\PaymentDrivers
|
* @package App\PaymentDrivers
|
||||||
|
*
|
||||||
|
* Minimum dataset required for payment gateways
|
||||||
|
*
|
||||||
|
* $data = [
|
||||||
|
'amount' => $invoice->getRequestedAmount(),
|
||||||
|
'currency' => $invoice->getCurrencyCode(),
|
||||||
|
'returnUrl' => $completeUrl,
|
||||||
|
'cancelUrl' => $this->invitation->getLink(),
|
||||||
|
'description' => trans('texts.' . $invoice->getEntityType()) . " {$invoice->invoice_number}",
|
||||||
|
'transactionId' => $invoice->invoice_number,
|
||||||
|
'transactionType' => 'Purchase',
|
||||||
|
'clientIp' => Request::getClientIp(),
|
||||||
|
];
|
||||||
|
|
||||||
*/
|
*/
|
||||||
class BasePaymentDriver
|
class BasePaymentDriver
|
||||||
{
|
{
|
||||||
@ -146,6 +160,32 @@ class BasePaymentDriver
|
|||||||
acceptNotification() - convert an incoming request from an off-site gateway to a generic notification object for further processing
|
acceptNotification() - convert an incoming request from an off-site gateway to a generic notification object for further processing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
protected function paymentDetails($paymentMethod = false)
|
||||||
|
{
|
||||||
|
$gatewayTypeAlias = $this->gatewayType == GatewayType::TOKEN ? $this->gatewayType : GatewayType::getAliasFromId($this->gatewayType);
|
||||||
|
$completeUrl = $this->invitation->getLink('complete', true) . '/' . $gatewayTypeAlias;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'currency' => $this->client->getCurrencyCode(),
|
||||||
|
'transactionId' => $invoice->invoice_number,
|
||||||
|
'transactionType' => 'Purchase',
|
||||||
|
'clientIp' => request()->getClientIp(),
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($paymentMethod) {
|
||||||
|
if ($this->customerReferenceParam) {
|
||||||
|
$data[$this->customerReferenceParam] = $paymentMethod->account_gateway_token->token;
|
||||||
|
}
|
||||||
|
$data[$this->sourceReferenceParam] = $paymentMethod->source_reference;
|
||||||
|
} elseif ($this->input) {
|
||||||
|
$data['card'] = new CreditCard($this->paymentDetailsFromInput($this->input));
|
||||||
|
} else {
|
||||||
|
$data['card'] = new CreditCard($this->paymentDetailsFromClient());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
public function purchase($data, $items)
|
public function purchase($data, $items)
|
||||||
{
|
{
|
||||||
$response = $this->gateway
|
$response = $this->gateway
|
||||||
|
60
app/PaymentDrivers/PayPalExpressPaymentDriver.php
Normal file
60
app/PaymentDrivers/PayPalExpressPaymentDriver.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\PaymentDrivers;
|
||||||
|
|
||||||
|
use App\Models\ClientGatewayToken;
|
||||||
|
use App\Models\GatewayType;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PayPalExpressPaymentDriver extends BasePaymentDriver
|
||||||
|
{
|
||||||
|
|
||||||
|
use MakesHash;
|
||||||
|
|
||||||
|
protected $refundable = false;
|
||||||
|
|
||||||
|
protected $token_billing = false;
|
||||||
|
|
||||||
|
protected $can_authorise_credit_card = false;
|
||||||
|
|
||||||
|
protected $customer_reference = '';
|
||||||
|
|
||||||
|
|
||||||
|
public function gatewayTypes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
GatewayType::PAYPAL,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function processPaymentView(array $data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function processPaymentResponse($request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function paymentDetails($paymentMethod = false)
|
||||||
|
{
|
||||||
|
$data = parent::paymentDetails();
|
||||||
|
|
||||||
|
$data['ButtonSource'] = 'InvoiceNinja_SP';
|
||||||
|
$data['solutionType'] = 'Sole'; // show 'Pay with credit card' option
|
||||||
|
$data['transactionId'] = $data['transactionId'] . '-' . time();
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
@ -373,6 +373,7 @@ class StripePaymentDriver extends BasePaymentDriver
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
//mark all invitations with transaction reference
|
//mark all invitations with transaction reference
|
||||||
|
//TODO move this to to be called from an event... doesn't belong here
|
||||||
$invoices->each(function ($invoice) use($payment) {
|
$invoices->each(function ($invoice) use($payment) {
|
||||||
|
|
||||||
$invoice->status_id = Payment::STATUS_COMPLETED;
|
$invoice->status_id = Payment::STATUS_COMPLETED;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"laravel/tinker": "^1.0",
|
"laravel/tinker": "^1.0",
|
||||||
"laravelcollective/html": "5.8.*",
|
"laravelcollective/html": "5.8.*",
|
||||||
"league/fractal": "^0.17.0",
|
"league/fractal": "^0.17.0",
|
||||||
"league/omnipay": "^3",
|
"league/omnipay": "^3.0",
|
||||||
"nwidart/laravel-modules": "^4.0",
|
"nwidart/laravel-modules": "^4.0",
|
||||||
"omnipay/paypal": "^3.0",
|
"omnipay/paypal": "^3.0",
|
||||||
"omnipay/stripe": "^3.0",
|
"omnipay/stripe": "^3.0",
|
||||||
|
@ -51,18 +51,18 @@
|
|||||||
<input id="table_filter" type="text" style="width:180px;background-color: white !important"
|
<input id="table_filter" type="text" style="width:180px;background-color: white !important"
|
||||||
class="form-control pull-left" placeholder="{{ trans('texts.filter')}}" value=""/>
|
class="form-control pull-left" placeholder="{{ trans('texts.filter')}}" value=""/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="animated fadeIn">
|
|
||||||
<div class="col-md-12 card">
|
|
||||||
|
|
||||||
{!! $html->table(['class' => 'table table-hover table-striped', 'id' => 'datatable'], true) !!}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="animated fadeIn col-lg-12 card mt-10">
|
||||||
|
|
||||||
|
{!! $html->table(['class' => 'table table-hover table-striped', 'id' => 'datatable'], true) !!}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
@ -28,18 +28,17 @@
|
|||||||
<div id="top_right_buttons" class="pull-right">
|
<div id="top_right_buttons" class="pull-right">
|
||||||
<a href="{{ route('client.payment_methods.create')}}" class="btn btn-success">{{ ctrans('texts.add_payment_method') }}</a>
|
<a href="{{ route('client.payment_methods.create')}}" class="btn btn-success">{{ ctrans('texts.add_payment_method') }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="animated fadeIn">
|
|
||||||
<div class="col-md-12 card">
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="animated fadeIn col-lg-12 card mt-10">
|
||||||
{!! $html->table(['class' => 'table table-hover table-striped', 'id' => 'datatable'], true) !!}
|
{!! $html->table(['class' => 'table table-hover table-striped', 'id' => 'datatable'], true) !!}
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user