Signed-off-by: hitsword <mail@huayizhiyun.com>
master
hitsword 2019-05-20 18:00:26 +08:00
parent a14383c5c6
commit c8344f272e
1 changed files with 6 additions and 2 deletions

View File

@ -144,6 +144,11 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
if ($balanceResult['data']['score'] >= $order->order_total ) {//积分够扣 if ($balanceResult['data']['score'] >= $order->order_total ) {//积分够扣
$payResult = $huayiScoreSdk->pay($huayi_uid,$order->order_total,'订单号:'.$order_id);//执行扣款 $payResult = $huayiScoreSdk->pay($huayi_uid,$order->order_total,'订单号:'.$order_id);//执行扣款
if (!$payResult) {
wc_add_notice( __('结算失败:', 'huayi_score') . $huayiScoreSdk->getError(), 'error' );
return;
}
//支付成功 //支付成功
if ( $payResult['data']['pay_status'] == 'success' ) {//TODO TEST if ( $payResult['data']['pay_status'] == 'success' ) {//TODO TEST
@ -163,8 +168,7 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
'redirect' => $this->get_return_url( $order ) 'redirect' => $this->get_return_url( $order )
); );
} else { //支付失败 } else { //支付失败
$error_message = '支付接口出错 - ' . $payResult; wc_add_notice( __('结算失败:', 'huayi_score') . $payResult, 'error' );
wc_add_notice( __('结算失败:', 'huayi_score') . $error_message, 'error' );
return; return;
} }
} else { //积分不足 } else { //积分不足