| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2018-04-02 14:43:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-17 14:44:46 +01:00
										 |  |  | /** | 
					
						
							|  |  |  |  * import.php | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  |  * Copyright (c) 2018 thegrumpydictator@gmail.com | 
					
						
							| 
									
										
										
										
											2017-12-17 14:44:46 +01:00
										 |  |  |  * | 
					
						
							|  |  |  |  * This file is part of Firefly III. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Firefly III is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  |  * the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  |  * (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Firefly III is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with Firefly III. If not, see <http://www.gnu.org/licenses/>. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  | declare(strict_types=1); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  | use FireflyIII\Import\JobConfiguration\BunqJobConfiguration; | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  | use FireflyIII\Import\JobConfiguration\FakeJobConfiguration; | 
					
						
							|  |  |  | use FireflyIII\Import\JobConfiguration\FileJobConfiguration; | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  | use FireflyIII\Import\JobConfiguration\FinTSJobConfiguration; | 
					
						
							| 
									
										
										
										
											2018-05-19 10:44:33 +02:00
										 |  |  | use FireflyIII\Import\JobConfiguration\SpectreJobConfiguration; | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  | use FireflyIII\Import\JobConfiguration\YnabJobConfiguration; | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  | use FireflyIII\Import\Prerequisites\BunqPrerequisites; | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  | use FireflyIII\Import\Prerequisites\FakePrerequisites; | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  | use FireflyIII\Import\Prerequisites\SpectrePrerequisites; | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  | use FireflyIII\Import\Prerequisites\YnabPrerequisites; | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  | use FireflyIII\Import\Routine\BunqRoutine; | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  | use FireflyIII\Import\Routine\FakeRoutine; | 
					
						
							|  |  |  | use FireflyIII\Import\Routine\FileRoutine; | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  | use FireflyIII\Import\Routine\FinTSRoutine; | 
					
						
							| 
									
										
										
										
											2018-05-14 20:21:00 +02:00
										 |  |  | use FireflyIII\Import\Routine\SpectreRoutine; | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  | use FireflyIII\Import\Routine\YnabRoutine; | 
					
						
							| 
									
										
										
										
											2018-05-11 10:08:34 +02:00
										 |  |  | use FireflyIII\Support\Import\Routine\File\CSVProcessor; | 
					
						
							| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | return [ | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     // these import providers are available:
 | 
					
						
							|  |  |  |     'enabled'          => [ | 
					
						
							|  |  |  |         'fake'    => true, | 
					
						
							| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  |         'file'    => true, | 
					
						
							| 
									
										
										
										
											2019-09-07 06:23:26 +02:00
										 |  |  |         'bunq'    => false, | 
					
						
							| 
									
										
										
										
											2018-05-14 17:59:43 +02:00
										 |  |  |         'spectre' => true, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => true, | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |         'plaid'   => false, | 
					
						
							|  |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => true, | 
					
						
							| 
									
										
										
										
											2018-05-30 18:04:23 +02:00
										 |  |  |         'bad'     => false, // always disabled
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     ], | 
					
						
							|  |  |  |     // demo user can use these import providers (when enabled):
 | 
					
						
							|  |  |  |     'allowed_for_demo' => [ | 
					
						
							|  |  |  |         'fake'    => true, | 
					
						
							|  |  |  |         'file'    => false, | 
					
						
							|  |  |  |         'bunq'    => false, | 
					
						
							|  |  |  |         'spectre' => false, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => false, | 
					
						
							| 
									
										
										
										
											2017-12-17 19:24:43 +01:00
										 |  |  |         'plaid'   => false, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => false, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     // a normal user user can use these import providers (when enabled):
 | 
					
						
							|  |  |  |     'allowed_for_user' => [ | 
					
						
							|  |  |  |         'fake'    => false, | 
					
						
							|  |  |  |         'file'    => true, | 
					
						
							|  |  |  |         'bunq'    => true, | 
					
						
							|  |  |  |         'spectre' => true, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => true, | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |         'plaid'   => true, | 
					
						
							|  |  |  |         'quovo'   => true, | 
					
						
							|  |  |  |         'yodlee'  => true, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => true, | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  |     // some providers have pre-requisites.
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     'has_prereq'       => [ | 
					
						
							| 
									
										
										
										
											2018-05-03 22:20:06 +02:00
										 |  |  |         'fake'    => true, | 
					
						
							|  |  |  |         'file'    => false, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'bunq'    => true, | 
					
						
							|  |  |  |         'spectre' => true, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => true, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'plaid'   => true, | 
					
						
							|  |  |  |         'quovo'   => true, | 
					
						
							|  |  |  |         'yodlee'  => true, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => false, | 
					
						
							| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  |     // if so, there must be a class to handle them.
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     'prerequisites'    => [ | 
					
						
							| 
									
										
										
										
											2018-04-29 19:07:54 +02:00
										 |  |  |         'fake'    => FakePrerequisites::class, | 
					
						
							| 
									
										
										
										
											2018-05-06 20:42:30 +02:00
										 |  |  |         'file'    => false, | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  |         'bunq'    => BunqPrerequisites::class, | 
					
						
							| 
									
										
										
										
											2018-05-14 17:59:43 +02:00
										 |  |  |         'spectre' => SpectrePrerequisites::class, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => YnabPrerequisites::class, | 
					
						
							| 
									
										
										
										
											2018-04-30 06:37:29 +02:00
										 |  |  |         'plaid'   => false, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => false, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-14 17:59:43 +02:00
										 |  |  |     // some providers may need extra configuration per job
 | 
					
						
							| 
									
										
										
										
											2018-05-30 18:04:23 +02:00
										 |  |  |     'has_job_config'   => [ | 
					
						
							| 
									
										
										
										
											2018-05-03 22:20:06 +02:00
										 |  |  |         'fake'    => true, | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'file'    => true, | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  |         'bunq'    => true, | 
					
						
							| 
									
										
										
										
											2018-05-19 10:44:33 +02:00
										 |  |  |         'spectre' => true, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => true, | 
					
						
							| 
									
										
										
										
											2018-05-14 17:59:43 +02:00
										 |  |  |         'plaid'   => false, | 
					
						
							|  |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => true, | 
					
						
							| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  |     // if so, this is the class that handles it.
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     'configuration'    => [ | 
					
						
							| 
									
										
										
										
											2018-04-29 20:01:03 +02:00
										 |  |  |         'fake'    => FakeJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2018-05-03 22:20:06 +02:00
										 |  |  |         'file'    => FileJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  |         'bunq'    => BunqJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2018-05-19 10:44:33 +02:00
										 |  |  |         'spectre' => SpectreJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => YnabJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2018-04-30 06:37:29 +02:00
										 |  |  |         'plaid'   => false, | 
					
						
							|  |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => FinTSJobConfiguration::class, | 
					
						
							| 
									
										
										
										
											2017-12-16 08:03:35 +01:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  |     // this is the routine that runs the actual import.
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     'routine'          => [ | 
					
						
							| 
									
										
										
										
											2018-04-30 06:37:29 +02:00
										 |  |  |         'fake'    => FakeRoutine::class, | 
					
						
							| 
									
										
										
										
											2018-04-02 14:43:06 +02:00
										 |  |  |         'file'    => FileRoutine::class, | 
					
						
							| 
									
										
										
										
											2018-05-23 12:36:12 +02:00
										 |  |  |         'bunq'    => BunqRoutine::class, | 
					
						
							| 
									
										
										
										
											2018-05-14 20:21:00 +02:00
										 |  |  |         'spectre' => SpectreRoutine::class, | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         'ynab'    => YnabRoutine::class, | 
					
						
							| 
									
										
										
										
											2018-04-30 06:37:29 +02:00
										 |  |  |         'plaid'   => false, | 
					
						
							|  |  |  |         'quovo'   => false, | 
					
						
							|  |  |  |         'yodlee'  => false, | 
					
						
							| 
									
										
										
										
											2018-10-01 19:24:24 +02:00
										 |  |  |         'fints'   => FinTSRoutine::class, | 
					
						
							| 
									
										
										
										
											2017-12-16 19:47:14 +01:00
										 |  |  |     ], | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |     'options' => [ | 
					
						
							|  |  |  |         'fake'    => [], | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'file'    => [ | 
					
						
							| 
									
										
										
										
											2017-12-16 17:19:10 +01:00
										 |  |  |             'import_formats'        => ['csv'], // mt940
 | 
					
						
							|  |  |  |             'default_import_format' => 'csv', | 
					
						
							| 
									
										
										
										
											2018-03-10 07:16:38 +01:00
										 |  |  |             'processors'            => [ | 
					
						
							| 
									
										
										
										
											2018-05-06 20:42:30 +02:00
										 |  |  |                 'csv' => CSVProcessor::class, | 
					
						
							| 
									
										
										
										
											2017-12-16 20:21:05 +01:00
										 |  |  |             ], | 
					
						
							| 
									
										
										
										
											2017-12-16 17:19:10 +01:00
										 |  |  |         ], | 
					
						
							| 
									
										
										
										
											2018-04-29 18:03:55 +02:00
										 |  |  |         'bunq'    => [ | 
					
						
							| 
									
										
										
										
											2018-05-13 09:01:10 +02:00
										 |  |  |             'live'    => [ | 
					
						
							|  |  |  |                 'server'  => 'api.bunq.com', | 
					
						
							|  |  |  |                 'version' => 'v1', | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |             'sandbox' => [ | 
					
						
							|  |  |  |                 'server'  => 'sandbox.public.api.bunq.com', // sandbox.public.api.bunq.com - api.bunq.com
 | 
					
						
							|  |  |  |                 'version' => 'v1', | 
					
						
							|  |  |  |             ], | 
					
						
							| 
									
										
										
										
											2018-03-10 07:16:38 +01:00
										 |  |  |         ], | 
					
						
							| 
									
										
										
										
											2018-04-28 15:35:43 +02:00
										 |  |  |         'spectre' => [ | 
					
						
							|  |  |  |             'server' => 'www.saltedge.com', | 
					
						
							|  |  |  |         ], | 
					
						
							| 
									
										
										
										
											2018-07-29 21:02:03 +02:00
										 |  |  |         'ynab'    => [ | 
					
						
							|  |  |  |             'live'    => 'api.youneedabudget.com', | 
					
						
							|  |  |  |             'version' => 'v1', | 
					
						
							| 
									
										
										
										
											2018-07-29 07:30:06 +02:00
										 |  |  |         ], | 
					
						
							| 
									
										
										
										
											2018-05-13 15:00:30 +02:00
										 |  |  |         'plaid'   => [], | 
					
						
							|  |  |  |         'quovo'   => [], | 
					
						
							|  |  |  |         'yodlee'  => [], | 
					
						
							| 
									
										
										
										
											2017-12-16 17:19:10 +01:00
										 |  |  |     ], | 
					
						
							| 
									
										
										
										
											2017-12-27 22:29:25 +01:00
										 |  |  | ]; |