@@ -136,7 +136,16 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
|
||||
|
||||
if ( $huayi_uid > 0 ) {
|
||||
$huayiScoreSdk = new HuayiScoreSdk(array('apiurl'=>$this->apiurl,'token'=>$this->token));
|
||||
$balanceResult = $huayiScoreSdk->getBalance($huayi_uid);//获取积分余额 TODO
|
||||
$balanceResult = $huayiScoreSdk->getBalance($huayi_uid);//获取积分余额
|
||||
if (!$balanceResult) {
|
||||
wc_add_notice( __('查询积分失败:', 'huayi_score') . $huayiScoreSdk->getError(), 'error' );
|
||||
return;
|
||||
}
|
||||
|
||||
//debug
|
||||
wc_add_notice( __('查询成功:', 'huayi_score') . json_encode($balanceResult), 'error' );
|
||||
return;
|
||||
//debug
|
||||
|
||||
if ($balanceResult >= $order->order_total ) {//积分够扣
|
||||
$payResult = $huayiScoreSdk->pay($huayi_uid,$order->order_total,'订单号:'.$order_id);//执行扣款 TODO
|
||||
|
||||
Reference in New Issue
Block a user