1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Added moolah as recommended payment gateway

This commit is contained in:
Hillel Coren 2014-10-05 16:07:04 +03:00
parent a4e949daec
commit e7184ab59d
5 changed files with 58 additions and 37 deletions

View File

@ -174,6 +174,9 @@ class AccountController extends \BaseController {
{
$configFields->$configField = str_repeat('*', strlen($value));
}
} else {
$accountGateway = AccountGateway::createNew();
$accountGateway->gateway_id = GATEWAY_MOOLAH;
}
$recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE)
@ -211,22 +214,9 @@ class AccountController extends \BaseController {
);
$recommendedGatewayArray['Other Options'] = $otherItem;
$data = [
'account' => $account,
'accountGateway' => $accountGateway,
'config' => $configFields,
'gateways' => Gateway::remember(DEFAULT_QUERY_CACHE)
->orderBy('name')
->get(),
'dropdownGateways' => Gateway::remember(DEFAULT_QUERY_CACHE)
->where('recommended', '=', '0')
->orderBy('name')
->get(),
'recommendedGateways' => $recommendedGatewayArray,
'creditCardTypes' => $creditCards,
];
$gateways = Gateway::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get();
foreach ($data['gateways'] as $gateway)
foreach ($gateways as $gateway)
{
$paymentLibrary = $gateway->paymentlibrary;
@ -238,6 +228,19 @@ class AccountController extends \BaseController {
}
}
$data = [
'account' => $account,
'accountGateway' => $accountGateway,
'config' => $configFields,
'gateways' => $gateways,
'dropdownGateways' => Gateway::remember(DEFAULT_QUERY_CACHE)
->where('recommended', '=', '0')
->orderBy('name')
->get(),
'recommendedGateways' => $recommendedGatewayArray,
'creditCardTypes' => $creditCards,
];
return View::make('accounts.payments', $data);
}
else if ($section == ACCOUNT_NOTIFICATIONS)

View File

@ -12,6 +12,20 @@ class PaymentLibrariesSeeder extends Seeder
array('name'=>'Psigate', 'provider'=>'Psigate', 'payment_library_id' => 2)
];
foreach ($gateways as $gateway)
{
Gateway::create($gateway);
}
Gateway::create([
'name' => 'moolah',
'provider' => 'AuthorizeNet_AIM',
'sort_order' => 1,
'recommended' => 1,
'site_url' => 'https://invoiceninja.mymoolah.com/',
]);
/*
$updateProviders = array(
0 => 'AuthorizeNet_AIM',
//1 => 'BeanStream',
@ -21,11 +35,6 @@ class PaymentLibrariesSeeder extends Seeder
5 => 'TwoCheckout'
);
foreach ($gateways as $gateway)
{
Gateway::create($gateway);
}
Gateway::whereIn('provider', $updateProviders)->update(array('recommended' => 1));
Gateway::where('provider', '=', 'AuthorizeNet_AIM')->update(array('sort_order' => 5, 'site_url' => 'http://reseller.authorize.net/application/?id=5560364'));
@ -33,5 +42,7 @@ class PaymentLibrariesSeeder extends Seeder
//Gateway::where('provider', '=', 'FirstData_Connect')->update(array('sort_order' => 20, 'site_url' => 'https://www.firstdata.com/'));
Gateway::where('provider', '=', 'PayPal_Pro')->update(array('sort_order' => 25, 'site_url' => 'https://www.paypal.com/'));
Gateway::where('provider', '=', 'TwoCheckout')->update(array('sort_order' => 30, 'site_url' => 'https://www.2checkout.com/referral?r=2c37ac2298'));
*/
}
}

View File

@ -224,6 +224,7 @@ define('GATEWAY_AUTHORIZE_NET', 1);
define('GATEWAY_PAYPAL_EXPRESS', 17);
define('GATEWAY_BEANSTREAM', 29);
define('GATEWAY_PSIGATE', 30);
define('GATEWAY_MOOLAH', 31);
define('EVENT_CREATE_CLIENT', 1);
define('EVENT_CREATE_INVOICE', 2);

View File

@ -11,6 +11,7 @@
@if ($accountGateway)
{{ Former::populateField('gateway_id', $accountGateway->gateway_id) }}
{{ Former::populateField('recommendedGateway_id', $accountGateway->gateway_id) }}
@if ($config)
@foreach ($accountGateway->fields as $field => $junk)
@if (in_array($field, ['solutionType', 'landingPage', 'headerImageUrl', 'brandName']))
{{-- do nothing --}}
@ -19,6 +20,7 @@
@endif
@endforeach
@endif
@endif
<div class="two-column">
{{ Former::checkboxes('creditCardTypes[]')->label('Accepted Credit Cards')
@ -26,13 +28,15 @@
}}
</div>
<p/>&nbsp;<p/>
<div class="two-column">
{{ Former::radios('recommendedGateway_id')->label('Recommended Gateways')
{{ Former::radios('recommendedGateway_id')->label('Recommended Gateway')
->radios($recommendedGateways)->class('recommended-gateway')
}}
</div>
{{ Former::select('gateway_id')->label('PayPal & Other Gateways')->addOption('', '')
{{ Former::select('gateway_id')->label('Select Gateway')->addOption('', '')
->dataClass('gateway-dropdown')
->fromQuery($dropdownGateways, 'name', 'id')
->onchange('setFieldsShown()'); }}
@ -57,6 +61,8 @@
@endforeach
<p/>&nbsp;<p/>
{{ Former::actions( Button::lg_success_submit('Save')->append_with_icon('floppy-disk') ) }}
{{ Former::close() }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB