1 | <?php |
||
10 | class Product extends Service implements ProductInterface |
||
11 | { |
||
12 | |||
13 | public const ACTIVE = "Active"; |
||
14 | public const SUSPENDED = "Suspended"; |
||
15 | public const PROHIBITED = "Prohibited"; |
||
16 | public const UNLISTED = "Unlisted"; |
||
17 | public const WAITING_FOR_APPROVAL = "WaitingForApproval"; |
||
18 | public const REJECTED = "Rejected"; |
||
19 | public const UNAPPROVED_UPDATE = "UnapprovedUpdate"; |
||
20 | |||
21 | public const DISCOUNT_AMOUNT = 1; |
||
22 | public const DISCOUNT_PERCENT = 2; |
||
23 | public const DISCOUNTED_PRICE = 3; |
||
24 | |||
25 | public const TL = 1; |
||
26 | public const USD = 2; |
||
27 | public const EURO = 3; |
||
28 | |||
29 | /** |
||
30 | * @var SoapClient|null |
||
31 | */ |
||
32 | private $_client; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $endPoint = "/ProductService.wsdl"; |
||
38 | |||
39 | /** |
||
40 | * City constructor |
||
41 | * @throws N11Exception|\SoapFault |
||
42 | */ |
||
43 | public function __construct() |
||
48 | |||
49 | /** |
||
50 | * @param int $productId |
||
51 | * @return object |
||
52 | * @description N11 ürün ID sini kullanarak sistemde kayıtlı olan ürünün bilgilerini getirir. |
||
53 | */ |
||
54 | public function getProductByProductId(int $productId): object |
||
59 | |||
60 | /** |
||
61 | * @param string $productSellerCode |
||
62 | * @return object |
||
63 | * @description Mağaza ürün kodunu kullanarak sistemde kayıtlı olan ürünün bilgilerini getirir. |
||
64 | */ |
||
65 | public function getProductBySellerCode(string $productSellerCode): object |
||
70 | |||
71 | /** |
||
72 | * @param int $currentPage |
||
73 | * @param int $pageSize |
||
74 | * @return object |
||
75 | */ |
||
76 | public function getProductList(int $currentPage = 1, int $pageSize = self::GENERAL_LIMIT): object |
||
84 | |||
85 | /** |
||
86 | * @param array $data |
||
87 | * @return object |
||
88 | * @description Yeni ürün oluşturmak veya mevcut ürünü güncellemek için kullanılır. |
||
89 | * Ürün kodu “productSellerCode” adıyla veirlen data bu mağaza için bir kayıtlı bir ürünü gösteriyorsa bu ürün güncellenir, aksi halde yeni bir ürün oluşturulur. |
||
90 | */ |
||
91 | public function saveProduct(array $data): object |
||
96 | |||
97 | /** |
||
98 | * @param int $currentPage |
||
99 | * @param int $pageSize |
||
100 | * @param string|null $keyword |
||
101 | * @param null $saleStartDate |
||
102 | * @param null $saleEndDate |
||
103 | * @param string $approvalStatus |
||
104 | * @return object |
||
105 | * @description Mağaza ürünlerini aramak için kullanılır. |
||
106 | */ |
||
107 | public function searchProducts(int $currentPage = 1, int $pageSize = self::GENERAL_LIMIT, string $keyword = null, $saleStartDate = null, $saleEndDate = null, $approvalStatus = self::ACTIVE): object |
||
123 | |||
124 | /** |
||
125 | * @param int $productId |
||
126 | * @return object |
||
127 | * @description Kayıtlı olan bir ürünü N11 Id si kullanarak silmek için kullanılır. |
||
128 | */ |
||
129 | public function deleteProductById(int $productId): object |
||
134 | |||
135 | /** |
||
136 | * @param string $productSellerCode |
||
137 | * @return object |
||
138 | * @description Kayıtlı olan bir ürünü mağaza ürün kodu kullanılarak silmek için kullanılır. |
||
139 | */ |
||
140 | public function deleteProductBySellerCode(string $productSellerCode): object |
||
145 | |||
146 | /** |
||
147 | * @param int $productId |
||
148 | * @param int $discountType |
||
149 | * @param float|int $discountValue |
||
150 | * @param string|null $startDate |
||
151 | * @param string|null $endDate |
||
152 | * @return object |
||
153 | * @description Bir ürünün N11 ürün ID sini kullanarak indirim bilgilerinin güncellenmesi için kullanılır. |
||
154 | * Girilen indirim miktarı ürün listeleme fiyatına uygulanır. |
||
155 | * Liste fiyatı ile ürünün indirimli fiyatı arasındaki fark kadar ürün stok birim fiyatlarına da indirim uygulanır. |
||
156 | */ |
||
157 | public function updateDiscountValueByProductId(int $productId, int $discountType = self::DISCOUNT_AMOUNT, float $discountValue = 0, string $startDate = null, string $endDate = null): object |
||
168 | |||
169 | /** |
||
170 | * @param string $productSellerCode |
||
171 | * @param int $discountType |
||
172 | * @param float|int $discountValue |
||
173 | * @param string|null $startDate |
||
174 | * @param string|null $endDate |
||
175 | * @return object |
||
176 | * @description Bir ürünün mağaza ürün kodunu kullanarak indirim bilgilerinin güncellenmesi için kullanılır. |
||
177 | * Girilen indirim miktarı ürün listeleme fiyatına uygulanır. |
||
178 | * Liste fiyatı ile ürünün indirimli fiyatı arasındaki fark kadar ürün stok birim fiyatlarına da indirim uygulanır. |
||
179 | */ |
||
180 | public function updateDiscountValueByProductSellerCode(string $productSellerCode, int $discountType = self::DISCOUNT_AMOUNT, float $discountValue = 0, string $startDate = null, string $endDate = null): object |
||
191 | |||
192 | /** |
||
193 | * @param int $productId |
||
194 | * @param float $price |
||
195 | * @param int $currencyType |
||
196 | * @param string|null $sellerStockCode |
||
197 | * @param float|null $optionPrice |
||
198 | * @return object |
||
199 | * @description Bir ürünün N11 ürün ID si kullanılarak ürünün sadece baz fiyat bilgilerini, |
||
200 | * ürün stok birimi fiyat bilgilerini veya her ikisinin güncellenmesi için kullanılır. |
||
201 | */ |
||
202 | public function updateProductPriceById(int $productId, float $price, $currencyType = self::TL, string $sellerStockCode = null, float $optionPrice = null): object |
||
217 | |||
218 | /** |
||
219 | * @param string $productSellerCode |
||
220 | * @param float $price |
||
221 | * @param int $currencyType |
||
222 | * @param string|null $sellerStockCode |
||
223 | * @param float|null $optionPrice |
||
224 | * @return object |
||
225 | * @description Bir ürünün N11 ürün ID si kullanılarak ürünün sadece baz fiyat bilgilerini, |
||
226 | * ürün stok birimi fiyat bilgilerini veya her ikisinin güncellenmesi için kullanılır. |
||
227 | */ |
||
228 | public function updateProductPriceBySellerCode(string $productSellerCode, float $price, $currencyType = self::TL, string $sellerStockCode = null, float $optionPrice = null): object |
||
243 | |||
244 | /** |
||
245 | * @param array $data |
||
246 | * @return object |
||
247 | * @description Kayıtlı olan bir ürünün, N11 ürün ID’si ya da mağaza kodu ile ürün fiyatını, ürün üzerindeki indirimi ve isteğe bağlı olarak stok ID’si ya da mağaza stok kodu ile belirtilen stoklarının, miktarı ve ilgili stok biriminin liste fiyatının güncellenmesi için kullanılır. |
||
248 | */ |
||
249 | public function updateProductBasic(array $data): object |
||
272 | |||
273 | /** |
||
274 | * @param int $productId |
||
275 | * @param string $buyerEmail |
||
276 | * @param string $subject |
||
277 | * @param $status |
||
278 | * @param string $questionDate |
||
279 | * @param int $currentPage |
||
280 | * @param int $pageSize |
||
281 | * @return object |
||
282 | * @description Müşterileriniz tarafından mağazanıza sorulan soruları listeler. |
||
283 | * Sorularınızı listelemek için Appkey ve Appsecret bilgileriniz gerekmektedir. |
||
284 | */ |
||
285 | public function getProductQuestionList(int $productId, string $buyerEmail, string $subject, $status, string $questionDate, int $currentPage = 1, int $pageSize = self::GENERAL_LIMIT): object { |
||
297 | |||
298 | /** |
||
299 | * @param int $productQuestionId |
||
300 | * @return object |
||
301 | * @description GetProductQuestionList ile sıralanan soruların içeriğini, buradan gelen ID ve getProductQuestionDetail yardımıyla görüntüleyebilirsiniz. |
||
302 | */ |
||
303 | public function getProductQuestionDetail(int $productQuestionId): object { |
||
307 | |||
308 | /** |
||
309 | * @param int $productQuestionId |
||
310 | * @param string $productAnswer |
||
311 | * @return object |
||
312 | * @description Müşterilerden gelen ürün sorularını cevaplamak için kullanılır. |
||
313 | * Cevap vermek için productQuestionId değeri zorunludur ve GetProductQuestionList‘ten id edinilebilir. |
||
314 | */ |
||
315 | public function saveProductAnswer(int $productQuestionId, string $productAnswer): object { |
||
320 | |||
321 | /** |
||
322 | * @return object |
||
323 | * @description Seller ın sahip olduğu tüm ürünleri, ait olduğu statülere göre sınıflandırıp, statü/sayı bilgisi döner. |
||
324 | * Seller a göre cevap döndüğü için istekte sadece authorization olması yeterlidir. |
||
325 | * Her bir seller maksimum 3 kez istek gönderebilir. |
||
326 | */ |
||
327 | public function productAllStatusCountsRequest(): object { |
||
330 | |||
331 | } |
||
332 |