承接 macropage/laravel-daparto 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

macropage/laravel-daparto

最新稳定版本:v2.05

Composer 安装命令:

composer require macropage/laravel-daparto

包简介

Help working with Daparto

README 文档

README

Installation

You can install the package via composer:

composer require macropage/laravel-daparto

Publish config using php artisan vendor:publish --provider="macropage\laravel_daparto\DapartoServiveProvider"

Update your config config/daparto.php

<?php

return [
    'accounts' => [
        '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 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
Daparto::setCustomerConfig($this->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!

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.

统计信息

  • 总下载量: 115
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-20