necenzurat/fancourier 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

necenzurat/fancourier

Composer 安装命令:

composer require necenzurat/fancourier

包简介

FanCourier API Client

README 文档

README

A simple FanCourier implementation for Laravel.

Installation

Install the package through Composer.

Run the Composer require command from the Terminal:

composer require seniorprogramming/fancourier:dev-master

Now all you have to do is add the service provider of the package and alias the package. To do this open your config/app.php file.

Add a new line to the providers array:

SeniorProgramming\FanCourier\Providers\ApiServiceProvider::class,

And optionally add a new line to the aliases array:

'FanCourier' => SeniorProgramming\FanCourier\Facades\FanCourier::class,

Important, add in .env FanCourier credentials:

FANCOURIER_USERNAME=
FANCOURIER_PASSWORD=
FANCOURIER_CLIENT_ID=

Now you're ready to start using the FanCourier API Client in your application.

Overview

Look at one of the following topics to learn more about FanCourier API Clien

Usage

The FanCourier API Client gives you the following methods to use:

FanCourier::city()

Retrieves cities based on county if specificed and other info.

FanCourier::city()

The city() method will return an array of objects with: judet, localitate, agentie, km, cod_rutare, id_localitate_fan.

FanCourier::streets()

Retrieves streets based on county or city if specificed and other info.

FanCourier::streets()

The streets() method will return an array of objects with: judet, localitate, strada, de_la, pana_la, paritate, cod_postal, tip, cod_cartare, numar_depozite.

FanCourier::price()

Retrieve price based on service, package and distance

FanCourier::price()

The price() method will return a double.

FanCourier::trackAwb()

Track expedition using AWB code.

FanCourier::trackAwb()

The trackAwb() method will return a plain text.

FanCourier::generateAwb()

Send orders to generate AWB

FanCourier::generateAwb()

The generateAwb() method will return an array of objects with: line, awb, send_params, error_message.

FanCourier::order()

Place a order to a FanCourier Agent. The agent will come a pick-up the package at requested hour, in the same day

FanCourier::order()

**The order() method will return a plain message if the request is made successfully **

FanCourier::exportAwbErrors()

All FanCourier AWB with errors.

FanCourier::exportAwbErrors()

The exportAwbErrors() method will return an empty array or with objects containing: nume, judet, localitate, telefon, plicuri, colete, greutate, descriere.

FanCourier::deleteAwb()

Deletes AWB only if the shipping process is not finished.

FanCourier::deleteAwb()

The deleteAwb() method will return an int if the request is made successfully or the error message.

FanCourier::getAwb()

Returns documents containing shipping details.

FanCourier::getAwb()

The getAwb() method will return a html page containing documents that can be printed if the request is made successfully or the error message.

FanCourier::downloadAwb()

Returns AWB document in jpg format.

FanCourier::downloadAwb()

The downloadAwb() method will return a jpg if the request is made successfully or the error message.

FanCourier::exportOrders()

All orders made within selected date through FanCourier::order method.

FanCourier::exportOrders()

The exportOrders() method will return an empty array or with objects containing: nr._crt., data_ridicare_comanda, ora_de_la, ora_pana_la, persoana_contact, telefon, email, colete, numar_comanda, status.

FanCourier::exportBorderou()

All orders made within selected date through FanCourier::generateAwb method.

FanCourier::exportBorderou()

The exportBorderou() method will return an empty array or with objects containing: nr._crt., awb, ridicat, status, data_confirmarii, restituire, tip_serviciu, continut...

FanCourier::exportReports()

Returns all expeditions that have placed the total amount in the deposit account within selected date for the bank transfer.

FanCourier::exportReports()

The exportReports() method will return an empty array or with objects containing: oras_destinatar, dat_awb, suma_incasata, numar_awb, numar_awb, expeditor, destinatar, continut, persoanaD, data_virament, persoanaE, ramburs_la_awb, awb_retur

FanCourier::exportObservations()

Returns all observations that can be set when an expedition is requested.

FanCourier::exportObservations()

The exportObservations() method will return an empty array or with objects containing: observatii_fan_courier

FanCourier::endBorderou()

Will close all orders made for the current date.

FanCourier::endBorderou()

**The endBorderou() method will return a html **

Exceptions

The FanCourier package will throw exceptions if something goes wrong. This way it's easier to debug your code using the FanCourier package or to handle the error based on the type of exceptions. The FanCourier packages can throw the following exceptions:

Exception
FanCourierInstanceException
FanCourierInvalidParamException
FanCourierUnknownModelException

Example

FanCourier::city() To fetch specific county

FanCourier::city(['judet'=>'Constanta', 'language'=>'RO'])

or to fetch all counties

FanCourier::city()

FanCourier::streets() To fetch specific county

FanCourier::streets(['judet'=>'Bucuresti', 'localitate'=>'Bucuresti', 'language'=>'RO'])

or to fetch all streets from Romania

FanCourier::streets()

FanCourier::price() Internal service

FanCourier::price([
    'serviciu' => 'standard',
    'localitate_dest' => 'Targu Mures',
    'judet_dest' => 'Mures',
    'plicuri' => 1,
    'colete' => 2,
    'greutate' => 5,
    'lungime' => 10,
    'latime' => 10,
    'inaltime' => 10,
    'val_decl' => 600,
    'plata_ramburs' => 'destinatar',
    'plata_la' => 'destinatar',
])

External service

FanCourier::price([
    'serviciu' => 'export',
    'modtrim' => 'rutier', //aerian
    'greutate' => 10.22,
    'pliccolet' => 3,
    's_inaltime' => 50,
    's_latime' => 67,
    's_lungime' => 48,
    'volum' => 400,
    'dest_tara' => 'Bulgaria',
    'tipcontinut' => 1,
    'km_ext' => 400,
    'plata_la' => 'destinatar',
])

FanCourier::order() Internal service

FanCourier::generateAwb(['fisier' => [
    [
        'tip_serviciu' => 'standard', 
        'banca' => '',
        'iban' =>  '',
        'nr_plicuri' => 1,
        'nr_colete' => 0,
        'greutate' => 1,
        'plata_expeditie' => 'ramburs',
        'ramburs_bani' => 100,
        'plata_ramburs_la' => 'destinatar',
        'valoare_declarata' => 400,
        'persoana_contact_expeditor' => 'Test User',
        'observatii' => 'Lorem ipsum',
        'continut' => '',
        'nume_destinar' => 'Test',
        'persoana_contact' => 'Test',
        'telefon' => '123456789',
        'fax' => '123456789',
        'email' => 'example@example.com',
        'judet' => 'Galati',
        'localitate' => 'Tecuci',
        'strada' => 'Lorem',
        'nr' => '2',
        'cod_postal' => '123456',
        'bl' => '',
        'scara' => '',
        'etaj'  => '',
        'apartament' => '',
        'inaltime_pachet' => '',
        'lungime_pachet' => '',
        'restituire' => '',
        'centru_cost' => '',
        'optiuni' => '',
        'packing' => '',
        'date_personale' => ''
    ],
    [
        'tip_serviciu' => 'Cont colector',
        'banca' => 'Test',
        'iban' =>  'XXXXXX',
        'nr_plicuri' => 0,
        'nr_colete' => 1,
        'greutate' => 1,
        'plata_expeditie' => 'ramburs',
        'ramburs_bani' => 400,
        'plata_ramburs_la' => 'destinatar',
        'valoare_declarata' => 400,
        'persoana_contact_expeditor' => 'Test User',
        'observatii' => 'Lorem ipsum',
        'continut' => 'Fragil',
        'nume_destinar' => 'Test',
        'persoana_contact' => 'Test',
        'telefon' => '123456789',
        'fax' => '123456789',
        'email' => 'example@example.com',
        'judet' => 'Galati',
        'localitate' => 'Tecuci',
        'strada' => 'Lorem',
        'nr' => '2',
        'cod_postal' => '123456',
        'bl' => '',
        'scara' => '',
        'etaj'  => '',
        'apartament' => '',
        'inaltime_pachet' => '',
        'lungime_pachet' => '',
        'restituire' => '',
        'centru_cost' => '',
        'optiuni' => '',
        'packing' => '',
        'date_personale' => ''
    ]
]])

FanCourier::trackAwb()

FanCourier::trackAwb([
    'AWB'=>'2337600120003', 
    'display_mode' => 3 //1 – last status, 2 – last record from history route, 3 – all history of the expedition
])

FanCourier::order() Internal service

FanCourier::order([
    'nr_colete' => 1, // or 'nr_plicuri' => 1
    'pers_contact' => 'Test',
    'tel' => 123456789,
    'email' => 'example@example.com',
    'greutate' => 1,
    'inaltime' => 10,
    'lungime' => 10,
    'latime' => 10,
    'ora_ridicare' => '18:00',
    'observatii' => '',
    'client_exp' => 'Test',
    'strada' => 'Test',
    'nr' => 1,
    'bloc' => 2,
    'scara' => 3,
    'etaj' => 7,
    'ap' => 78,
    'localitate' => 'Constanta',
    'judet' => 'Constanta',
])

FanCourier::exportServices()

FanCourier::exportServices()

FanCourier::exportAwbErrors()

FanCourier::exportAwbErrors()

FanCourier::getAwb()

FanCourier::getAwb([
    'nr'=>'2337600120003', //AWB
])

FanCourier::downloadAwb()

FanCourier::downloadAwb([
    'AWB'=>'2337600120003',
])

FanCourier::exportOrders()

FanCourier::exportOrders(['data'=>'09.12.2016'])

FanCourier::exportBorderou()

FanCourier::exportBorderou(['data'=>'09.12.2016', 'mode'=> 0])

FanCourier::exportReports()

FanCourier::exportReports(['data'=>'09.12.2016'])

FanCourier::exportObservations()

FanCourier::exportObservations()

FanCourier::endBorderou()

FanCourier::endBorderou()

necenzurat/fancourier 适用场景与选型建议

necenzurat/fancourier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 necenzurat/fancourier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 necenzurat/fancourier 我们能提供哪些服务?
定制开发 / 二次开发

基于 necenzurat/fancourier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-20