|
@@ -55,6 +55,9 @@ class Aatest extends Start_Controller {
|
|
if($arg == 'fout')
|
|
if($arg == 'fout')
|
|
{
|
|
{
|
|
$this->_fout();
|
|
$this->_fout();
|
|
|
|
+ }else if($arg == 'ceshi')
|
|
|
|
+ {
|
|
|
|
+ $this->_ceshi();
|
|
}else{
|
|
}else{
|
|
$this->_a($arg_array);
|
|
$this->_a($arg_array);
|
|
}
|
|
}
|
|
@@ -119,4 +122,41 @@ class Aatest extends Start_Controller {
|
|
//$this->fedexv1->makeAccessToken();
|
|
//$this->fedexv1->makeAccessToken();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function _ceshi(){
|
|
|
|
+ $arr =[1,2];
|
|
|
|
+ var_dump($arr[3]);
|
|
|
|
+ // $arr = [
|
|
|
|
+ // '4600368432',
|
|
|
|
+ // '2800005184',
|
|
|
|
+ // '3800007040',
|
|
|
|
+ // '3600656330',
|
|
|
|
+ // '3600656403',
|
|
|
|
+ // '3800006595'
|
|
|
|
+ // ];
|
|
|
|
+ //$order_list = $this->fullorder->find_all('orderinfo in ('.implode(',',$arr).')');
|
|
|
|
+ //foreach ($order_list as $k=>$v){
|
|
|
|
+ // $shop = $this->shop->read($v['shop']);
|
|
|
|
+ // $this->_klarnadata($v['paypal'],$shop['klarnaname'],$shop['klarnapass'],$v['number']);
|
|
|
|
+ // usleep(10);
|
|
|
|
+ //}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function _klarnadata($paypal,$name,$pass,$number)
|
|
|
|
+ {
|
|
|
|
+ $url = 'https://api-na.klarna.com/ordermanagement/v1/orders/'.$paypal;
|
|
|
|
+ $header[] = "Content-Type:application/json";
|
|
|
|
+ $header[] = "Authorization: Basic ".base64_encode($name.":".$pass);
|
|
|
|
+ $ch = curl_init();
|
|
|
|
+ curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
|
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
|
+ $res = curl_exec($ch);
|
|
|
|
+ curl_close($ch);
|
|
|
|
+ $res = json_decode($res,true);
|
|
|
|
+
|
|
|
|
+ $this->logic_ding->sendToDing($number."API【2042】".json_encode($res));
|
|
|
|
+ }
|
|
}
|
|
}
|