1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/database/seeds/BanksSeeder.php

42 lines
189 KiB
PHP
Raw Normal View History

2016-01-20 00:07:31 +01:00
<?php
use App\Models\Bank;
class BanksSeeder extends Seeder
{
public function run()
{
Eloquent::unguard();
$this->createBanks();
}
// Source: http://www.ofxhome.com/
private function createBanks()
{
2016-01-26 21:22:33 +01:00
// http://www.ofxhome.com/api.php?dump=yes
// http://www.utilities-online.info/xmltojson
// http://www.httputility.net/json-minifier.aspx
$banks = '[{"id":"421","name":"ING DIRECT (Canada)","fid":"061400152","org":"INGDirectCanada","url":"https://ofx.ingdirect.ca","ofxfail":"1","sslfail":"5","lastofxvalidation":"2014-10-26 22:57:57","lastsslvalidation":"2014-12-03 23:01:03","profile":{"-addr1":"3389 Steeles Avenue East","-city":"Toronto","-state":"ON","-postalcode":"M2H 3S8","-country":"CAN","-csphone":"800-464-3473","-tsphone":"800-464-3473","-url":"http://www.tangerine.ca","-email":"clientservices@ingdirect.ca","-signonmsgset":"true","-bankmsgset":"true"}},{"id":"422","name":"Safe Credit Union - OFX Beta","fid":"321173742","org":"DI","url":"https://ofxcert.diginsite.com/cmr/cmr.ofx","ofxfail":"3","sslfail":"0","lastofxvalidation":"2010-03-18 16:25:00","lastsslvalidation":"2015-07-02 23:46:44"},{"id":"423","name":"Ascentra Credit Union","fid":"273973456","org":"Alcoa Employees&Community CU","url":"https://alc.usersonlnet.com/scripts/isaofx.dll","ofxfail":"1","sslfail":"5","lastofxvalidation":"2013-10-01 22:03:55","lastsslvalidation":"2013-10-01 22:03:55","profile":{"-addr1":"1250 Drummers Ln.","-city":"Valley Forge","-state":"PA","-postalcode":"19482","-country":"USA","-csphone":"610-687-9400","-tsphone":"610-687-9400","-url":"http://www.users.com","-email":"admin@users.com","-signonmsgset":"true","-bankmsgset":"true","-creditcardmsgset":"true"}},{"id":"424","name":"American Express Card","fid":"3101","org":"AMEX","url":"https://online.americanexpress.com/myca/ofxdl/desktop/desktopDownload.do?request_type=nl_ofxdownload","ofxfail":"0","sslfail":"0","lastofxvalidation":"2015-11-23 09:54:17","lastsslvalidation":"2015-06-22 22:09:26","profile":{"-addr1":"777 American Expressway","-city":"Fort Lauderdale","-state":"Fla.","-postalcode":"33337-0001","-country":"USA","-csphone":"1-800-AXP-7500 (1-800-297-7500)","-url":"https://online.americanexpress.com/myca/ofxdl/desktop/desktopDownload.do?request_type=nl_ofxdownload","-signonmsgset":"true","-bankmsgset":"true","-creditcardmsgset":"true"}},{"id":"425","name":"TD Ameritrade","fid":"5024","org":"ameritrade.com","brokerid":"ameritrade.com","url":"https://ofxs.ameritrade.com/cgi-bin/apps/OFX","ofxfail":"0","sslfail":"0","lastofxvalidation":"2015-11-09 23:43:48","lastsslvalidation":"2016-01-18 10:26:26","profile":{"-addr1":"4211 So. 102nd Street","-city":"Omaha","-state":"NE","-postalcode":"68127","-country":"USA","-csphone":"1-212-723-2898","-tsphone":"1-212-723-2898","-url":"https://ofxs.ameritrade.com/cgi-bin/apps/OFX","-email":"alex_shnir@smb.com","-signonmsgset":"true","-bankmsgset":"true","-invstmtmsgset":"true","-seclistmsgset":"true","-notes":"Username is case sensitive Automatically imports 2 years of transactions Older transactions may be imported from the Ameritrade website. See documentation for more details. mported stock split transactions may have incorrect data"}},{"id":"426","name":"Truliant FCU","fid":"253177832","org":"DI","url":"https://ofxdi.diginsite.com/cmr/cmr.ofx","ofxfail":"0","sslfail":"0","lastofxvalidation":"2015-07-03 00:02:33","lastsslvalidation":"2015-07-03 00:02:32","profile":{"-addr1":"3200 Truliant Way","-city":"Winston-Salem","-state":"NC","-postalcode":"27103","-country":"USA","-csphone":"800-822-0382","-tsphone":"800-822-038","-url":"www.truliantfcu.org","-email":"2","-signonmsgset":"true","-bankmsgset":"true"}},{"id":"427","name":"AT&T Universal Card","fid":"24909","org":"Citigroup","url":"https://secureofx2.bankhost.com/citi/cgi-forte/ofx_rt?servicename=ofx_rt&pagename=ofx","ofxfail":"1","sslfail":"5","lastofxvalidation":"2013-03-06 22:04:25","lastsslvalidation":"2013-06-11 22:03:53","profile":{"-addr1":"8787 Baypine Road","-city":"Jacksonville","-state":"FL","-postalcode":"32256","-country":"USA","-csphone":"1-800-950-5114","-tsphone":"1-800-347-4934","-url":"http://www.citicards.com","-signonmsgset":"true","-creditcardmsgset":"true"}},{"id":"428","name":"Bank One","fid":"5811","org":"B1","url":"https://onlineofx.chase.com/chase.ofx","ofxfail":"1","sslfail":"5","lastofxvalidation":"2009-11-15 01:32:59","lastsslvalidation":"2009-12-25 01:33:13"},{"id":"429","name":"
$banks = json_decode($banks);
2016-01-20 00:07:31 +01:00
foreach ($banks as $bank) {
2016-01-26 21:22:33 +01:00
if (!DB::table('banks')->where('remote_id', '=', $bank->id)->get()) {
if ( ! isset($bank->fid) || ! isset($bank->org)) {
continue;
}
Bank::create([
'remote_id' => $bank->id,
'name' => $bank->name,
'config' => json_encode([
'fid' => $bank->fid,
'org' => $bank->org,
'url' => $bank->url
]),
]);
2016-01-20 00:07:31 +01:00
}
}
}
}