Git Product home page Git Product logo

laravel-check24's Introduction

Import Orders from check24.de

Installation

You can install the package via composer:

composer require macropage/laravel-check24

Publish config using php artisan vendor:publish --provider="macropage\laravel_check24\Check24ServiveProvider"

Update your config config/check24.php

<?php

return [
    'accounts' => [
        'CUSTOMER1' => [
            'orders' => [
                'ftp' => [
                    'driver'   => 'ftp',
                    'host'     => 'ftp.xxxxx.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 that supports "tagging".

Facade

With the Facade Check24 you can call these methods:

  • Check24::setCustomerConfig('CUSTOMER1')
  • Check24::getXMLOrders (fetch orders via ftp or from cache)
  • Check24::getSingleXMLOrder($orderId) $OrderFileName = 'ORDER_' . $orderId . '.xml';
  • Check24::getXMLOrdersCached (same like getXMLOrders, but fetch data from cache)
  • Check24::getDistinctShippingDescr (for debugging: unique list of shipping-description within all orders)
  • Check24::getDistinctPaymentDescr (for debugging: unique list of payment-description within all orders)
  • Check24::setDone($xmlFileName) (moves file to 'done')
  • Check24::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('check24.CUSTOMER1')->flush();

Usage: Artisan Commands

  • check24:list-orders {account_name} {orderid?} {--cache}
  • check24: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
Check24::setCustomerConfig($this->argument('customer'));
if ($this->argument('orderid')) {
    $singleOrder = Check24::getSingleXMLOrder($this->argument('orderid'), $this->option('cache'));
} else {
    $OrderArrays = Check24::getXMLOrders($this->option('cache'));
}

Contributing

Help is appreciated :-)

You need help?

yes, you can hire me!

xing linkedin twitter

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

laravel-check24's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.