|
@@ -114,8 +114,9 @@ function __construct(){
|
|
|
}
|
|
|
if(in_array($name,['alipearlstore','finsahair','baddiebeautyshop','yolissahair','Yolissa']))
|
|
|
{
|
|
|
-
|
|
|
- $post['shopify'] = $shopapi.'?limit=100&fulfillment_status=unshipped&financial_status=paid&status=open';//?status=any所有订单 &limit=200每页多少单
|
|
|
+ //limit=100&fulfillment_status=unshipped&financial_status=paid&status=open&created_at_max=2025-07-16T00:00:00Z&gateway=klarna
|
|
|
+ //limit=100&fulfillment_status=unshipped&financial_status=paid&status=open&created_at_min=2025-07-16T00:00:00Z&gateway=klarna
|
|
|
+ $post['shopify'] = $shopapi.'?limit=100&fulfillment_status=unshipped&financial_status=paid&status=open&created_at_min='.date('c',time()-3600*24*2);//?status=any所有订单 &limit=200每页多少单
|
|
|
$ch = curl_init();
|
|
|
curl_setopt($ch,CURLOPT_URL,'https://edm.alipearl.net/soapapi.php');
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
@@ -221,10 +222,12 @@ function __construct(){
|
|
|
$created_at_hi = explode('-',$created_at[1]);
|
|
|
$created_at = $created_at[0].' '.$created_at_hi[0];
|
|
|
$paypal = '';
|
|
|
+ $paypal_protection_eligibility = "";
|
|
|
$d = $this->authorization($shop,$v['id']);
|
|
|
if($d['g'] == 1)
|
|
|
{
|
|
|
$paypal = $d['d'];
|
|
|
+ $paypal_protection_eligibility = $d['protection_eligibility'];
|
|
|
}
|
|
|
|
|
|
// if($name == 'baddiebeautyshop')
|
|
@@ -344,7 +347,7 @@ function __construct(){
|
|
|
'pay' => $pay,
|
|
|
'paypal_num' => $paypal,
|
|
|
'insurance' => 0,
|
|
|
- 'paypal_protection_eligibility' => '',
|
|
|
+ 'paypal_protection_eligibility' => $paypal_protection_eligibility,
|
|
|
'shippingmethod'=>'',
|
|
|
'link'=>$link,//产品链接
|
|
|
'shopify'=>$v['id'],
|
|
@@ -581,15 +584,26 @@ function __construct(){
|
|
|
{
|
|
|
return array('g'=>0);exit;
|
|
|
}
|
|
|
- $a['transactions'] = array_reverse($a['transactions']);
|
|
|
- if(isset($a['transactions'][0]['authorization']))
|
|
|
- {
|
|
|
- return array('g'=>1,'d'=>$a['transactions'][0]['authorization']);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return array('g'=>0);
|
|
|
+ if($a['transactions'][0]['gateway'] == 'Klarna'){
|
|
|
+ return array('g'=>1,'d'=>$a['transactions'][0]['payment_id'],'protection_eligibility'=>"");
|
|
|
+ }else{
|
|
|
+ $a['transactions'] = array_reverse($a['transactions']);
|
|
|
+ if(isset($a['transactions'][0]['authorization']))
|
|
|
+ {
|
|
|
+ $protection_eligibility = "";
|
|
|
+ if(isset($a['transactions'][0]['receipt'])){
|
|
|
+ if(isset($a['transactions'][0]['receipt']['protection_eligibility'])){
|
|
|
+ $protection_eligibility = $a['transactions'][0]['receipt']['protection_eligibility'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return array('g'=>1,'d'=>$a['transactions'][0]['authorization'],'protection_eligibility'=>$protection_eligibility);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return array('g'=>0);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public function su_curl($data,$url,$header=array(),$date_type='json',$timeout=300,$httptype="POST",$userpwd='')
|