diff --git a/app/PaymentDrivers/Rotessa/DataProviders/CAProvinces.php b/app/PaymentDrivers/Rotessa/DataProviders/CAProvinces.php deleted file mode 100644 index 275e79cfad4e..000000000000 --- a/app/PaymentDrivers/Rotessa/DataProviders/CAProvinces.php +++ /dev/null @@ -1,55 +0,0 @@ - 'Alberta', - 'BC' => 'British Columbia', - 'MB' => 'Manitoba', - 'NB' => 'New Brunswick', - 'NL' => 'Newfoundland And Labrador', - 'NS' => 'Nova Scotia', - 'ON' => 'Ontario', - 'PE' => 'Prince Edward Island', - 'QC' => 'Quebec', - 'SK' => 'Saskatchewan', - 'NT' => 'Northwest Territories', - 'NU' => 'Nunavut', - 'YT' => 'Yukon' - ]; - - /** - * Get the name of the province or territory for a given abbreviation. - * - * @param string $abbreviation - * @return string - */ - public static function getName($abbreviation) { - return self::$provinces[$abbreviation]; - } - - /** - * Get all provinces and territories. - * - * @return array - */ - public static function get() { - return self::$provinces; - } - - /** - * Get the abbreviation for a given province or territory name. - * - * @param string $name - * @return string - */ - public static function getAbbreviation($name) { - return array_search(ucwords($name), self::$provinces); - } -} diff --git a/app/PaymentDrivers/Rotessa/DataProviders/Frequencies.php b/app/PaymentDrivers/Rotessa/DataProviders/Frequencies.php deleted file mode 100644 index ca5623c1694b..000000000000 --- a/app/PaymentDrivers/Rotessa/DataProviders/Frequencies.php +++ /dev/null @@ -1,19 +0,0 @@ -where('name', 'Rotessa')->isEmpty()) { - $gateways = Gateway::orderBy('id')->get(); - } - - $gateways = $gateways->map(fn($item) => $item->name == 'Rotessa'? RotessaGateway::find($item->toArray()['id']) : $item ); - - Cache::forever('gateways', $gateways); - } -} - diff --git a/app/PaymentDrivers/Rotessa/Models/Gateway.php b/app/PaymentDrivers/Rotessa/Models/Gateway.php deleted file mode 100644 index 55405dbd7f5f..000000000000 --- a/app/PaymentDrivers/Rotessa/Models/Gateway.php +++ /dev/null @@ -1,23 +0,0 @@ -name == 'Rotessa' && empty($options)) { - $options = $gateway_types; - } - - return $options; - } -} - diff --git a/app/PaymentDrivers/Rotessa/Providers/.gitkeep b/app/PaymentDrivers/Rotessa/Providers/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/app/PaymentDrivers/Rotessa/Providers/EventServiceProvider.php b/app/PaymentDrivers/Rotessa/Providers/EventServiceProvider.php deleted file mode 100644 index 0d61ecbce482..000000000000 --- a/app/PaymentDrivers/Rotessa/Providers/EventServiceProvider.php +++ /dev/null @@ -1,21 +0,0 @@ - [ - Listener::class, - ], - ]; -} diff --git a/app/PaymentDrivers/Rotessa/Providers/ServiceProvider.php b/app/PaymentDrivers/Rotessa/Providers/ServiceProvider.php deleted file mode 100644 index af11a242f209..000000000000 --- a/app/PaymentDrivers/Rotessa/Providers/ServiceProvider.php +++ /dev/null @@ -1,83 +0,0 @@ -registerConfig(); - $this->registerTranslations(); - $this->registerViews(); - - event(new CacheGateways); - } - - /** - * Register config. - */ - protected function registerConfig(): void - { - $this->mergeConfigFrom(app_path("PaymentDrivers/{$this->moduleName}/config/gateway_types.php"),$this->moduleNameLower); - } - /** - * Register the service provider. - */ - public function register(): void - { - $this->app->register(EventServiceProvider::class); - - } - - /** - * Register translations. - */ - public function registerTranslations(): void - { - $langPath = resource_path('lang/modules/'.$this->moduleNameLower); - - if (is_dir($langPath)) { - $this->loadTranslationsFrom($langPath, $this->moduleNameLower); - $this->loadJsonTranslationsFrom($langPath); - } else { - $this->loadTranslationsFrom(app_path("PaymentDrivers/{$this->moduleName}resources/lang"), $this->moduleNameLower); - $this->loadJsonTranslationsFrom(app_path("PaymentDrivers/{$this->moduleName}resources/lang")); - } - } - - /** - * Register views. - */ - public function registerViews(): void - { - $viewPath = resource_path('views/portal/ninja2020/gateways/'.$this->moduleNameLower); - $sourcePath = app_path('PaymentDrivers/Rotessa/resources/views/gateways/rotessa'); - $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); - Blade::componentNamespace('App\\PaymentDrivers\\Rotessa\\View\\Components', $this->moduleNameLower); - } - - private function getPublishableViewPaths(): array - { - $paths = [app_path('PaymentDrivers/Rotessa/resources/views/gateways/rotessa')]; - foreach (config('view.paths') as $path) { - if (is_dir($path.'/'.$this->moduleNameLower)) { - $paths[] = $path.'/'.$this->moduleNameLower; - } - } - - return $paths; - } -} diff --git a/app/PaymentDrivers/Rotessa/View/Components/Components.php b/app/PaymentDrivers/Rotessa/View/Components/Components.php deleted file mode 100644 index b18269f35f54..000000000000 --- a/app/PaymentDrivers/Rotessa/View/Components/Components.php +++ /dev/null @@ -1,118 +0,0 @@ -contact = $contact; - $this->attributes = $this->newAttributeBag(Arr::only($this->contact, $this->fields) ); - } - - private $fields = [ - 'name', - 'email', - 'home_phone', - 'phone', - 'custom_identifier', - 'customer_type' , - 'id' - ]; - - private $defaults = [ - 'customer_type' => "Business", - 'customer_identifier' => null, - 'id' => null - ]; - - public function render() - { - return $this->view('rotessa::components.contact', $this->attributes->getAttributes(), $this->defaults ); - } -} - -// Address Component -class AddressComponent extends Component -{ - private $fields = [ - 'address_1', - 'address_2', - 'city', - 'postal_code', - 'province_code', - 'country' - ]; - - private $defaults = [ - 'country' => 'US' - ]; - - public array $address; - - public function __construct(array $address) { - $this->address = $address; - if(strlen($this->address['state']) > 2 ) { - $this->address['state'] = $this->address['country'] == 'US' ? array_search($this->address['state'], USStates::$states) : CAProvinces::getAbbreviation($this->address['state']); - } - - $this->attributes = $this->newAttributeBag( - Arr::only(Arr::mapWithKeys($this->address, function ($item, $key) { - return in_array($key, ['address1','address2','state'])?[ (['address1'=>'address_1','address2'=>'address_2','state'=>'province_code'])[$key] => $item ] :[ $key => $item ]; - }), - $this->fields) ); - } - - - public function render() - { - - return $this->view('rotessa::components.address', $this->attributes->getAttributes(), $this->defaults ); - } -} - -// AmericanBankInfo Component -class AccountComponent extends Component -{ - private $fields = [ - 'bank_account_type', - 'routing_number', - 'institution_number', - 'transit_number', - 'bank_name', - 'country', - 'account_number' - ]; - - private $defaults = [ - 'bank_account_type' => null, - 'routing_number' => null, - 'institution_number' => null, - 'transit_number' => null, - 'bank_name' => ' ', - 'account_number' => null, - 'country' => 'US', - "authorization_type" => 'Online' - ]; - - public array $account; - - public function __construct(array $account) { - $this->account = $account; - $this->attributes = $this->newAttributeBag(Arr::only($this->account, $this->fields) ); - } - - public function render() - { - return $this->view('rotessa::components.account', $this->attributes->getAttributes(), $this->defaults ); - } -} diff --git a/app/PaymentDrivers/Rotessa/View/Composers/Composer.php b/app/PaymentDrivers/Rotessa/View/Composers/Composer.php deleted file mode 100644 index fb3c126a3555..000000000000 --- a/app/PaymentDrivers/Rotessa/View/Composers/Composer.php +++ /dev/null @@ -1,16 +0,0 @@ -with('states', $states); -}); - -// CAProvinces View Composer -View::composer(['rotessa::components.address','rotessa::components.banks.CA.bank','rotessa::components.dropdowns.country.CA'], function ($view) { - $provinces = CAProvinces::get(); - $view->with('provinces', $provinces); -}); \ No newline at end of file diff --git a/app/PaymentDrivers/Rotessa/composer.json b/app/PaymentDrivers/Rotessa/composer.json deleted file mode 100644 index 6f9ba511a9b4..000000000000 --- a/app/PaymentDrivers/Rotessa/composer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "karneaud/invoiceninja-rotessa", - "description": "Invoice Ninja with Rotessa gateway", - "type":"laravel-module", - "keywords": [ - "invoice ninja", - "laravel", - "rotessa" - ], - "license": ["Attribution Assurance License","Proprietary License","BSD 3-Clause License"], - "authors": [ - { - "name": "Kendall Arneaud", - "email": "kendall.arneaud@gmail.com" - } - ], - "autoload": { - "classmap": ["./View/Components/Components.php"], - "psr-4": { - "App\\PaymentDrivers\\Rotessa\\":"./", - "App\\PaymentDrivers\\Rotessa\\View\\Components\\":"./View/Components/", - "App\\PaymentDrivers\\Rotessa\\Database\\Seeders\\": "Database/Seeders/" - }, - "files": [ - "./View/Composers/Composer.php" - ] - }, - "config": { - "preferred-install": "dist", - "sort-packages": true, - "optimize-autoloader": true - }, - "repositories": [ - { - "type": "package", - "package": { - "name": "karneaud/omnipay-rotessa", - "source": { - "url": "https://github.com/karneaud/omnipay-rotessa.git", - "type": "git", - "reference": "master" - }, - "version": "1.0.0-beta", - "dist": { - "url": "https://github.com/karneaud/omnipay-rotessa/archive/refs/tags/v1.0.0-beta.zip", - "type": "zip" - }, - "autoload": { - "psr-4": { - "Omnipay\\Rotessa\\":"./src/Omnipay/Rotessa/", - "Omnipay\\Rotessa\\Exception\\":"./src/Omnipay/Rotessa/Exception/" - }, - "classmap": ["./src/Omnipay/Rotessa/Exception/Exceptions.php"] - } - } - } - ], - "require": { - "karneaud/omnipay-rotessa": "v1.0.0-beta" - } -} diff --git a/app/PaymentDrivers/Rotessa/composer.lock b/app/PaymentDrivers/Rotessa/composer.lock deleted file mode 100644 index 24dc1719cffb..000000000000 --- a/app/PaymentDrivers/Rotessa/composer.lock +++ /dev/null @@ -1,44 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "4c8b93bd9cd92f484502fc665fdbe826", - "packages": [ - { - "name": "karneaud/omnipay-rotessa", - "version": "1.0.0-beta", - "source": { - "type": "git", - "url": "https://github.com/karneaud/omnipay-rotessa.git", - "reference": "master" - }, - "dist": { - "type": "zip", - "url": "https://github.com/karneaud/omnipay-rotessa/archive/refs/tags/v1.0.0-beta.zip" - }, - "type": "library", - "autoload": { - "psr-4": { - "Omnipay\\Rotessa\\": "./src/Omnipay/Rotessa/", - "Omnipay\\Rotessa\\Exception\\": "./src/Omnipay/Rotessa/Exception/" - }, - "classmap": [ - "./src/Omnipay/Rotessa/Exception/Exceptions.php" - ] - } - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "karneaud/omnipay-rotessa": 10 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.6.0" -} diff --git a/app/PaymentDrivers/Rotessa/config/gateway_types.php b/app/PaymentDrivers/Rotessa/config/gateway_types.php deleted file mode 100644 index 9f851e3a3714..000000000000 --- a/app/PaymentDrivers/Rotessa/config/gateway_types.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - GatewayType::BANK_TRANSFER => [ - 'refund' => false, - 'token_billing' => true, - 'webhooks' => [], - ], - //GatewayType::BACS => ['refund' => false, 'token_billing' => true, 'webhooks' => []], - //GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => []], - GatewayType::ACSS => ['refund' => false, 'token_billing' => true, 'webhooks' => []] - ] -]; \ No newline at end of file diff --git a/app/PaymentDrivers/Rotessa/resources/views/gateways/rotessa/bank_transfer/CA/details.blade.php b/app/PaymentDrivers/Rotessa/resources/views/gateways/rotessa/bank_transfer/CA/details.blade.php deleted file mode 100644 index 9492f3036fc1..000000000000 --- a/app/PaymentDrivers/Rotessa/resources/views/gateways/rotessa/bank_transfer/CA/details.blade.php +++ /dev/null @@ -1,4 +0,0 @@ -
{{ session('ach_error') }}
-- Enter the information for the bank account -
-- Enter the address information for the account holder -
-- Enter the information for the account holder -
-