parent
3e83da8add
commit
cb7f8d36c0
|
|
@ -172,7 +172,7 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
|
|||
return;
|
||||
}
|
||||
} else { //积分不足
|
||||
$error_message = '积分余额不足.';
|
||||
$error_message = sprintf( __('积分余额不足.剩余%s积分.'), $balanceResult['data']['score']);
|
||||
wc_add_notice( __('结算失败:', 'huayi_score') . $error_message, 'error' );
|
||||
return;
|
||||
}
|
||||
|
|
@ -184,7 +184,7 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
|
|||
}
|
||||
|
||||
/**
|
||||
* 发起退款
|
||||
* 发起退还
|
||||
* @param int $order_id
|
||||
* @param float $amount
|
||||
* @param string $reason
|
||||
|
|
@ -197,10 +197,15 @@ class WC_Huayi_Score extends WC_Payment_Gateway {
|
|||
|
||||
if ( $huayi_uid > 0 ) {
|
||||
$huayiScoreSdk = new HuayiScoreSdk(array('apiurl'=>$this->apiurl,'token'=>$this->token));
|
||||
$result = $huayiScoreSdk->refund($huayi_uid,$amount,get_bloginfo('name').'退款订单号:'.$order_id.'.退款原因:'.$reason);//执行退款
|
||||
$result = $huayiScoreSdk->refund($huayi_uid,$amount,get_bloginfo('name').'退还订单号:'.$order_id.'.退还原因:'.$reason);//执行退还
|
||||
|
||||
if (!$result) {
|
||||
wc_add_notice( __('退还失败:', 'huayi_score') . $huayiScoreSdk->getError(), 'error' );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $result['data']['refund_status'] == 'success' ) {//TODO TEST
|
||||
$order->add_order_note( sprintf( __( '退款时间: %s - 退款会员ID: %s', 'huayi_score' ), date("Y-m-d H:i:s"),$result['uid'] ) );
|
||||
$order->add_order_note( sprintf( __( '退还时间: %s - 退还会员ID: %s', 'huayi_score' ), date("Y-m-d H:i:s"),$result['uid'] ) );
|
||||
return true;
|
||||
} else {
|
||||
return new WP_Error( 'error', $result );
|
||||
|
|
|
|||
Loading…
Reference in New Issue