1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00

Added new payment providers

This commit is contained in:
Hillel Coren 2014-11-25 20:40:54 +02:00
parent b80685b7e4
commit 4866e19d88
5 changed files with 669 additions and 176 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* An helper file for Laravel 4, to provide autocomplete information to your IDE * An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.1.25 on 2014-10-20. * Generated for Laravel 4.1.25 on 2014-11-25.
* *
* @author Barry vd. Heuvel <barryvdh@gmail.com> * @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper * @see https://github.com/barryvdh/laravel-ide-helper

View File

@ -227,6 +227,7 @@ class PaymentController extends \BaseController
$key = $invoice->invoice_number . '_details'; $key = $invoice->invoice_number . '_details';
$gateway = $invoice->client->account->account_gateways[0]->gateway; $gateway = $invoice->client->account->account_gateways[0]->gateway;
$paymentLibrary = $gateway->paymentlibrary; $paymentLibrary = $gateway->paymentlibrary;
$currencyCode = $invoice->client->currency ? $invoice->client->currency->code : $invoice->account->currency ? $invoice->account->currency->code : 'USD';
if ($input && $paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY) if ($input && $paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY)
{ {
@ -253,7 +254,7 @@ class PaymentController extends \BaseController
'ship_to_city' => $input['city'], 'ship_to_city' => $input['city'],
'ship_to_state' => $input['state'], 'ship_to_state' => $input['state'],
'ship_to_postal_code' => $input['postal_code'], 'ship_to_postal_code' => $input['postal_code'],
'currency_code' => $invoice->client->currency->code, 'currency_code' => $currencyCode,
]; ];
switch($gateway->id) switch($gateway->id)
@ -293,7 +294,7 @@ class PaymentController extends \BaseController
return [ return [
'amount' => $invoice->amount, 'amount' => $invoice->amount,
'card' => $card, 'card' => $card,
'currency' => $invoice->client->currency->code, 'currency' => $currencyCode,
'returnUrl' => URL::to('complete'), 'returnUrl' => URL::to('complete'),
'cancelUrl' => URL::to('/') 'cancelUrl' => URL::to('/')
]; ];

View File

@ -8,46 +8,28 @@ class PaymentLibrariesSeeder extends Seeder
Eloquent::unguard(); Eloquent::unguard();
$gateways = [ $gateways = [
array('name'=>'BeanStream', 'provider'=>'BeanStream', 'payment_library_id' => 2), ['name' => 'BeanStream', 'provider' => 'BeanStream', 'payment_library_id' => 2],
array('name'=>'Psigate', 'provider'=>'Psigate', 'payment_library_id' => 2) ['name' => 'Psigate', 'provider' => 'Psigate', 'payment_library_id' => 2],
['name' => 'moolah', 'provider' => 'AuthorizeNet_AIM', 'sort_order' => 1, 'recommended' => 1, 'site_url' => 'https://invoiceninja.mymoolah.com/', 'payment_library_id' => 1],
['name' => 'Alipay', 'provider' => 'Alipay_Express', 'payment_library_id' => 1],
['name' => 'Buckaroo', 'provider' => 'Buckaroo_CreditCard', 'payment_library_id' => 1],
['name' => 'Coinbase', 'provider' => 'Coinbase', 'payment_library_id' => 1],
['name' => 'DataCash', 'provider' => 'DataCash', 'payment_library_id' => 1],
['name' => 'Neteller', 'provider' => 'Neteller', 'payment_library_id' => 1],
['name' => 'Pacnet', 'provider' => 'Pacnet', 'payment_library_id' => 1],
['name' => 'PaymentSense', 'provider' => 'PaymentSense', 'payment_library_id' => 1],
['name' => 'Realex', 'provider' => 'Realex_Remote', 'payment_library_id' => 1],
['name' => 'Sisow', 'provider' => 'Sisow', 'payment_library_id' => 1],
['name' => 'Skrill', 'provider' => 'Skrill', 'payment_library_id' => 1]
]; ];
foreach ($gateways as $gateway) foreach ($gateways as $gateway)
{ {
Gateway::create($gateway); if (!DB::table('gateways')->where('name', '=', $gateway['name'])->get())
{
Gateway::create($gateway);
}
} }
// check that moolah exists
if (!DB::table('gateways')->where('name', '=', 'moolah')->get()) {
DB::table('gateways')->update(['recommended' => 0]);
Gateway::create(array(
'name' => 'moolah',
'provider' => 'AuthorizeNet_AIM',
'sort_order' => 1,
'recommended' => 1,
'site_url' => 'https://invoiceninja.mymoolah.com/',
'payment_library_id' => 1
));
}
/*
$updateProviders = array(
0 => 'AuthorizeNet_AIM',
//1 => 'BeanStream',
//2 => 'iTransact',
//3 => 'FirstData_Connect',
4 => 'PayPal_Pro',
5 => 'TwoCheckout'
);
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'));
//Gateway::where('provider', '=', 'BeanStream')->update(array('sort_order' => 10, 'site_url' => 'http://www.beanstream.com/'));
//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

@ -19,9 +19,17 @@
"omnipay/omnipay": "~2.0", "omnipay/omnipay": "~2.0",
"intervention/image": "1.x", "intervention/image": "1.x",
"webpatser/laravel-countries": "dev-master", "webpatser/laravel-countries": "dev-master",
"barryvdh/laravel-ide-helper": "1.*", "barryvdh/laravel-ide-helper": "~1.0",
"doctrine/dbal": "~2.3", "doctrine/dbal": "~2.3",
"jsanc623/phpbenchtime": "2.x" "jsanc623/phpbenchtime": "2.x",
"lokielse/omnipay-alipay": "dev-master",
"coatesap/omnipay-datacash": "~2.0",
"alfaproject/omnipay-neteller": "~1.0",
"mfauveau/omnipay-pacnet": "~2.0",
"coatesap/omnipay-paymentsense": "~2.0",
"coatesap/omnipay-realex": "~2.0",
"fruitcakestudio/omnipay-sisow": "~2.0",
"alfaproject/omnipay-skrill": "dev-master"
}, },
"require-dev": { "require-dev": {
"codeception/codeception": "dev-master" "codeception/codeception": "dev-master"

772
composer.lock generated

File diff suppressed because it is too large Load Diff