├── .gitignore ├── src ├── GittigidiyorException.php ├── Facades │ └── Gittigidiyor.php ├── GittigidiyorServiceProvider.php └── Gittigidiyor.php └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /composer.lock -------------------------------------------------------------------------------- /src/GittigidiyorException.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Facades/Gittigidiyor.php: -------------------------------------------------------------------------------- 1 | =5.4.0", 14 | "illuminate/support": "~5.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "SM\\Gittigidiyor\\": "src" 19 | } 20 | }, 21 | "minimum-stability": "dev" 22 | } 23 | -------------------------------------------------------------------------------- /src/GittigidiyorServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('gittigidiyor', function(){ 27 | return new Gittigidiyor(config('app.gittigidiyor')); 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Gittigidiyor.php: -------------------------------------------------------------------------------- 1 | checkConfig($conf)){ 22 | 23 | list($usec, $sec) = explode(" ", microtime()); 24 | $this->time = round(((float)$usec + (float)$sec) * 100).'0'; 25 | $this->sign = md5($this->apiKey.$this->secretKey.$this->time); 26 | 27 | } 28 | 29 | } 30 | 31 | private function checkConfig($conf){ 32 | 33 | if(!isset($conf['apikey']) || 34 | !isset($conf['secret_key']) || 35 | !isset($conf['nick']) || 36 | !isset($conf['password']) || 37 | !isset($conf['auth_user']) || 38 | !isset($conf['auth_password']) || 39 | !isset($conf['lang'])) { 40 | 41 | throw new GittigidiyorException("GittiGidiyor Ayarları Girilmedi"); 42 | 43 | } else { 44 | $this->apiKey = $conf['apikey']; 45 | $this->secretKey = $conf['secret_key']; 46 | $this->nick = $conf['nick']; 47 | $this->password = $conf['password']; 48 | $this->auth_user = $conf['auth_user']; 49 | $this->auth_pass = $conf['auth_password']; 50 | $this->lang = $conf['lang']; 51 | return true; 52 | } 53 | } 54 | 55 | //Start Application Service 56 | 57 | /** 58 | * API kullanıcisinin sisteme kendini gelistirici olarak kaydettirmesi icin cagirmasi gereken metoddur. 59 | * 60 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/registerDeveloper-DeveloperService-soap-anonymous 61 | * 62 | * Developer Service 63 | * Register Developer Method 64 | * 65 | * @param string $nick 66 | * @param string $password 67 | * 68 | * @return Web Servis mesajini object olarak dondurur 69 | */ 70 | public function registerDeveloper($nick = null, $password = null) { 71 | return $this->clientConnect('anonymous','Developer','registerDeveloper',get_defined_vars()); 72 | } 73 | 74 | 75 | /** 76 | * API kullanicisinin sisteme kayitli olup olmadigini ogrenmek icin cagirmasi gereken metoddur. 77 | * 78 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/isDeveloper-DeveloperService-soap-anonymous 79 | * 80 | * Developer Service 81 | * Is Developer Method 82 | * 83 | * @param string $nick 84 | * @param string $password 85 | * 86 | * @return Web Servis mesajini object olarak dondurur 87 | */ 88 | public function isDeveloper($nick = '',$password = ''){ 89 | return $this->clientConnect('anonymous','Developer','isDeveloper',get_defined_vars()); 90 | } 91 | 92 | 93 | /** 94 | * API kullanicisinin gelistirici anahtarini hatirlayamadigi durumlarda cagirmasi gereken metoddur. 95 | * 96 | * Developer Service 97 | * Is Developer Method 98 | * 99 | * @param string $nick 100 | * 101 | * @return integer developer id 102 | */ 103 | public function getDeveloperId(){ 104 | $parameters = array('nick'=>$this->nick,'password' => $this->password); 105 | $result = $this->clientConnect('anonymous','Developer','isDeveloper',$parameters); 106 | return $result->developerId; 107 | } 108 | 109 | //End Application Service 110 | 111 | 112 | 113 | 114 | 115 | //Start Developer Service 116 | 117 | /** 118 | * API kullanicinin kendisini gelistirici olarak sisteme kaydettirmesinin ardindan 119 | * uygulama tanimlayabilmesi icin cagirmasi gereken metoddur. 120 | * Bir gelistirici sahip oldugu gelistirici anahtari ile en fazla 5 tane uygulama yaratabilir. 121 | * 122 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/createApplication-ApplicationService-soap-anonymous 123 | * 124 | * Application Service 125 | * Create Aplication Method 126 | * 127 | * @param integer $developerId 128 | * @param string $applicationName 129 | * @param string $description 130 | * @param string $accessType 131 | * @param string $appType 132 | * @param string $descDetail 133 | * 134 | * @return Web Servis mesajini object olarak dondurur 135 | */ 136 | public function createApplication($developerId = null, 137 | $applicationName = null, 138 | $description = null, 139 | $accessType = null, 140 | $appType = null, 141 | $descDetail = null){ 142 | return $this->clientConnect('anonymous','Application','createApplication',get_defined_vars()); 143 | } 144 | 145 | 146 | /** 147 | * Bir gelistiricinin onceden yaratmis oldugu uygulamalari silmek icin kullanmasi gereken metoddur. 148 | * 149 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/deleteApplication-ApplicationService-soap-anonymous 150 | * 151 | * Application Service 152 | * Delete Aplication Method 153 | * 154 | * @param string $developerId 155 | * 156 | * @return Web Servis mesajini object olarak dondurur 157 | */ 158 | public function deleteApplication($developerId = null){ 159 | return $this->clientConnect('anonymous','Application','deleteApplication',get_defined_vars()); 160 | } 161 | 162 | 163 | /** 164 | * Gelistiricinin yaratmis oldugu uygulamalarin listelesini almak istediginde, cagirmasi gereken metoddur. 165 | * 166 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getApplicationList-ApplicationService-soap-anonymous 167 | * 168 | * Application Service 169 | * List Aplication Method 170 | * 171 | * @param string $developerId 172 | * 173 | * @return object This developers application list. 174 | */ 175 | public function getApplicationList($developerId = null){ 176 | return $this->clientConnect('anonymous','Application','getApplicationList',get_defined_vars()); 177 | } 178 | 179 | //End Developer Service 180 | 181 | 182 | 183 | 184 | 185 | //Start Category Service 186 | 187 | /** 188 | * Kategori kodu ve kategori detay bilgilerine ulasmak icin bu metod kullanilmalidir. 189 | * 190 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getCategories-CategoryService-soap-anonymous 191 | * 192 | * Category Service 193 | * Get Categories Method 194 | * 195 | * @param integer $startOffset 196 | * @param integer $rowCount 197 | * @param string $withSpecs 198 | * 199 | * @return object Category list 200 | */ 201 | public function getCategories($startOffset = 0, $rowCount = 2, $withSpecs){ 202 | //$withSpecs = $this->booleanConvert($withSpecs); 203 | return $this->clientConnect('anonymous','Category','getCategories',get_defined_vars()); 204 | } 205 | 206 | public function getAllCategories(){ 207 | 208 | $result = $this->getCategories(0,1,false); 209 | 210 | $categoryCount = $result->categoryCount; 211 | $sayi = 0; 212 | $baslangic = 1; 213 | $bitis = ceil($categoryCount/100); 214 | 215 | $temp_kategori = array(); 216 | $data = array(); 217 | 218 | while($baslangic <= $bitis){ 219 | 220 | $result = $this->getCategories($sayi,100,false); 221 | foreach($result->categories->category as $category){ 222 | 223 | $data[] = array( 224 | "category_id" => $category->categoryCode, 225 | "category_name" => $category->categoryName, 226 | ); 227 | 228 | } 229 | 230 | $sayi += 100; 231 | $baslangic++; 232 | 233 | } 234 | 235 | 236 | 237 | return $data; 238 | 239 | } 240 | 241 | 242 | /** 243 | * Kategori bilgilerinde zaman icerisinde degisiklik olabilmektedir. 244 | * Sadece degisen kategori bilgilerine ihtiyac duyuldugunda belirtilen bir tarihten 245 | * sonra olan degisiklikler bu metod araciligi ile elde edilebilmektedir 246 | * Burada dikkat edilmesi gereken nokta changeTime parametresinin su an ki zamandan 247 | * buyuk bir degere sahip olmamasi ve gecmisteki bir zamana isaret etmesidir. 248 | * 249 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getModifiedCategories-CategoryService-soap-anonymous 250 | * 251 | * Category Service 252 | * Get Modified Categories Method 253 | * 254 | * @param integer $startOffset 255 | * @param integer $rowCount 256 | * @param time $changeTime format => 01/01/2008+00:00:00 257 | * 258 | * @return object Modified Category list 259 | */ 260 | public function getModifiedCategories($startOffset = 0, $rowCount = 2, $changeTime = '01/01/2008+00:00:00'){ 261 | return $this->clientConnect('anonymous','Category','getModifiedCategories',get_defined_vars()); 262 | } 263 | 264 | 265 | /** 266 | * Herhangi bir kategorinin detay bilgisine ihtiyac duyuldugunda cagirilmasi gereken metoddur. 267 | * 268 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getCategory-CategoryService-soap-anonymous 269 | * 270 | * Category Service 271 | * Get Category Info Method 272 | * 273 | * @param string $categoryCode 274 | * @param string $withSpecs 275 | * 276 | * @return object Selected category info 277 | */ 278 | public function getCategory($categoryCode = null, $withSpecs = true){ 279 | //$withSpecs = $this->booleanConvert($withSpecs); 280 | return $this->clientConnect('anonymous','Category','getCategory',get_defined_vars()); 281 | } 282 | 283 | 284 | /** 285 | * Sadece kategori ozelliklerinin alinmasi gerektigi durumda cagirilmasi gereken metoddur. 286 | * 287 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getCategorySpecs-CategoryService-soap-anonymous 288 | * 289 | * Category Service 290 | * Get Category Specs Info Method 291 | * 292 | * @param string $categoryCode 293 | * 294 | * @return object Selected categorys specs 295 | */ 296 | public function getCategorySpecs($categoryCode = null){ 297 | return $this->clientConnect('anonymous','Category','getCategorySpecs',get_defined_vars()); 298 | } 299 | 300 | 301 | 302 | /** 303 | * Istenilen kategoriye ait variant seceneklerinin cagirilmasi icin gereken metoddur. 304 | * 305 | * Category Service 306 | * Get Category Variant Specs 307 | * 308 | * @param string $categoryCode 309 | * 310 | * @return object Selected category variant specs 311 | */ 312 | 313 | public function getCategoryVariantSpecs($categoryCode = null){ 314 | return $this->clientConnect('anonymous','Category','getCategoryVariantSpecs',get_defined_vars()); 315 | } 316 | 317 | 318 | 319 | /** 320 | * Hangi kategorilerde variant oldugunun ogrenilmesi icin gereken metoddur. 321 | * 322 | * Cateogry Service 323 | * Get Categories Having Variant Specs 324 | * 325 | * @return object Categories 326 | */ 327 | public function getCategoriesHavingVariantSpecs(){ 328 | return $this->clientConnect('anonymous','Category','getCategoriesHavingVariantSpecs',get_defined_vars()); 329 | } 330 | 331 | 332 | //End Category Service 333 | 334 | 335 | 336 | 337 | 338 | //Start City Service 339 | 340 | /** 341 | * Gitti Gidiyor sistemindeki sehir ad ve kodlarini sunan servistir 342 | * Şehir kodlari il plaka kodlarindan farkli olabilecegi icin degerlerinin bu servisten kontrol edilmesi gerekmektedir. 343 | * 344 | * Detayli Bilgi: http://dev.gittigidiyor.com/metotlar/getCities-CityService-soap-anonymous 345 | * 346 | * City Service 347 | * Get Cities Method 348 | * 349 | * @param integer $startOffset 350 | * @param integer $rowCount 351 | * 352 | * @return object Cities list 353 | */ 354 | public function getCities($startOffset = 0, $rowCount = 5){ 355 | return $this->clientConnect('anonymous','City','getCities',get_defined_vars()); 356 | } 357 | 358 | 359 | /** 360 | * Şehir bilgilerinde zaman icerisinde degisiklik olabilmektedir, 361 | * Sadece degisen sehir bilgilerine ihtiyac duyuldugunda belirtilen bir tarihten 362 | * sonra olan degisiklikler bu metod araciligi ile elde edilebilmektedir. 363 | * 364 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getModifiedCities-CityService-soap-anonymous 365 | * 366 | * City Service 367 | * 368 | * Get Modified Cities Method 369 | * 370 | * @param time $changeTime format=>01/01/2008+00:00:00 371 | * @param integer $startOffset 372 | * @param integer $rowCount 373 | * 374 | * @return object Modified Cities List 375 | */ 376 | public function getModifiedCities($changeTime = '01/01/2008+00:00:00', $startOffset = 0, $rowCount = 5){ 377 | return $this->clientConnect('anonymous','City','getModifiedCities',get_defined_vars()); 378 | } 379 | 380 | 381 | /** 382 | * Sistemde kullanilan sehir verilerinden herhangi birisinin detayina 383 | * erisilmek istendigi durumda cagirilmasi gereken metoddur. 384 | * 385 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getCity-CityService-soap-anonymous 386 | * 387 | * City Service 388 | * Get City Info Method 389 | * 390 | * @param string $code 391 | * 392 | * @return object Selected City info 393 | */ 394 | public function getCity($code = null){ 395 | return $this->clientConnect('anonymous','City','getCity',get_defined_vars()); 396 | } 397 | 398 | //End City Service 399 | 400 | 401 | 402 | 403 | 404 | //Start Product Service 405 | 406 | /** 407 | * Bir urunun detay bilgisini almak icin bu metod kullanilmalidir. 408 | * 409 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getProduct-ProductService-soap-individual 410 | * 411 | * Product Service 412 | * Get Product Info Method 413 | * 414 | * @param string $productId 415 | * @param string $itemId 416 | * 417 | * @return object Selected Product info 418 | */ 419 | public function getProduct($productId = '',$itemId = ''){ 420 | return $this->clientConnect('individual','Product','getProduct',get_defined_vars()); 421 | } 422 | 423 | 424 | /** 425 | * Bu metod farkli durumlara (productStatus) sahip urunlerin listelesini almak icin kullanilmaktadir 426 | * “status” parametresi listesi alinmak istenen urunlerin durumunu ifade etmektedir. 427 | * 428 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getProducts-ProductService-soap-individual 429 | * 430 | * Product Service 431 | * Get Products Info Method 432 | * 433 | * @param integer $startOffset 434 | * @param integer $rowCount 435 | * @param string $status 436 | * @param string $withData 437 | * 438 | * @return object Products List 439 | */ 440 | public function getProducts($startOffset = 0, $rowCount = 3, $status = 'A', $withData = false){ 441 | //$withData = $this->booleanConvert($withData); 442 | return $this->clientConnect('individual','Product','getProducts',get_defined_vars()); 443 | } 444 | 445 | 446 | /** 447 | * Urune ait variant bilgilerini dondurur 448 | * 449 | * Product Service 450 | * Get Product Variants 451 | * 452 | * @param string $productId 453 | * @param string $itemId 454 | * @param string $variantId 455 | * @param string $variantStockCode 456 | * 457 | * @return object variand data 458 | */ 459 | public function getProductVariants($productId = '',$itemId = '',$variantId = '',$variantStockCode = ''){ 460 | return $this->clientConnect('individual','Product','getProductVariants',get_defined_vars()); 461 | } 462 | 463 | 464 | /** 465 | * Listeleme servisine urun kaydetmek icin kullanilmasi gereken metoddur. 466 | * Detayli Bilgi : http://dev.gittigidiyor.com/servisler/insertProduct-ProductService-soap-individual 467 | * 468 | * Product Service 469 | * Insert Product Method 470 | * 471 | * @param string $options Icerigi xml olan bu degisken belli bir standarda sahipdir. Daha fazla bilgi icin api document. 472 | * @param string $itemId Kategori bazli spec girisi 473 | * @param string $nextDateOption Ileri tarihli urun girme islemi 474 | * 475 | * @return Web Servis mesajini object olarak dondurur 476 | */ 477 | public function insertProducts($itemId = null,$product,$forceToSpecEntry = false,$nextDateOption = false){ 478 | return $this->clientConnect('individual','Product','insertProduct',get_defined_vars(),array('product')); 479 | } 480 | 481 | public function insertProductWithNewCargoDetail($itemId = null,$product,$forceToSpecEntry = false,$nextDateOption = false){ 482 | return $this->clientConnect('individual','Product','insertProductWithNewCargoDetail',get_defined_vars(),array('product')); 483 | } 484 | 485 | 486 | 487 | /** 488 | * Listeleme servisine variant urun kaydetmek icin kullanilmasi gereken metoddur. 489 | * 490 | * Product Service 491 | * Insert Retail Product Method 492 | * 493 | * @param string $options Icerigi xml olan bu degisken belli bir standarda sahipdir. Daha fazla bilgi icin api document. 494 | * @param string $itemId Kategori bazli spec girisi 495 | * @param string $nextDateOption Ileri tarihli urun girme islemi 496 | * 497 | * @return Web Servis mesajini object olarak dondurur 498 | */ 499 | public function insertRetailProduct($itemId = null,$product,$forceToSpecEntry = false,$nextDateOption = false){ 500 | return $this->clientConnect('individual','Product','insertRetailProduct',get_defined_vars(),array('product')); 501 | } 502 | 503 | 504 | 505 | /** 506 | * Belli bir urunun kopyasini almak icin kullanilmasi gereken metoddur. 507 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/cloneProduct-ProductService-soap-individual 508 | * 509 | * Product Service 510 | * Clone Product Method 511 | * 512 | * @param string $productId 513 | * @param string $itemId 514 | * 515 | * @return Web Servis mesajini object olarak dondurur 516 | */ 517 | public function cloneProduct($productId = '',$itemId = ''){ 518 | return $this->clientConnect('individual','Product','cloneProduct',get_defined_vars()); 519 | } 520 | 521 | 522 | /** 523 | * Ürun/urunleri silmek icin kullanilir. 524 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/deleteProduct-ProductService-soap-individual 525 | * 526 | * Product Service 527 | * Delete Product Method 528 | * 529 | * @param array $products 530 | * @param array $items 531 | * 532 | * @return Web Servis mesajini object olarak dondurur 533 | */ 534 | public function deleteProduct($products = array(),$items = array()){ 535 | $xml = ''; 536 | if (count($products) > 0){ 537 | foreach ($products as $product){ 538 | $xml .= "{$product}"; 539 | } 540 | } 541 | $xml .= ''; 542 | $options['productIdList'] = $xml; 543 | 544 | $xml = ''; 545 | if (count($items) > 0){ 546 | foreach ($items as $item){ 547 | $xml .= "{$item}"; 548 | } 549 | } 550 | $xml .= ''; 551 | $options['itemIdList'] = $xml; 552 | 553 | return $this->clientConnect('individual','Product','deleteProduct',$options,array('productIdList','itemIdList')); 554 | } 555 | 556 | 557 | 558 | /** 559 | * Ürun/urunleri silmek icin kullanilir. 560 | * Detayli Bilgi : 561 | * 562 | * Product Service 563 | * Delete Products Method 564 | * 565 | * @param array $products 566 | * @param array $items 567 | * 568 | * @return Web Servis mesajini object olarak dondurur 569 | */ 570 | public function deleteProducts($products = array(),$items = array()){ 571 | $xml = ''; 572 | if (count($products) > 0){ 573 | foreach ($products as $product){ 574 | $xml .= "{$product}"; 575 | } 576 | } 577 | $xml .= ''; 578 | $options['productIdList'] = $xml; 579 | 580 | $xml = ''; 581 | if (count($items) > 0){ 582 | foreach ($items as $item){ 583 | $xml .= "{$item}"; 584 | } 585 | } 586 | $xml .= ''; 587 | $options['itemIdList'] = $xml; 588 | 589 | return $this->clientConnect('individual','Product','deleteProducts',$options,array('productIdList','itemIdList')); 590 | } 591 | 592 | 593 | 594 | 595 | /** 596 | * Satılmayan urunleri yeniden listelemek icin kullanilir. 597 | * Detayli Bilgi : ? 598 | * 599 | * Product Service 600 | * ReList Products Method 601 | * 602 | * @param array $products 603 | * @param array $items 604 | * 605 | * @return Web Servis mesajini object olarak dondurur 606 | */ 607 | public function relistProducts($products = array(),$items = array()){ 608 | $xml = ''; 609 | if (count($products) > 0){ 610 | foreach ($products as $product){ 611 | $xml .= "{$product}"; 612 | } 613 | } 614 | $xml .= ''; 615 | $options['productIdList'] = $xml; 616 | 617 | $xml = ''; 618 | if (count($items) > 0){ 619 | foreach ($items as $item){ 620 | $xml .= "{$item}"; 621 | } 622 | } 623 | $xml .= ''; 624 | $options['itemIdList'] = $xml; 625 | 626 | return $this->clientConnect('individual','Product','relistProducts',$options,array('productIdList','itemIdList')); 627 | } 628 | 629 | 630 | 631 | /** 632 | * GittiGidiyor'da "Yeni Listelenenler" bolumundeki urunlere ulasmak icin kullanilir. 633 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getNewlyListedProductIdList-ProductService-soap-individual 634 | * 635 | * Product Service 636 | * getNewlyListedProductIdList Method 637 | * 638 | * @param integer $startOffset 639 | * @param integer $rowCount 640 | * @param boolean $viaApi 641 | * 642 | * @return object Yeni Listelenen Ürunler 643 | */ 644 | public function getNewlyListedProductIdList($startOffset = 0, $rowCount = 3,$viaApi = true){ 645 | return $this->clientConnect('individual','Product','getNewlyListedProductIdList',get_defined_vars()); 646 | } 647 | 648 | 649 | /** 650 | * Satisa cikarilacak urun/urunler icin odenmesi gereken listeleme servisi ucretini ya da satilmayan 651 | * fakat yeniden listelenmesi istenen urun/urunlerin listeleme ucretini yeniden hesaplamak icin kullanilir. 652 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/calculatePriceForShoppingCart-ProductService-soap-individual 653 | * 654 | * Product Service 655 | * calculatePriceForShoppingCart Method 656 | * 657 | * @param array $products 658 | * @param array $items 659 | * 660 | * @return object urun fiyati 661 | */ 662 | public function calculatePriceForShoppingCart($products = array(),$items = array()){ 663 | $xml = ''; 664 | if (count($products) > 0){ 665 | foreach ($products as $product){ 666 | $xml .= "{$product}"; 667 | } 668 | } 669 | $xml .= ''; 670 | $options['productIdList'] = $xml; 671 | 672 | $xml = ''; 673 | if (count($items) > 0){ 674 | foreach ($items as $item){ 675 | $xml .= "{$item}"; 676 | } 677 | } 678 | $xml .= ''; 679 | $options['itemIdList'] = $xml; 680 | return $this->clientConnect('individual','Product','calculatePriceForShoppingCart',$options,array('productIdList','itemIdList')); 681 | } 682 | 683 | 684 | /** 685 | * Satisa cikarilmis bir urunde yapilacak revizyonun ucretini hesaplamak icin kullanilir. 686 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/calculatePriceForRevision-ProductService-soap-individual 687 | * 688 | * Product Service 689 | * calculatePriceForRevision Method 690 | * 691 | * @param string $productId 692 | * @param string $itemId 693 | * 694 | * @return object revizyon fiyati 695 | */ 696 | public function calculatePriceForRevision($productId = null, $itemId = null){ 697 | return $this->clientConnect('individual','Product','calculatePriceForRevision',get_defined_vars()); 698 | } 699 | 700 | 701 | /** 702 | * Listeleme servisi ve revizyon ucretlerini odemek icin kullanilir. 703 | * Kullanici, odeme ceki ve kredi karti bilgilerini kullanarak odeme islemini gerceklestirir. 704 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/payPrice-ProductService-soap-individual 705 | * 706 | * Product Service 707 | * Pay Price Method 708 | * 709 | * @param string $voucher 710 | * @param string $ccOwnerName 711 | * @param string $ccOwnerSurname 712 | * @param integer $ccNumber 713 | * @param integer $cvv 714 | * @param integer $expireMonth 715 | * @param integer $expireYear 716 | * 717 | * @return Web Servis mesajini object olarak dondurur 718 | */ 719 | public function payPrice($voucher,$ccOwnerName,$ccOwnerSurname,$ccNumber,$cvv,$expireMonth,$expireYear){ 720 | return $this->clientConnect('individual','Product','payPrice',get_defined_vars()); 721 | } 722 | 723 | 724 | /** 725 | * Satistaki urunu erken sonlandirmak icin kullanilir. 726 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/finishEarly-ProductService-soap-individual 727 | * 728 | * Product Service 729 | * finishEarly Method 730 | * 731 | * @param array $products 732 | * 733 | * @return Web Servis mesajini object olarak dondurur 734 | */ 735 | public function finishEarly($products = array(),$items = array()){ 736 | $xml = ''; 737 | if (count($products) > 0){ 738 | foreach ($products as $product){ 739 | $xml .= "{$product}"; 740 | } 741 | } 742 | $xml .= ''; 743 | $options['productIdList'] = $xml; 744 | 745 | $xml = ''; 746 | if (count($items) > 0){ 747 | foreach ($items as $item){ 748 | $xml .= "{$item}"; 749 | } 750 | } 751 | $xml .= ''; 752 | $options['itemIdList'] = $xml; 753 | return $this->clientConnect('individual','Product','finishEarly',$options,array('productIdList','itemIdList')); 754 | } 755 | 756 | 757 | 758 | /** 759 | * Satistaki urunu erken sonlandirmak icin kullanilir. 760 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/finishEarly-ProductService-soap-individual 761 | * 762 | * Product Service 763 | * finishEarly Method 764 | * 765 | * @param array $products 766 | * 767 | * @return Web Servis mesajini object olarak dondurur 768 | */ 769 | public function finishEarlyProducts($products = array(),$items = array()){ 770 | $xml = ''; 771 | if (count($products) > 0){ 772 | foreach ($products as $product){ 773 | $xml .= "{$product}"; 774 | } 775 | } 776 | $xml .= ''; 777 | $options['productIdList'] = $xml; 778 | 779 | $xml = ''; 780 | if (count($items) > 0){ 781 | foreach ($items as $item){ 782 | $xml .= "{$item}"; 783 | } 784 | } 785 | $xml .= ''; 786 | $options['itemIdList'] = $xml; 787 | return $this->clientConnect('individual','Product','finishEarlyProducts',$options,array('productIdList','itemIdList')); 788 | } 789 | 790 | 791 | 792 | /** 793 | * Fiyat bilgilerini guncellemek icin kullanilir. 794 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/updatePrice-ProductService-soap-individual 795 | * 796 | * Product Service 797 | * Update Price Method 798 | * 799 | * @param string $productId 800 | * @param string $itemId 801 | * @param string $price 802 | * @param string $cancelBid 803 | * 804 | * @return Web Servis mesajini object olarak dondurur 805 | */ 806 | public function updatePrice($productId,$itemId,$price,$cancelBid){ 807 | return $this->clientConnect('individual','Product','updatePrice',get_defined_vars()); 808 | } 809 | 810 | 811 | /** 812 | * Stok bilgilerini guncellemek icin kullanilir. 813 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/updateStock-ProductService-soap-individual 814 | * 815 | * Product Service 816 | * Update Stock Method 817 | * 818 | * @param string $productId 819 | * @param string $itemId 820 | * @param string $stock 821 | * @param string $cancelBid 822 | * 823 | * @return Web Servis mesajini object olarak dondurur 824 | */ 825 | public function updateStock($productId,$itemId,$stock,$cancelBid){ 826 | return $this->clientConnect('individual','Product','updateStock',get_defined_vars()); 827 | } 828 | 829 | 830 | 831 | /** 832 | * Urun guncellemek icin kullanilmasi gereken metoddur. 833 | * Detayli Bilgi : http://dev.gittigidiyor.com/servisler/updateProduct-ProductService-soap-individual 834 | * 835 | * Product Service 836 | * Update Product Method 837 | * 838 | * @return Web Servis mesajini object olarak dondurur 839 | */ 840 | public function updateProduct($itemId = null, $productId = null, $product, $onSale = true, $forceToSpecEntry = false, $nextDateOption = false){ 841 | return $this->clientConnect('individual','Product','updateProduct',get_defined_vars(),array('product')); 842 | } 843 | 844 | 845 | /** 846 | * Urun variant bilgileirni guncellemek icin kullanılmasi gereken metoddur. 847 | * 848 | * Product Service 849 | * Update Product Variants 850 | * 851 | * @param unknown_type $itemId 852 | * @param unknown_type $productId 853 | * @param unknown_type $productVariant 854 | * 855 | * @return Web Servis mesajini object olarak dondurur 856 | */ 857 | public function updateProductVariants($itemId = null, $productId = null, $productVariant){ 858 | return $this->clientConnect('individual','Product','updateProductVariants',get_defined_vars(),array('productVariant')); 859 | } 860 | 861 | 862 | 863 | 864 | /** 865 | * Stok ve Fiyat bilgilerini almak icin kullanilir. 866 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getStockAndPrice-ProductService-soap-individual 867 | * 868 | * Product Service 869 | * getStockAndPrice Method 870 | * 871 | * @param array $products 872 | * @param array $items 873 | * 874 | * @return Web Servis mesajini object olarak dondurur 875 | */ 876 | public function getStockAndPrice($products = array(),$items = array()){ 877 | $xml = ''; 878 | if (count($products) > 0){ 879 | foreach ($products as $product){ 880 | $xml .= "{$product}"; 881 | } 882 | } 883 | $xml .= ''; 884 | $options['productIdList'] = $xml; 885 | 886 | $xml = ''; 887 | if (count($items) > 0){ 888 | foreach ($items as $item){ 889 | $xml .= "{$item}"; 890 | } 891 | } 892 | $xml .= ''; 893 | $options['itemIdList'] = $xml; 894 | return $this->clientConnect('individual','Product','getStockAndPrice',$options,array('productIdList','itemIdList')); 895 | } 896 | 897 | 898 | 899 | 900 | /** 901 | * Product Service 902 | * getProductStatuses Method 903 | * 904 | * @param array $products 905 | * @param array $items 906 | * 907 | * @return Web Servis mesajini object olarak dondurur 908 | */ 909 | public function getProductStatuses($products = array(),$items = array()){ 910 | $xml = ''; 911 | if (count($products) > 0){ 912 | foreach ($products as $product){ 913 | $xml .= "{$product}"; 914 | } 915 | } 916 | $xml .= ''; 917 | $options['productIdList'] = $xml; 918 | 919 | $xml = ''; 920 | if (count($items) > 0){ 921 | foreach ($items as $item){ 922 | $xml .= "{$item}"; 923 | } 924 | } 925 | $xml .= ''; 926 | $options['itemIdList'] = $xml; 927 | return $this->clientConnect('individual','Product','getProductStatuses',$options,array('productIdList','itemIdList')); 928 | } 929 | 930 | 931 | 932 | 933 | /** 934 | * Urun ozellikleri bilgilerini almak icin erisilir. 935 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getProductSpecs-ProductService-soap-individual 936 | * 937 | * Product Service 938 | * getProductSpecs Method 939 | * 940 | * @param string $productId 941 | * @param string $itemId 942 | * 943 | * @return Web Servis mesajini object olarak dondurur 944 | */ 945 | public function getProductSpecs($productId = null, $itemId = null){ 946 | return $this->clientConnect('individual','Product','getProductSpecs',get_defined_vars()); 947 | } 948 | 949 | 950 | 951 | /** 952 | * Product Service 953 | * getProductsByIds Method 954 | * 955 | * @param array $products 956 | * @param array $items 957 | * 958 | * @return Web Servis mesajini object olarak dondurur 959 | */ 960 | public function getProductsByIds($products = array(),$items = array()){ 961 | $xml = ''; 962 | if (count($products) > 0){ 963 | foreach ($products as $product){ 964 | $xml .= "{$product}"; 965 | } 966 | } 967 | $xml .= ''; 968 | $options['productIdList'] = $xml; 969 | 970 | $xml = ''; 971 | if (count($items) > 0){ 972 | foreach ($items as $item){ 973 | $xml .= "{$item}"; 974 | } 975 | } 976 | $xml .= ''; 977 | $options['itemIdList'] = $xml; 978 | return $this->clientConnect('individual','Product','getProductsByIds',$options,array('productIdList','itemIdList')); 979 | } 980 | 981 | 982 | 983 | /** 984 | * Urun aciklamasini almak icin erisilir. 985 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getProductDescription-ProductService-soap-individual 986 | * 987 | * Product Service 988 | * getProductDescription Method 989 | * 990 | * @param string $productId 991 | * @param string $itemId 992 | * 993 | * @return Web Servis mesajini object olarak dondurur 994 | */ 995 | public function getProductDescription($productId = null, $itemId = null){ 996 | return $this->clientConnect('individual','Product','getProductDescription',get_defined_vars()); 997 | } 998 | 999 | 1000 | //End Product Service 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | //Start Sale Service 1007 | 1008 | /** 1009 | * Satici satis kodunu girmek suretiyle mevcut satisin bilgilerini elde edebilir. 1010 | * 1011 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getSale-SaleService-soap-individual 1012 | * 1013 | * Sale Service 1014 | * 1015 | * Get Sale 1016 | * 1017 | * @param integer $saleCode 1018 | * 1019 | * @return object Sale code info 1020 | */ 1021 | public function getSale($saleCode = null){ 1022 | return $this->clientConnect('individual','Sale','getSale',get_defined_vars()); 1023 | } 1024 | 1025 | 1026 | /** 1027 | * Satici konumundaki kullanici bu metod araciligi ile 1028 | * GittiGidiyor Bana Özel alaninin Sattiklarim bolumunde sunulan bilgilerin tamamini elde edebilir, 1029 | * bilgiler filtrelenebilir ve de siralanabilir. 1030 | * 1031 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getSales-SaleService-soap-individual 1032 | * 1033 | * Get Sales 1034 | * 1035 | * @param integer $saleCode 1036 | * @param integer $rowCount 1037 | * @param string $withData 1038 | * @param string $byStatus 1039 | * @param string $byUser 1040 | * @param string $orderBy 1041 | * @param string $orderType 1042 | * 1043 | * @return object Sales info 1044 | */ 1045 | public function getSales($startOffset = 0, 1046 | $rowCount = 5, 1047 | $withData = false, 1048 | $byStatus = 'R', 1049 | $byUser = 'A', 1050 | $orderBy = 'C', 1051 | $orderType = 'A'){ 1052 | //$withData = $this->booleanConvert($withData); 1053 | return $this->clientConnect('individual','Sale','getSales',get_defined_vars()); 1054 | } 1055 | 1056 | public function getPagedSales( 1057 | $withData = false, 1058 | $byStatus = 'R', 1059 | $byUser = 'A', 1060 | $orderBy = 'C', 1061 | $orderType = 'A', 1062 | $pageNumber = 1, 1063 | $pageSize = 5 1064 | ){ 1065 | //$withData = $this->booleanConvert($withData); 1066 | return $this->clientConnect('individual','Sale','getPagedSales',get_defined_vars()); 1067 | } 1068 | 1069 | //Start Messages Service 1070 | 1071 | /** 1072 | * Gelen kutusundaki mesaj bilgilerine erismek icin kullanilmasi gereken metoddur. 1073 | * 1074 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getInboxMessages-UserMessageService-soap-individual 1075 | * 1076 | * UserMessage Service 1077 | * Get Inbox Message Method 1078 | * 1079 | * @param integer $startOffset 1080 | * @param integer $rowCount 1081 | * @param string $unread 1082 | * 1083 | * @return object Inbox Message List 1084 | */ 1085 | public function getInboxMessages($startOffset = 0 ,$rowCount = 5, $unread = true){ 1086 | //$unread = $this->booleanConvert($unread); 1087 | return $this->clientConnect('individual','UserMessage','getInboxMessages',get_defined_vars()); 1088 | } 1089 | 1090 | 1091 | /** 1092 | * Gonderilen kutusundaki mesaj bilgilerine erismek icin kullanilmasi gereken metoddur. 1093 | * 1094 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getSendedMessages-UserMessageService-soap-individual 1095 | * 1096 | * UserMessage Service 1097 | * Get Outbox Message Method 1098 | * 1099 | * @param integer $startOffset 1100 | * @param integer $rowCount 1101 | * 1102 | * @return object Outbox Message List 1103 | */ 1104 | public function getSendedMessages($startOffset = 0 ,$rowCount = 5){ 1105 | return $this->clientConnect('individual','UserMessage','getSendedMessages',get_defined_vars()); 1106 | } 1107 | 1108 | 1109 | /** 1110 | * Mesaj gonderme islemi icin kullanilmasi gereken metoddur. 1111 | * 1112 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/sendNewMessage-UserMessageService-soap-individual 1113 | * 1114 | * UserMessage Service 1115 | * Send New Message Method 1116 | * 1117 | * @param string $to 1118 | * @param string $title 1119 | * @param string $messageContent 1120 | * @param string $sendCopy 1121 | * 1122 | * @return Web Servis mesajini object olarak dondurur 1123 | */ 1124 | public function sendNewMessage($to = null,$title = null,$messageContent = null, $sendCopy = null){ 1125 | return $this->clientConnect('individual','UserMessage','sendNewMessage',get_defined_vars()); 1126 | } 1127 | 1128 | 1129 | 1130 | /** 1131 | * UserMessage Service 1132 | * readMessage Method 1133 | * 1134 | * @param integer $startOffset 1135 | * @param integer $rowCount 1136 | * 1137 | * @return object Outbox Message List 1138 | */ 1139 | public function readMessage($messageId){ 1140 | return $this->clientConnect('individual','UserMessage','readMessage',get_defined_vars()); 1141 | } 1142 | 1143 | 1144 | 1145 | /** 1146 | * UserMessage Service 1147 | * deleteIncomingMessages Method 1148 | * 1149 | * 1150 | * @return Web Servis mesajini object olarak dondurur 1151 | */ 1152 | public function deleteIncomingMessages($messageIds = array()){ 1153 | $xml = ''; 1154 | if (count($messageIds) > 0){ 1155 | foreach ($messageIds as $messageId){ 1156 | $xml .= "{$messageId}"; 1157 | } 1158 | } 1159 | $xml .= ''; 1160 | $options['messageId'] = $xml; 1161 | 1162 | return $this->clientConnect('individual','UserMessage','deleteIncomingMessages',$options,array('messageId')); 1163 | } 1164 | 1165 | 1166 | 1167 | /** 1168 | * UserMessage Service 1169 | * deleteOutgoingMessages Method 1170 | * 1171 | * 1172 | * @return Web Servis mesajini object olarak dondurur 1173 | */ 1174 | public function deleteOutgoingMessages($messageIds = array()){ 1175 | $xml = ''; 1176 | if (count($messageIds) > 0){ 1177 | foreach ($messageIds as $messageId){ 1178 | $xml .= "{$messageId}"; 1179 | } 1180 | } 1181 | $xml .= ''; 1182 | $options['messageId'] = $xml; 1183 | 1184 | return $this->clientConnect('individual','UserMessage','deleteOutgoingMessages',$options,array('messageId')); 1185 | } 1186 | 1187 | 1188 | //End Message Service 1189 | 1190 | 1191 | 1192 | //Cargo Service 1193 | 1194 | /** 1195 | * Bu metot, satış kodunu girdikten sonra mevcut satışın kargo bilgisini girmek için kullanılır. 1196 | * 1197 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getCargoInformation-SaleService-soap-individual 1198 | * 1199 | * getCargoInformation Service 1200 | * Get Cargo Information 1201 | * 1202 | * @param integer $saleCode 1203 | * 1204 | * @return object Cargo Information 1205 | */ 1206 | public function getCargoInformation($saleCode){ 1207 | return $this->clientConnect('individual','Cargo','getCargoInformation',get_defined_vars()); 1208 | } 1209 | 1210 | 1211 | /** 1212 | * İlgili satış kodu girildikten sonra, satış bilgisine kargo bilgisi eklemek için kullanılır. Bu metot satıcılar tarafından kullanılır. 1213 | * 1214 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/sendCargoInformation-SaleService-soap-individual 1215 | * 1216 | * sendCargoInformation Service 1217 | * Send Cargo Information 1218 | * 1219 | * @param integer $saleCode 1220 | * 1221 | * @return object Cargo Information 1222 | */ 1223 | public function sendCargoInformation($saleCode,$cargoPostCode,$cargoCompany,$cargoBranch,$followUpUrl,$userType){ 1224 | return $this->clientConnect('individual','Cargo','sendCargoInformation',get_defined_vars()); 1225 | } 1226 | 1227 | 1228 | //End Cargo Service 1229 | 1230 | 1231 | 1232 | //Store Service 1233 | 1234 | /** 1235 | * Kullanicinin dukkan ve dukkan kategori bilgilerine ulasmak icin kullanilir. 1236 | * 1237 | * Detayli Bilgi : http://dev.gittigidiyor.com/metotlar/getStore-StoreService-soap-individual 1238 | * 1239 | * Store Service 1240 | * getStore Information 1241 | * 1242 | * @param integer $saleCode 1243 | * 1244 | * @return object Web Servis mesajini object olarak dondurur 1245 | */ 1246 | public function getStore(){ 1247 | return $this->clientConnect('individual','Store','getStore',get_defined_vars()); 1248 | } 1249 | 1250 | //End Store Service 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | /** 1258 | * Client Boolean Value Converter 1259 | * 1260 | * @param $data 1261 | * 1262 | * @return string $data 1263 | */ 1264 | protected function booleanConvert($data){ 1265 | if ($data){ 1266 | $data = 'true'; 1267 | }else{ 1268 | $data = 'false'; 1269 | } 1270 | return $data; 1271 | } 1272 | 1273 | 1274 | 1275 | /** 1276 | * GG Client Curl Connect Service ON SOAP 1277 | * 1278 | * @param string $serviceAccessType 1279 | * @param string $serviceType 1280 | * @param string $method 1281 | * @param array $parameters 1282 | * 1283 | */ 1284 | protected function clientConnect($serviceAccessType,$serviceType,$method,$parameters,$xml = array()){ 1285 | $soapParams = array(); 1286 | if ($serviceType =='Product' || $serviceType =='Developer'){ 1287 | $url = 'https://dev.gittigidiyor.com:8443/'; 1288 | }else{ 1289 | $url = 'http://dev.gittigidiyor.com:8080/'; 1290 | } 1291 | $url .= 'listingapi/ws/'; 1292 | switch ($serviceAccessType) { 1293 | case 'anonymous': 1294 | $url .= $serviceType.'Service'; 1295 | break; 1296 | case 'individual': 1297 | $url .= 'Individual'.$serviceType.'Service'; 1298 | $soapParams = array('apiKey' => $this->apiKey, 1299 | 'sign' => $this->sign, 1300 | 'time' => (float)$this->time); 1301 | break; 1302 | case 'internal': 1303 | $url .= 'Internal'.$serviceType.'Service';break; 1304 | 1305 | case 'community': 1306 | $url .= 'Community'.$serviceType.'Service';break; 1307 | } 1308 | $url .= '?wsdl'; 1309 | 1310 | foreach ($parameters as $key => $param){ 1311 | $soapParams[$key]=$param; 1312 | } 1313 | if (count($xml) > 0){ 1314 | foreach ($xml as $xmlRow){ 1315 | $value = $parameters[$xmlRow]; 1316 | $soapParams[$xmlRow] = new SoapVar($value,XSD_ANYXML); 1317 | } 1318 | } 1319 | $soapParams['lang'] = $this->lang; 1320 | 1321 | 1322 | $soapClient = new SoapClient($url, array('login' => $this->auth_user, 'password' => $this->auth_pass, 'authentication' => SOAP_AUTHENTICATION_BASIC)); 1323 | $result = $soapClient->__soapCall($method,$soapParams); 1324 | 1325 | return $result; 1326 | 1327 | } 1328 | 1329 | } 1330 | --------------------------------------------------------------------------------