|
|
@@ -0,0 +1,34 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+
|
|
|
+namespace App\Services;
|
|
|
+
|
|
|
+
|
|
|
+use Exception;
|
|
|
+use Illuminate\Support\Facades\Http;
|
|
|
+
|
|
|
+class LogisticQiaoSFService
|
|
|
+{
|
|
|
+ public function get()
|
|
|
+ {
|
|
|
+ $url = config('api_logistic.SF.url');
|
|
|
+ $head = config('api_logistic.SF.head');
|
|
|
+ $checkWord = config('api_logistic.SF.checkWord');
|
|
|
+ $xml = <<<xml
|
|
|
+<?xml version="1.0" encoding="utf-8" ?>
|
|
|
+ <Request service='RouteService' lang='zh-CN'>
|
|
|
+ <Head>$head</Head>
|
|
|
+ <Body>
|
|
|
+ <RouteRequest
|
|
|
+ tracking_type='1'
|
|
|
+ method_type='1'
|
|
|
+ tracking_number='XJFS_071100251'/>
|
|
|
+ </Body>
|
|
|
+ </Request>
|
|
|
+xml;
|
|
|
+ $checkingJson=$xml.$checkWord;
|
|
|
+ $verifyCode=base64_encode(md5($checkingJson,true));
|
|
|
+ $response = Http::withHeaders(['Content-Type'=>'text/xml'])->get($url, ['xml' => $xml, 'verifyCode' => $verifyCode]);
|
|
|
+ return $response->body();
|
|
|
+ }
|
|
|
+}
|