From 21d2c71bc3718ff78605a7fb9900980191237407 Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Fri, 24 Nov 2023 15:09:16 +0300 Subject: [PATCH 1/6] Implement acceptOrder and seperateCombineItems --- IS/PazarYeri/N11/Services/OrderService.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/IS/PazarYeri/N11/Services/OrderService.php b/IS/PazarYeri/N11/Services/OrderService.php index 235570b..c3841c6 100644 --- a/IS/PazarYeri/N11/Services/OrderService.php +++ b/IS/PazarYeri/N11/Services/OrderService.php @@ -85,4 +85,47 @@ public function orderDetail($client, $Id) } + /** + * + * @description Sipariş N11 ID bilgisi kullanarak sipariş detaylarını almak için kullanılır, + * sipariş N11 ID bilgisine orderList metotlarıyla ulaşılabilir. + * + * + * $payload = [ + * 'numberOfPackages' => '1', + * ]; + * foreach ($orderItems as $item) { + * $payload['orderItemList']['orderItem'][] = [ + * 'id' => $item['id'], + * ]; + * } + * + * @param $client Request + * @param $data array{numberOfPackages: int,orderItemList: array{orderItem: array{id: int}} + */ + public function acceptOrder($client, $data) + { + return $client->sendRequest('OrderItemAccept', $data); + } + + /** + * + * @description Sipariş N11 ID bilgisi kullanarak sipariş detaylarını almak için kullanılır, + * sipariş N11 ID bilgisine orderList metotlarıyla ulaşılabilir. + * + * + * $payload = []; + * foreach ($orderItems as $item) { + * $payload['orderItemList']['orderItem'][] = [ + * 'id' => $item['id'], + * ]; + * } + * + * @param $client Request + * @param $data array{orderItemList: array{orderItem: array{id: int}} + */ + public function seperateCombinedItems($client, $data) + { + return $client->sendRequest('SeperateCombinedItems', $data); + } } \ No newline at end of file From e554db3b7faf9c1f016244a6fbe9ed1b172e08d8 Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Fri, 24 Nov 2023 15:21:30 +0300 Subject: [PATCH 2/6] Change package name to use with composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7a75dbb..1df3028 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "ismail0234/n11-php-api", + "name": "umutkorkmaaz/n11-php-api", "description": "N11 PHP API", "type": "library", "keywords": ["n11", "eticaret", "php api", "n11 php api", "pazaryeri"], From b8a092a06ff3822cdbcd95faed82f490c3540d3f Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Sat, 25 Nov 2023 22:08:49 +0300 Subject: [PATCH 3/6] Create SellerInvoiceService --- .../N11/Services/SellerInvoiceService.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 IS/PazarYeri/N11/Services/SellerInvoiceService.php diff --git a/IS/PazarYeri/N11/Services/SellerInvoiceService.php b/IS/PazarYeri/N11/Services/SellerInvoiceService.php new file mode 100644 index 0000000..76bf4ec --- /dev/null +++ b/IS/PazarYeri/N11/Services/SellerInvoiceService.php @@ -0,0 +1,37 @@ +sendRequest('saveLinkSellerInvoice', $data); + } + + +} \ No newline at end of file From 86d050d2ccc1939ae68b474d3ceb14a00f3edae2 Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Sat, 25 Nov 2023 22:09:05 +0300 Subject: [PATCH 4/6] Add SellerInvoiceService to Gateway --- IS/PazarYeri/N11/Helper/Gateway.php | 1 + 1 file changed, 1 insertion(+) diff --git a/IS/PazarYeri/N11/Helper/Gateway.php b/IS/PazarYeri/N11/Helper/Gateway.php index 104bc73..7d207f7 100644 --- a/IS/PazarYeri/N11/Helper/Gateway.php +++ b/IS/PazarYeri/N11/Helper/Gateway.php @@ -36,6 +36,7 @@ 'stock' => 'ProductStockService', 'order' => 'OrderService', 'webhook' => 'WebHookService', + 'invoice' => 'SellerInvoiceService' ); /** From 0397898b67ec214aba93d9c4e7884258fe2bab9f Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Sat, 25 Nov 2023 22:12:17 +0300 Subject: [PATCH 5/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1df3028..7a75dbb 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "umutkorkmaaz/n11-php-api", + "name": "ismail0234/n11-php-api", "description": "N11 PHP API", "type": "library", "keywords": ["n11", "eticaret", "php api", "n11 php api", "pazaryeri"], From d994f965b933226b4540b8dac9ca01183d082147 Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Sat, 25 Nov 2023 22:34:43 +0300 Subject: [PATCH 6/6] Doc updates --- IS/PazarYeri/N11/Services/OrderService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IS/PazarYeri/N11/Services/OrderService.php b/IS/PazarYeri/N11/Services/OrderService.php index c3841c6..4213683 100644 --- a/IS/PazarYeri/N11/Services/OrderService.php +++ b/IS/PazarYeri/N11/Services/OrderService.php @@ -87,8 +87,7 @@ public function orderDetail($client, $Id) /** * - * @description Sipariş N11 ID bilgisi kullanarak sipariş detaylarını almak için kullanılır, - * sipariş N11 ID bilgisine orderList metotlarıyla ulaşılabilir. + * @description Bu metot yeni siparişleri kabul etmek için kullanılmaktadır. * * * $payload = [ @@ -110,8 +109,9 @@ public function acceptOrder($client, $data) /** * - * @description Sipariş N11 ID bilgisi kullanarak sipariş detaylarını almak için kullanılır, - * sipariş N11 ID bilgisine orderList metotlarıyla ulaşılabilir. + * @description Bu metot siparişin kalemlerini bölmek için kullanılmaktadır. + * Bu metot içerisinde verilen orderItemList'ler yeni bir order + * oluşturur. * * * $payload = [];