selltag/nacex-bundle
Composer 安装命令:
composer require selltag/nacex-bundle
包简介
This module provides a client service for the Nacex SOAP server
README 文档
README
This Bundle provides a client to access the Nacex SOAP API.
Installation
-
Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require selltag/nacex-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
-
Enable the Bundle
Add the following line in the
app/AppKernel.phpfile to enable this bundle:<?php // app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Selltag\NacexBundle\SelltagNacexBundle() // ... ) return $bundles; } // ... }
-
Enable the
nacexservice adding the following configuration:# app/config/config.yml selltag_nacex: nacex_password: %nacex_username% nacex_password: %nacex_password% nacex_url: %nacex_url%
-
You can define these parameters in your
parameters.yml:# app/config/parameters.yml.dist nacex_username: MYUSERNAME nacex_password: MYPASSWORD nacex_url: http://gprs.nacex.com/nacex_ws/soap
Tests
You can run the tests using:
phpunit
I couldn't make tests for the NacexClient class because I don't have credentials anymore and I can't get a response soap to use as reference. If you find any errors, you can send me the SOAP response so I could also make tests for that part, thank you!
Use example on Symfony
$nacexClient = $this->getContainer() ->get('selltag_nacex.nacex_client'); $data = array( 'reco_codigo' => null, 'Del_Sol' => '0001', 'Num_Rec' => '123456', 'ref' => null ); $result = $nacexClient->putRecogida($data); $recogida = array( 'code' => $result[0], 'date' => $result[1], 'time' => $result[2], 'observation' => $result[3], 'status' => $result[4], 'status_code' => $result[5] );
Use example without using Symfony
use Selltag\NacexBundle\Services\NacexClientService; $nacexClient = new NacexClientService( $nacexUser, $nacexPassword, $nacexUrl ); $data = array( 'reco_codigo' => null, 'Del_Sol' => '0001', 'Num_Rec' => '123456', 'ref' => null ); $result = $nacexClient->putRecogida($data); $recogida = array( 'code' => $result[0], 'date' => $result[1], 'time' => $result[2], 'observation' => $result[3], 'status' => $result[4], 'status_code' => $result[5] );
NacexException
If the Nacex SOAP response returns any errors, a NacexClientException
exception is raised, you can treat It accordingly for you project.
use Selltag\NacexBundle\Exceptions\NacexClientException;
selltag/nacex-bundle 适用场景与选型建议
selltag/nacex-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 366 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「nacex」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 selltag/nacex-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 selltag/nacex-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 selltag/nacex-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
Client for Google Directions API to add interpolated points to a route consisting of given coordinates.
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
Last.fm API client for Laravel 7-13
统计信息
- 总下载量: 366
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-18