作者 竞泽

docs

广州单一窗口
广州单一窗口(订单上报)
===
* example
### install
```
composer require lackoxygen/gz-cbec
```
### git
```
http://47.107.73.162:8099/lackoxygen/gz-cbec.git
```
### 配置仓库
```
{
"type": "git",
"url": "http://47.107.73.162:8099/lackoxygen/gz-cbec.git"
}
```
### 配置文件
```
php artisan vendor:publish --tag=lackoxygen-min-payment
```
### 示例
```
$message = new CEB311Message;
... ... @@ -11,9 +38,7 @@
$baseTransfer->setDxpId('dxpId');
$baseTransfer->setDxpMode('DxpMode');
$baseTransfer->setNote('测试');
$order = new Order();
$order = new Order;
$orderHead = new OrderHead;
$orderHead->setGuid(\Str::uuid()->toString());
$orderHead->setAppTime(Carbon::now()->getPreciseTimestamp(4));
... ... @@ -32,12 +57,10 @@
$orderHead->setActuralPaid("20");
$orderHead->setCurrency("142");
$orderHead->setBuyerRegNo("9416");
$orderHead->setBuyerName("张文龙");
$orderHead->setBuyerName("xx");
$orderHead->setBuyerIdType("1");
$orderHead->setBuyerIdNumber("445322199402212519");
$orderHead->setBuyerIdNumber("身份证");
$orderHead->setNote("测试");
$orderHead->setPayName("支付宝");
$orderHead->setPayTransactionId("201907311451410688620491");
$orderHead->setBatchNumbers("1232312335");
... ... @@ -46,8 +69,7 @@
$orderHead->setConsigneeAddress("广东省番禺区天安科技园");
//$orderHead->setConsigneeDistrict("");
//$orderHead->setNote("");
$orderList = new OrderList();
$orderList = new OrderList;
$orderList->setGnum(1);
$orderList->setItemNo('3306');
$orderList->setItemName("日本 SANA莎娜 豆乳乳液-测试-02007381");
... ... @@ -59,16 +81,11 @@
$orderList->setTotalPrice(100);
$orderList->setCurrency('142');
$orderList->setCountry("ABW000");
$order->setOrderHead($orderHead);
$order->pushOrderList($orderList);
$order->pushOrderList($orderList);
$message->setOrder($order);
$message->setBaseTransfer($baseTransfer);
$obj = new GzCBEC();
$obj = new GzCBEC;
$xml = $obj->report()->CEB311Message($message);
```
... ...
... ... @@ -24,7 +24,7 @@
"extra": {
"laravel": {
"providers": [
"Lackoxygen\\GzCbec\\GzCBECServiceProvider"
"Lackoxygen\\Customs\\GzCBECProvider"
]
}
}
... ...
... ... @@ -6,7 +6,7 @@ namespace Lackoxygen\GzCbec;
use Illuminate\Support\ServiceProvider;
class GzCBECServiceProvider extends ServiceProvider
class GzCBECProvider extends ServiceProvider
{
public function boot()
... ...
... ... @@ -13,11 +13,11 @@ class Collection extends BaseCollection
/**
* @param $method
* @param $value
* @param bool $lcfirst
* @param bool $lcFirst
*/
public function mSet($method, $value, $lcfirst = true)
public function mSet($method, $value, bool $lcFirst = true)
{
parent::offsetSet($this->subKey($method, 3, $lcfirst), $value);
parent::offsetSet($this->subKey($method, 3, $lcFirst), $value);
}
/**
... ... @@ -49,15 +49,15 @@ class Collection extends BaseCollection
/**
* @param string $key
* @param int $offset
* @param bool $lcfirst
* @param bool $lcFirst
*
* @return string
*/
public function subKey(string $key, int $offset = 0, $lcfirst = true): string
public function subKey(string $key, int $offset = 0, bool $lcFirst = true): string
{
$afterKey = substr($key, $offset);
if ($lcfirst) {
if ($lcFirst) {
return lcfirst($afterKey);
}
... ...