作者 竞泽

docs

1 -广州单一窗口 1 +广州单一窗口(订单上报)
2 === 2 ===
3 3
4 -* example 4 +### install
  5 +
  6 +```
  7 +composer require lackoxygen/gz-cbec
  8 +```
  9 +
  10 +### git
  11 +
  12 +```
  13 +http://47.107.73.162:8099/lackoxygen/gz-cbec.git
  14 +```
  15 +
  16 +### 配置仓库
  17 +
  18 +```
  19 +{
  20 + "type": "git",
  21 + "url": "http://47.107.73.162:8099/lackoxygen/gz-cbec.git"
  22 +}
  23 +```
  24 +
  25 +### 配置文件
  26 +
  27 +```
  28 +php artisan vendor:publish --tag=lackoxygen-min-payment
  29 +```
  30 +
  31 +### 示例
5 32
6 ``` 33 ```
7 $message = new CEB311Message; 34 $message = new CEB311Message;
@@ -11,9 +38,7 @@ @@ -11,9 +38,7 @@
11 $baseTransfer->setDxpId('dxpId'); 38 $baseTransfer->setDxpId('dxpId');
12 $baseTransfer->setDxpMode('DxpMode'); 39 $baseTransfer->setDxpMode('DxpMode');
13 $baseTransfer->setNote('测试'); 40 $baseTransfer->setNote('测试');
14 -  
15 - $order = new Order();  
16 - 41 + $order = new Order;
17 $orderHead = new OrderHead; 42 $orderHead = new OrderHead;
18 $orderHead->setGuid(\Str::uuid()->toString()); 43 $orderHead->setGuid(\Str::uuid()->toString());
19 $orderHead->setAppTime(Carbon::now()->getPreciseTimestamp(4)); 44 $orderHead->setAppTime(Carbon::now()->getPreciseTimestamp(4));
@@ -32,12 +57,10 @@ @@ -32,12 +57,10 @@
32 $orderHead->setActuralPaid("20"); 57 $orderHead->setActuralPaid("20");
33 $orderHead->setCurrency("142"); 58 $orderHead->setCurrency("142");
34 $orderHead->setBuyerRegNo("9416"); 59 $orderHead->setBuyerRegNo("9416");
35 - $orderHead->setBuyerName("张文龙"); 60 + $orderHead->setBuyerName("xx");
36 $orderHead->setBuyerIdType("1"); 61 $orderHead->setBuyerIdType("1");
37 - $orderHead->setBuyerIdNumber("445322199402212519"); 62 + $orderHead->setBuyerIdNumber("身份证");
38 $orderHead->setNote("测试"); 63 $orderHead->setNote("测试");
39 -  
40 -  
41 $orderHead->setPayName("支付宝"); 64 $orderHead->setPayName("支付宝");
42 $orderHead->setPayTransactionId("201907311451410688620491"); 65 $orderHead->setPayTransactionId("201907311451410688620491");
43 $orderHead->setBatchNumbers("1232312335"); 66 $orderHead->setBatchNumbers("1232312335");
@@ -46,8 +69,7 @@ @@ -46,8 +69,7 @@
46 $orderHead->setConsigneeAddress("广东省番禺区天安科技园"); 69 $orderHead->setConsigneeAddress("广东省番禺区天安科技园");
47 //$orderHead->setConsigneeDistrict(""); 70 //$orderHead->setConsigneeDistrict("");
48 //$orderHead->setNote(""); 71 //$orderHead->setNote("");
49 -  
50 - $orderList = new OrderList(); 72 + $orderList = new OrderList;
51 $orderList->setGnum(1); 73 $orderList->setGnum(1);
52 $orderList->setItemNo('3306'); 74 $orderList->setItemNo('3306');
53 $orderList->setItemName("日本 SANA莎娜 豆乳乳液-测试-02007381"); 75 $orderList->setItemName("日本 SANA莎娜 豆乳乳液-测试-02007381");
@@ -59,16 +81,11 @@ @@ -59,16 +81,11 @@
59 $orderList->setTotalPrice(100); 81 $orderList->setTotalPrice(100);
60 $orderList->setCurrency('142'); 82 $orderList->setCurrency('142');
61 $orderList->setCountry("ABW000"); 83 $orderList->setCountry("ABW000");
62 -  
63 $order->setOrderHead($orderHead); 84 $order->setOrderHead($orderHead);
64 $order->pushOrderList($orderList); 85 $order->pushOrderList($orderList);
65 $order->pushOrderList($orderList); 86 $order->pushOrderList($orderList);
66 -  
67 $message->setOrder($order); 87 $message->setOrder($order);
68 $message->setBaseTransfer($baseTransfer); 88 $message->setBaseTransfer($baseTransfer);
69 - $obj = new GzCBEC();  
70 - 89 + $obj = new GzCBEC;
71 $xml = $obj->report()->CEB311Message($message); 90 $xml = $obj->report()->CEB311Message($message);
72 -  
73 -  
74 ``` 91 ```
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 "extra": { 24 "extra": {
25 "laravel": { 25 "laravel": {
26 "providers": [ 26 "providers": [
27 - "Lackoxygen\\GzCbec\\GzCBECServiceProvider" 27 + "Lackoxygen\\Customs\\GzCBECProvider"
28 ] 28 ]
29 } 29 }
30 } 30 }
@@ -6,7 +6,7 @@ namespace Lackoxygen\GzCbec; @@ -6,7 +6,7 @@ namespace Lackoxygen\GzCbec;
6 6
7 use Illuminate\Support\ServiceProvider; 7 use Illuminate\Support\ServiceProvider;
8 8
9 -class GzCBECServiceProvider extends ServiceProvider 9 +class GzCBECProvider extends ServiceProvider
10 { 10 {
11 11
12 public function boot() 12 public function boot()
@@ -13,11 +13,11 @@ class Collection extends BaseCollection @@ -13,11 +13,11 @@ class Collection extends BaseCollection
13 /** 13 /**
14 * @param $method 14 * @param $method
15 * @param $value 15 * @param $value
16 - * @param bool $lcfirst 16 + * @param bool $lcFirst
17 */ 17 */
18 - public function mSet($method, $value, $lcfirst = true) 18 + public function mSet($method, $value, bool $lcFirst = true)
19 { 19 {
20 - parent::offsetSet($this->subKey($method, 3, $lcfirst), $value); 20 + parent::offsetSet($this->subKey($method, 3, $lcFirst), $value);
21 } 21 }
22 22
23 /** 23 /**
@@ -49,15 +49,15 @@ class Collection extends BaseCollection @@ -49,15 +49,15 @@ class Collection extends BaseCollection
49 /** 49 /**
50 * @param string $key 50 * @param string $key
51 * @param int $offset 51 * @param int $offset
52 - * @param bool $lcfirst 52 + * @param bool $lcFirst
53 * 53 *
54 * @return string 54 * @return string
55 */ 55 */
56 - public function subKey(string $key, int $offset = 0, $lcfirst = true): string 56 + public function subKey(string $key, int $offset = 0, bool $lcFirst = true): string
57 { 57 {
58 $afterKey = substr($key, $offset); 58 $afterKey = substr($key, $offset);
59 59
60 - if ($lcfirst) { 60 + if ($lcFirst) {
61 return lcfirst($afterKey); 61 return lcfirst($afterKey);
62 } 62 }
63 63