📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
system
/
library
/
eticdokargo
📝
yurtici.php
← Geri Dön
<?php /** Yurtiçi Kargo **/ class Yurtici implements EticdoKargoBase { public $order_key='45efe4113a31b3f7bdfdba8d8937dc51' ; public function hesap_test($data){ $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $cargoKeys = isset($data['barkodlar'])?$data['barkodlar']:array(); $service_url ="http://webservices.yurticikargo.com:8080/KOPSWebServices/ShippingOrderDispatcherServices?wsdl"; $data['barkodlar'] = array('1'); $this->result = $this->kayit_iptal($data); if($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['html'] .= '<ul>'; $this->result['html'] .= '<li><strong class="text-danger">Başarısız</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>'; } return $this->result; } public function kayit_ac($data){ $user_lang = 'TR'; $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $service_url = 'http://webservices.yurticikargo.com:8080/KOPSWebServices/ShippingOrderDispatcherServices?wsdl'; $order = array( 'cargoCount' =>$data['paket'], 'cargoKey' =>$data['barcode'], 'cityName' =>$data['zone'], 'dcCreditRule' =>'', 'dcSelectedCredit' =>'', 'invoiceKey' =>$data['barcode'], 'receiverAddress' =>$data['address'], 'receiverCustName' =>$data['name'], 'receiverPhone1' =>$data['tel'], 'townName' =>$data['city'], 'ttDocumentId' =>'', 'waybillNo' =>$data['barcode'], 'taxOfficeId' =>'', 'receiverPhone1' =>$data['tel'], 'receiverPhone2' =>$data['tel'], ); if($data['method'] == 'codcash_normal' ) { $order['ttDocumentId'] = $data['barcode']; $order['ttCollectionType'] ='0'; $order['ttInvoiceAmount'] =(float)$data['total']; } else if($data['method'] == 'codcc_normal') { $order['ttDocumentId'] = $data['barcode']; $order['ttCollectionType'] ='1'; $order['dcSelectedCredit'] ='1'; $order['ttInvoiceAmount'] =(float)$data['total']; } error_reporting(0); @ini_set('display_errors', 0); $this->result['status'] = 0; $this->result['message'] = 'İşlem Yapı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'] = 'yurtici'; $this->result['data']['kargo_barcode'] = $data['barcode']; $this->result['data']['kargo_talepno'] = ''; $this->result['data']['order_status_id'] = $data['order_status_id']; try{ $send = array('wsUserName'=>$user_name, 'wsPassword'=>$user_pass, 'userLanguage'=>$user_lang, 'ShippingOrderVO'=>array($order)); $response = $this->getSOAP($service_url, 'createShipment', $send ); if(isset($response['ShippingOrderResultVO']) && $response['ShippingOrderResultVO']['outFlag']==0) { $this->result['status'] = 1; $this->result['message'] = $this->method[$data['method']]['method_name'].' Kargo Kaydı Açıldı'; $this->result['data']['kargo_talepno'] = $response['ShippingOrderResultVO']['jobId']; } else { $this->result['status'] = 0; $this->result['message'] = $response['ShippingOrderResultVO']['outResult']; if(isset($response['ShippingOrderResultVO'])) { $this->result['message'] .= $this->method[$data['method']]['method_name'].': '.$response['ShippingOrderResultVO']['shippingOrderDetailVO']['errMessage']; } } } 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 test($data){ $this->result['status'] = 0; $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $cargoKeys = isset($data['barkodlar'])?$data['barkodlar']:array(); $service_url ="http://webservices.yurticikargo.com:8080/KOPSWebServices/ShippingOrderDispatcherServices?wsdl"; $send = array('cargoKeys'=>$cargoKeys, 'wsUserName'=>$user_name, 'wsPassword'=>$user_pass ); $soap_result = $this->getSOAP($service_url, 'cancelShipment', $send ); if(isset($soap_result['ShippingOrderResultVO']) && isset($soap_result['ShippingOrderResultVO']['outFlag']) && $soap_result['ShippingOrderResultVO']['outFlag']==0 ){ $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></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_iptal($data){ $this->result['status'] = 0; $user_name = $this->method[$data['method']]['user_name']; $user_pass = $this->method[$data['method']]['user_pass']; $cargoKeys = isset($data['barkodlar'])?$data['barkodlar']:array(); $service_url ="http://webservices.yurticikargo.com:8080/KOPSWebServices/ShippingOrderDispatcherServices?wsdl"; $send = array('cargoKeys'=>$cargoKeys, 'wsUserName'=>$user_name, 'wsPassword'=>$user_pass ); $response = $this->getSOAP($service_url, 'cancelShipment', $send ); if(isset($response['ShippingOrderResultVO']) && isset($response['ShippingOrderResultVO']['outFlag']) && $response['ShippingOrderResultVO']['outFlag']==0 ){ $this->result['status'] = 1; if(isset($response['ShippingOrderResultVO']['shippingCancelDetailVO']['errMessage'])){ $this->result['message'] = $response['ShippingOrderResultVO']['shippingCancelDetailVO']['errMessage']; } elseif(isset($response['ShippingOrderResultVO']['shippingCancelDetailVO']['operationMessage'])){ $this->result['message'] = $response['ShippingOrderResultVO']['shippingCancelDetailVO']['operationMessage']; } } 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']; $talep_no = $data['kargo_barcode']; error_reporting(0); @ini_set('display_errors', 0); try{ $service_url = 'http://webservices.yurticikargo.com:8080/KOPSWebServices/ShippingOrderDispatcherServices?wsdl'; $send = array('wsUserName'=>$user_name, 'wsPassword'=>$user_pass, 'wsLanguage'=>'TR', 'keys'=>array($talep_no),'keyType'=>0, 'addHistoricalData'=>0,'onlyTracking'=>1); $response = $this->getSOAP($service_url, 'queryShipment', $send ); if(isset($response['ShippingDeliveryVO']) && $response['ShippingDeliveryVO']['outFlag']==0) { if($response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['operationCode']) { $this->result['data']['kargo_url'] = $response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['shippingDeliveryItemDetailVO']['trackingUrl']; } $this->result['data']['kargo_sonuc'] = $response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['operationMessage']; $this->result['message'] = $this->result['data']['kargo_sonuc'] ; } if(isset($response['ShippingDeliveryVO']) && isset($response['ShippingDeliveryVO']['shippingDeliveryDetailVO']) && isset($response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['errMessage'] )) { $this->result['data']['kargo_sonuc'] = $response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['errMessage']; $this->result['message'] = $cargoid.': '.$response['ShippingDeliveryVO']['shippingDeliveryDetailVO']['errMessage'] ; } } 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{ $client = new SoapClient($service_url, array('trace' => 1, 'exceptions' => 1)); $response = $client->$service_method( $send ); return json_decode(json_encode($response),1); } catch(Exception $e) { $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