https://github.com/michabbb/laravel-daparto
Fetch daparto.de xml Orders via FTP
https://github.com/michabbb/laravel-daparto
bestellungen daparto ftp laravel orders xml
Last synced: about 2 months ago
JSON representation
Fetch daparto.de xml Orders via FTP
- Host: GitHub
- URL: https://github.com/michabbb/laravel-daparto
- Owner: michabbb
- License: mit
- Created: 2020-05-20T14:35:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-12T13:48:20.000Z (11 months ago)
- Last Synced: 2025-02-07T09:32:53.203Z (3 months ago)
- Topics: bestellungen, daparto, ftp, laravel, orders, xml
- Language: PHP
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Import Orders from daparto.de
## Installation
You can install the package via composer:
```bash
composer require macropage/laravel-daparto
```Publish config using `php artisan vendor:publish --provider="macropage\laravel_daparto\DapartoServiveProvider"`
Update your config `config/daparto.php`
```php
[
'CUSTOMER1' => [
'orders' => [
'ftp' => [
'driver' => 'ftp',
'host' => 'ftp.daparto.de',
'username' => 'xxxxxxx',
'password' => 'xxxxxxx',
]
]
]
]];
```
`CUSTOMER1` is just a placeholder, choose any name and as many you want.
Create a folder named "done" in your ftp-home.## Requirements
[A Cache-Provider](https://laravel.com/docs/7.x/cache#cache-tags) that supports "tagging".## Facade
With the Facade `Daparto` you can call these methods:- Daparto::setCustomerConfig('CUSTOMER1')
- Daparto::getXMLOrders (fetch orders via ftp or from cache)
- Daparto::getSingleXMLOrder($orderId) `$OrderFileName = 'ORDER_' . $orderId . '.xml';`
- Daparto::getXMLOrdersCached (same like getXMLOrders, but fetch data from cache)
- Daparto::getDistinctShippingDescr (for debugging: unique list of shipping-description within all orders)
- Daparto::getDistinctPaymentDescr (for debugging: unique list of payment-description within all orders)
- Daparto::setDone($xmlFileName) (moves file to 'done')
- Daparto::uploadShippingData($order_number, $carrier, $shipping_number) (uploading shipping infos to ftp)**NOTICE:** using "getXMLOrders" without cache, flushes the whole cache for your CUSTOMER1
in case you want to flush the cache manually: `Cache::tags('daparto.CUSTOMER1')->flush();`## Usage: Artisan Commands
- daparto:list-orders {account_name} {orderid?} {--cache}
- daparto:set-done {account_name} {orderid}"list-orders" prints all orders as php-array
"set-done" moves the xml-order-file into the folder named "done".## Usage: in your code
```php
argument('customer'));
if ($this->argument('orderid')) {
$singleOrder = Daparto::getSingleXMLOrder($this->argument('orderid'), $this->option('cache'));
} else {
$OrderArrays = Daparto::getXMLOrders($this->option('cache'));
}
```## Contributing
Help is appreciated :-)
## You need help?
_yes, you can hire me!_
[](https://www.xing.com/profile/Michael_Bladowski/cv)
[](https://www.linkedin.com/in/macropage/)
[](https://twitter.com/michabbb)## Credits
- [Michael Bladowski](https://github.com/michabbb)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).