parent
569ed8b46f
commit
da22451623
|
|
@ -143,7 +143,7 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
|
|||
}
|
||||
|
||||
if ($balanceResult['data']['score'] >= $order->order_total ) {//积分够扣
|
||||
$payResult = $huayiScoreSdk->pay($huayi_uid,$order->order_total,get_bloginfo('name').'订单号:'.$order_id);//执行扣款
|
||||
$payResult = $huayiScoreSdk->pay($huayi_uid, $order_id, $order->order_total,get_bloginfo('name').'订单号:'.$order_id);//执行扣款
|
||||
if (!$payResult) {
|
||||
wc_add_notice( __('结算失败:', 'huayi_score') . $huayiScoreSdk->getError(), 'error' );
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -55,16 +55,18 @@ class HuayiScoreSdk
|
|||
* PASS
|
||||
* 支出积分
|
||||
* @param $huayi_uid
|
||||
* @param $order_id
|
||||
* @param $amount
|
||||
* @param $note
|
||||
* @return bool
|
||||
*/
|
||||
public function pay($huayi_uid, $amount, $note)
|
||||
public function pay($huayi_uid, $order_id, $amount, $note)
|
||||
{
|
||||
$url = $this->apiurl.$this->pay_url;
|
||||
|
||||
$data = [
|
||||
'uid'=>$huayi_uid,
|
||||
'out_trade_no'=>$order_id,
|
||||
'amount'=>$amount,
|
||||
'note'=>$note,
|
||||
'timestamp'=>time()
|
||||
|
|
|
|||
Loading…
Reference in New Issue