📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
system
/
library
/
eticdokargo
📝
surat.php
← Geri Dön
<?php /** Sürat Kargo **/ class Surat implements EticdoKargoBase { public $order_key='3ca3eb77731031703154fc844a26c19c' ; public function hesap_test($data){ $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $service_url = 'http://www.suratkargo.com.tr/GonderiWebServiceGercek/Service.asmx?WSDL'; $order = array( "KisiKurum" =>'Hesap Test', "AliciAdresi" =>'Test Adres', "Il" =>'ISTANBUL', "Ilce" =>'BAKIRKOY', "TelefonCep" =>'', "KargoTuru" => 2, "Odemetipi" => 1, "TeslimSekli" => 1, "Adet" => 1, "BirimDesi" => 1, "BirimKg" => 1, "KargoIcerigi" => 'Ürün', "OzelKargoTakipNo" => '1', "TasimaSekli" => "1", "KapidanOdemeTahsilatTipi" => "", "KapidanOdemeTutari" => "0", ); $send['KullaniciAdi'] = $user_name; $send['Sifre'] = $user_pass; $send['Gonderi']= $order; $response = $this->getSOAP($service_url, 'GonderiyiKargoyaGonder', $send ); if(isset($response['GonderiyiKargoyaGonderResult']) && !strpos($response['GonderiyiKargoyaGonderResult'],'Adı Veya Şifre Yanlış')){ $this->result['status']=1; $this->result['html'] .= '<ul>'; $this->result['html'] .= '<li><strong class="text-success">Başarılı</strong></li>'; $this->result['html'] .= '<li>Servis: '.$service_url.'</li>'; $this->result['html'] .= '<li>Kullanıcı Adı: '.$user_name.'</li>'; $this->result['html'] .= '<li>Şifre: '.$user_pass.'</li>'; $this->result['html'] .= '</ul>'; } else{ $this->result['status']=0; $this->result['html'] .= '<ul>'; $this->result['html'] .= '<li><strong class="text-danger">Başarısız</strong>: '.$response['GonderiyiKargoyaGonderResult'].'</li>'; $this->result['html'] .= '<li>Servis: '.$service_url.'</li>'; $this->result['html'] .= '<li>Kullanıcı Adı: '.$user_name.'</li>'; $this->result['html'] .= '<li>Şifre: '.$user_pass.'</li>'; $this->result['html'] .= '</ul>'; } return $this->result; } public function kayit_ac($data){ $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $service_url = 'http://www.suratkargo.com.tr/GonderiWebServiceGercek/Service.asmx?WSDL'; $order = array( "KisiKurum" => html_entity_decode($data['name'], ENT_COMPAT, "UTF-8"), "AliciAdresi" => $data['address'], "Il" => $data['zone'], "Ilce" => $data['city'], "TelefonCep" => $data['tel'], "KargoTuru" => 2, "Odemetipi" => 1, "TeslimSekli" => 1, "Adet" => $data['paket'], "BirimDesi" => 1, "BirimKg" => 1, "KargoIcerigi" => 'Ürün', "OzelKargoTakipNo" => $data['barcode'], "TasimaSekli" => "1", "KapidanOdemeTahsilatTipi" => "", "KapidanOdemeTutari" => "0", ); if($data['method'] == 'codcash_normal' ) { $order["KapidanOdemeTahsilatTipi"] = '1'; $order["IrsaliyeSeriNo"] = 'A'; $order["IrsaliyeSiraNo"] = $data['barcode']; $order["KapidanOdemeTutari"] = number_format((float)$data['total']+(float)$ekucret,2,'.','');//tahsilatlı teslimat } else if($data['method'] == 'codcc_normal') { $order["KapidanOdemeTahsilatTipi"] = '2'; $order["IrsaliyeSeriNo"] = 'A'; $order["IrsaliyeSiraNo"] = $data['barcode']; $order["KapidanOdemeTutari"] = number_format((float)$data['total']+(float)$ekucret,2,'.','');//tahsilatlı teslimat } error_reporting(0); @ini_set('display_errors', 0); $this->result['status'] = 0; $this->result['message'] = 'İşlem Yaılamadı'; $this->result['data']['method'] = $data['method']; $this->result['data']['order_id'] = $data['order_id']; $this->result['data']['kargo_tarih'] = date('Y-m-d H:i:s'); $this->result['data']['kargo_firma'] = 'surat'; $this->result['data']['kargo_barcode'] = $data['barcode']; $this->result['data']['kargo_talepno'] = ''; $this->result['data']['order_status_id'] = $data['order_status_id']; $send['KullaniciAdi'] = $user_name; $send['Sifre'] = $user_pass; $send['Gonderi']= $order; try{ $response = $this->getSOAP($service_url, 'GonderiyiKargoyaGonder', $send ); if(isset($response['GonderiyiKargoyaGonderResult'])){ if($response['GonderiyiKargoyaGonderResult']=='Tamam') { $this->result['status'] = 1; $this->result['message'] = $this->method[$data['method']]['method_name'].' Kargo Kaydı Açıldı'; $this->result['data']['kargo_talepno'] = ''; } else { $this->result['status'] = 0; $this->result['message'] = $response['GonderiyiKargoyaGonderResult']; } } else { $this->result['status'] = 0; $this->result['message'] = 'Geçersiz servis sonucu.'; } } catch(Exception $e) { $this->result['status'] = 0; $this->result['message'] = 'Kargo Servislerine Bağlanılamadı. Lütfen tekrar deneyiniz. <br>'.$e->getMessage(); } return $this->result; } public function kayit_iptal($data){ $this->result['status'] = 0; $this->result['message'] = 'Sürat Kargoda, Gönderi Iptal Hizmeti verilmiyor'; return $this->result; } public function takip_linki_al($data){ } public function takip_kodu_al($data){ } public function kargo_durumu_al($data){ $this->result['status'] = 0; $this->result['data'] = $data; $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $takip_user = $this->takip_user; $takip_pass = $this->takip_pass; $user_code = $this->method[$data['method']]['user_code']; $satisKodu = $data['kargo_barcode']; error_reporting(0); @ini_set('display_errors', 0); try{ $service_url = 'http://webservices.suratkargo.com.tr/services.asmx?WSDL'; $send['gonderenCariKodu'] = $user_code; $send['satisKodu'] = $satisKodu; $send['Sifre'] = $user_pass; $response = $this->getSOAP($service_url, 'WebSiparisKodundanKargoTeslimatBilgisi', $send ); if( isset($response['WebSiparisKodundanKargoTeslimatBilgisiResult'])) { if($response['WebSiparisKodundanKargoTeslimatBilgisiResult']['HataSonucu']!=1){ $this->result['message'] = $response['WebSiparisKodundanKargoTeslimatBilgisiResult']['HataAciklamasi']; } else { $this->result['status'] = 1; $this->result['data']['kargo_sonuc'] = $response['WebSiparisKodundanKargoTeslimatBilgisiResult']['TeslimatBilgisi']['TeslimatAciklamasi']; $this->result['data']['kargo_url'] = 'http://www.suratkargo.com.tr/kargoweb/bireysel.aspx?SATICI='.$user_code.'&no='.$satisKodu; $this->result['message'] = $response['WebSiparisKodundanKargoTeslimatBilgisiResult']['HataAciklamasi'].": ".$this->result['data']['kargo_sonuc']; } } else{ $this->result['message'] = "Eticdokargo: Servis sonucu geçersiz."; } } catch(Exception $e) { $this->result['message'] = 'Kargo Servislerine Bağlanılamadı. Lütfen tekrar deneyiniz. <br>'.$e->getMessage(); } return $this->result; } private function getSOAP($service_url, $service_method, $send ){ $this->result['message'] = ''; $send['userLanguage'] = 'TR'; if (!extension_loaded('soap')) { throw new Exception('SOAP requests is unavailable'); } try{ if(defined('ETİCDOKARGO_TEST')){ echo "<br>Servis Endpoint: $service_url<br>\r\n<pre>"; echo "<br>Request data:<br>\r\n<pre>"; print_r($send); } $client = new SoapClient($service_url, array('trace' => 1, 'exceptions' => 1)); $response = $client->$service_method( $send ); if(defined('ETİCDOKARGO_TEST')){ echo "<br>Response data:<br>\r\n<pre>"; print_r($response); } return json_decode(json_encode($response),1); } catch(Exception $e) { if(defined('ETİCDOKARGO_TEST')){ echo "<br>Exception data:<br>\r\n"; print_r($e->getMessage()); } $this->result['message'] = 'Kargo Servislerine Bağlanılamadı. Lütfen tekrar deneyiniz. <br>'.$e->getMessage(); } } } ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula