Example #1
0
 public function build($msg)
 {
     parent::build($msg);
     $array = array();
     $hblist = (array) $this->hblist;
     foreach ($hblist['hbinfo'] as $hbinfo) {
         $hbinfo = (array) $hbinfo;
         $array[] = array("openid" => $hbinfo['openid'], "amount" => $hbinfo['amount'], "rcv_time" => $hbinfo['rcv_time']);
     }
     $this->hblist = $array;
 }
Example #2
0
File: pay.php Project: qujian/ydwx
/**
 * 以下情况需要调用关单接口:商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,
 * 避免重复支付;系统下单后,用户支付超时,系统退出不再受理,避免用户继续,请调用关单接口。
 * 
 * 注意:订单生成后不能马上调用关单接口,最短调用时间间隔为5分钟。
 *
 * @param YDWXCloseOrderRequest arg
 * @return YDWXPayBaseResponse
 */
function ydwx_pay_closeorder(YDWXCloseOrderRequest $arg)
{
    $arg->sign();
    $args = $arg->toXMLString();
    $http = new YDHttp();
    $info = $http->post(YDWX_WEIXIN_PAY_URL . "pay/closeorder", $args);
    $msg = new YDWXPayBaseResponse($info);
    if (!$msg->isSuccess()) {
        throw new YDWXException($msg->errmsg);
    }
    return $msg;
}