mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 19:34:33 -04:00
Add base classes
This commit is contained in:
parent
8fef356ece
commit
e2bc018c97
@ -149,6 +149,7 @@ class Gateway extends StaticModel
|
|||||||
GatewayType::EPS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
GatewayType::EPS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
GatewayType::BANCONTACT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
GatewayType::BANCONTACT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
GatewayType::BECS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
GatewayType::BECS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
|
GatewayType::BACS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
GatewayType::IDEAL => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
GatewayType::IDEAL => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
GatewayType::ACSS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
GatewayType::ACSS => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded', 'payment_intent.succeeded']],
|
||||||
GatewayType::FPX => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']],
|
GatewayType::FPX => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']],
|
||||||
|
@ -61,6 +61,8 @@ class GatewayType extends StaticModel
|
|||||||
|
|
||||||
const KLARNA = 23;
|
const KLARNA = 23;
|
||||||
|
|
||||||
|
const BACS = 24;
|
||||||
|
|
||||||
public function gateway()
|
public function gateway()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Gateway::class);
|
return $this->belongsTo(Gateway::class);
|
||||||
@ -108,6 +110,8 @@ class GatewayType extends StaticModel
|
|||||||
return ctrans('texts.eps');
|
return ctrans('texts.eps');
|
||||||
case self::BECS:
|
case self::BECS:
|
||||||
return ctrans('texts.becs');
|
return ctrans('texts.becs');
|
||||||
|
case self::BACS:
|
||||||
|
return ctrans('texts.bacs');
|
||||||
case self::ACSS:
|
case self::ACSS:
|
||||||
return ctrans('texts.acss');
|
return ctrans('texts.acss');
|
||||||
case self::DIRECT_DEBIT:
|
case self::DIRECT_DEBIT:
|
||||||
|
@ -57,6 +57,7 @@ class PaymentType extends StaticModel
|
|||||||
const FPX = 46;
|
const FPX = 46;
|
||||||
const KLARNA = 47;
|
const KLARNA = 47;
|
||||||
const Interac_E_Transfer = 48;
|
const Interac_E_Transfer = 48;
|
||||||
|
const BACS = 49;
|
||||||
|
|
||||||
public static function parseCardType($cardName)
|
public static function parseCardType($cardName)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +239,13 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
&& in_array($this->client->country->iso_3166_3, ['CAN', 'USA'])) {
|
&& in_array($this->client->country->iso_3166_3, ['CAN', 'USA'])) {
|
||||||
$types[] = GatewayType::ACSS;
|
$types[] = GatewayType::ACSS;
|
||||||
}
|
}
|
||||||
|
if ($this->client
|
||||||
|
&& $this->client->currency()
|
||||||
|
&& in_array($this->client->currency()->code, ['GDB'])
|
||||||
|
&& isset($this->client->country)
|
||||||
|
&& in_array($this->client->country->iso_3166_3, ['GBR'])) {
|
||||||
|
$types[] = GatewayType::BACS;
|
||||||
|
}
|
||||||
if ($this->client
|
if ($this->client
|
||||||
&& $this->client->currency()
|
&& $this->client->currency()
|
||||||
&& in_array($this->client->currency()->code, ['EUR', 'DKK', 'GBP', 'NOK', 'SEK', 'AUD', 'NZD', 'CAD', 'PLN', 'CHF'])
|
&& in_array($this->client->currency()->code, ['EUR', 'DKK', 'GBP', 'NOK', 'SEK', 'AUD', 'NZD', 'CAD', 'PLN', 'CHF'])
|
||||||
@ -302,6 +309,8 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
return 'gateways.stripe.bancontact';
|
return 'gateways.stripe.bancontact';
|
||||||
case GatewayType::BECS:
|
case GatewayType::BECS:
|
||||||
return 'gateways.stripe.becs';
|
return 'gateways.stripe.becs';
|
||||||
|
case GatewayType::BACS:
|
||||||
|
return 'gateways.stripe.bacs';
|
||||||
case GatewayType::ACSS:
|
case GatewayType::ACSS:
|
||||||
return 'gateways.stripe.acss';
|
return 'gateways.stripe.acss';
|
||||||
case GatewayType::FPX:
|
case GatewayType::FPX:
|
||||||
|
39
database/migrations/2022_16_12_54687_add_stripe_bacs.php
Normal file
39
database/migrations/2022_16_12_54687_add_stripe_bacs.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\GatewayType;
|
||||||
|
use App\Models\PaymentType;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$pt = PaymentType::find(49);
|
||||||
|
|
||||||
|
if(!$pt)
|
||||||
|
{
|
||||||
|
$type = new PaymentType();
|
||||||
|
$type->id = 49;
|
||||||
|
$type->name = 'BACS';
|
||||||
|
$type->gateway_type_id = GatewayType::BACS;
|
||||||
|
$type->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
$gt = GatewayType::find(24);
|
||||||
|
|
||||||
|
if(!$gt)
|
||||||
|
{
|
||||||
|
$type = new GatewayType();
|
||||||
|
$type->id = 24;
|
||||||
|
$type->alias = 'bacs';
|
||||||
|
$type->name = 'BACS';
|
||||||
|
$type->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user