1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Support using GoCardless with other gateways #1373

This commit is contained in:
Hillel Coren 2017-10-18 19:57:57 +03:00
parent aadd2d3c68
commit ddee84ae96
8 changed files with 10 additions and 2 deletions

View File

@ -422,6 +422,7 @@ if (! defined('APP_NAME')) {
define('GATEWAY_TYPE_ALIPAY', 7);
define('GATEWAY_TYPE_SOFORT', 8);
define('GATEWAY_TYPE_SEPA', 9);
define('GATEWAY_TYPE_GOCARDLESS', 10);
define('GATEWAY_TYPE_TOKEN', 'token');
define('TEMPLATE_INVOICE', 'invoice');

View File

@ -810,7 +810,7 @@ class Account extends Eloquent
$available = true;
foreach ($gatewayTypes as $type) {
if ($paymentDriver->handles($type)) {
if ($type != GATEWAY_TYPE_TOKEN && $paymentDriver->handles($type)) {
$available = false;
break;
}

View File

@ -32,6 +32,7 @@ class Gateway extends Eloquent
GATEWAY_TYPE_BITCOIN,
GATEWAY_TYPE_DWOLLA,
GATEWAY_TYPE_TOKEN,
GATEWAY_TYPE_GOCARDLESS,
];
// these will appear in the primary gateway select
@ -58,6 +59,7 @@ class Gateway extends Eloquent
*/
public static $alternate = [
GATEWAY_PAYPAL_EXPRESS,
GATEWAY_GOCARDLESS,
GATEWAY_BITPAY,
GATEWAY_DWOLLA,
GATEWAY_CUSTOM,

View File

@ -12,7 +12,7 @@ class GoCardlessV2RedirectPaymentDriver extends BasePaymentDriver
public function gatewayTypes()
{
$types = [
GATEWAY_TYPE_BANK_TRANSFER,
GATEWAY_TYPE_GOCARDLESS,
GATEWAY_TYPE_TOKEN,
];

View File

@ -18,6 +18,7 @@ class GatewayTypesSeeder extends Seeder
['alias' => 'alipay', 'name' => 'Alipay'],
['alias' => 'sofort', 'name' => 'Sofort'],
['alias' => 'sepa', 'name' => 'SEPA'],
['alias' => 'gocardless', 'name' => 'GoCardless'],
];
foreach ($gateway_types as $gateway_type) {

View File

@ -39,6 +39,7 @@ class PaymentTypesSeeder extends Seeder
['name' => 'Alipay', 'gateway_type_id' => GATEWAY_TYPE_ALIPAY],
['name' => 'Sofort', 'gateway_type_id' => GATEWAY_TYPE_SOFORT],
['name' => 'SEPA', 'gateway_type_id' => GATEWAY_TYPE_SEPA],
['name' => 'GoCardless', 'gateway_type_id' => GATEWAY_TYPE_GOCARDLESS],
];
foreach ($paymentTypes as $paymentType) {

View File

@ -506,6 +506,7 @@ $LANG = array(
'payment_type_credit_card' => 'Credit Card',
'payment_type_paypal' => 'PayPal',
'payment_type_bitcoin' => 'Bitcoin',
'payment_type_gocardless' => 'GoCardless',
'knowledge_base' => 'Knowledge Base',
'partial' => 'Partial/Deposit',
'partial_remaining' => ':partial of :balance',
@ -1369,6 +1370,7 @@ $LANG = array(
'use_bank_on_file' => 'Use Bank on File',
'auto_bill_email_message' => 'This invoice will automatically be billed to the payment method on file on the due date.',
'bitcoin' => 'Bitcoin',
'gocardless' => 'GoCardless',
'added_on' => 'Added :date',
'failed_remove_payment_method' => 'Failed to remove the payment method',
'gateway_exists' => 'This gateway already exists',

View File

@ -50,4 +50,5 @@
{!! Former::populateField(GATEWAY_GOCARDLESS . '_accessToken', env('GOCARDLESS_TEST_TOKEN')) !!}
{!! Former::populateField(GATEWAY_GOCARDLESS . '_webhookSecret', env('GOCARDLESS_TEST_WEBHOOK_SECRET')) !!}
{!! Former::populateField(GATEWAY_GOCARDLESS . '_testMode', 1) !!}