Compare commits
2 Commits
774dc72635
...
ef62e8e7d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef62e8e7d0 | ||
|
|
01293220ef |
@@ -92,12 +92,12 @@ class Order extends base{
|
|||||||
$paystation_info = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
$paystation_info = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
||||||
$response = paystationLookup($paystation_info["merchant_session"]);
|
$response = paystationLookup($paystation_info["merchant_session"]);
|
||||||
$res = xml_to_array($response);
|
$res = xml_to_array($response);
|
||||||
if(isset($res['PaystationQuickLookup']['LookupResponse']['Authentication']['auth_Status'])&&$res['PaystationQuickLookup']['LookupResponse']['Authentication']['auth_Status']=="Y"){
|
if(isset($res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage'])&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage']=="Transaction successful"&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorCode']==0){
|
||||||
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
||||||
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
||||||
return jsonSuccess(["result"=>"success","paystation"=>$paystation_info]);
|
return jsonSuccess(["result"=>"success","paystation"=>$paystation_info]);
|
||||||
}else{
|
}else{
|
||||||
return jsonSuccess(['result'=>"fail"]);
|
return jsonSuccess(['result'=>"fail","msg"=> $res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage'] ?? "no message"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,12 +134,10 @@ class Order extends base{
|
|||||||
$response = curl_exec($ch);
|
$response = curl_exec($ch);
|
||||||
if(curl_errno($ch)) {
|
if(curl_errno($ch)) {
|
||||||
echo 'Error:' . curl_error($ch);
|
echo 'Error:' . curl_error($ch);
|
||||||
} else {
|
|
||||||
echo "Response: " . $response;
|
|
||||||
}
|
}
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
return jsonSuccess($response);
|
return jsonSuccess(xml_to_array($response));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -382,6 +380,16 @@ class Order extends base{
|
|||||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||||
$user_info = $this->user_obj->where("user_id",$article_info['user_id'])->find();
|
$user_info = $this->user_obj->where("user_id",$article_info['user_id'])->find();
|
||||||
|
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
|
||||||
|
if($order_info&$order_info['state']==0&&$order_info['ps_id']>0){
|
||||||
|
$paystation = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
||||||
|
$res = xml_to_array(paystationLookup($paystation['merchant_session']));
|
||||||
|
if(isset($res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage'])&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage']=="Transaction successful"&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorCode']==0){
|
||||||
|
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
||||||
|
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
||||||
|
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||||
|
}
|
||||||
|
}
|
||||||
$re['article_detail'] = $article_info;
|
$re['article_detail'] = $article_info;
|
||||||
$re['journal_detail'] = $journal_info;
|
$re['journal_detail'] = $journal_info;
|
||||||
$re['user_detail'] = $user_info;
|
$re['user_detail'] = $user_info;
|
||||||
|
|||||||
@@ -756,16 +756,18 @@ class Preaccept extends Base
|
|||||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||||
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
|
$order_info = $this->order_obj->where("article_id",$article_info['article_id'])->find();
|
||||||
|
if($order_info){
|
||||||
$paystation = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
$paystation = $this->paystation_obj->where("ps_id",$order_info['ps_id'])->find();
|
||||||
$order_info['paystation'] = $paystation;
|
$order_info['paystation'] = $paystation;
|
||||||
if($order_info['state']==0){
|
if($order_info['state']==0){
|
||||||
$res = xml_to_array(paystationLookup($paystation['merchant_session']));
|
$res = xml_to_array(paystationLookup($paystation['merchant_session']));
|
||||||
if(isset($res['PaystationQuickLookup']['LookupResponse']['Authentication']['auth_Status'])&&$res['PaystationQuickLookup']['LookupResponse']['Authentication']['auth_Status']=="Y"){
|
if(isset($res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage'])&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorMessage']=="Transaction successful"&&$res['PaystationQuickLookup']['LookupResponse']['PaystationErrorCode']==0){
|
||||||
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
$this->article_obj->where("article_id",$order_info['article_id'])->update(['is_buy'=>1]);
|
||||||
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
$this->order_obj->where("order_id",$order_info['order_id'])->update(['state'=>1]);
|
||||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$re['state'] = $article_info['is_buy'];
|
$re['state'] = $article_info['is_buy'];
|
||||||
$re['order'] = $order_info;
|
$re['order'] = $order_info;
|
||||||
$re["fee"] = $article_info['fee'];
|
$re["fee"] = $article_info['fee'];
|
||||||
|
|||||||
Reference in New Issue
Block a user