AliwapReqparams.php 1.54 KB
<?php

namespace Plugin\Pay\aliwap;

/**
 * 请求付款的参数类
 */
class AliwapReqparams 
{
	
	public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $_payExpire = '')
	{
		//当前时间加六十秒,访问有误差。支付宝是yy-mm-dd HH:ii,没有秒
        if (empty($_payExpire)) {
			$_payExpire = strtotime('+2 hours', $_orderTime) + 60;
		} else {
			$_payExpire = strtotime($_payExpire) + 60;
		}

        $this->orderCode = $_orderCode;
        $this->totalFee = $_totalFee;
        $this->goodsName = $_goodName;
        $this->spbill_create_ip = $client_ip;
        $this->orderTime = $_orderTime;
        $this->paymentParameter = $_paymentParameter;
        $this->isTest = $_isTest;
        $this->payExpire = $_payExpire;//到期时间
	}
	
	/**
	 * 订单Code
	 * Enter description here ...
	 * @var Integer
	 */
	var $orderCode = 0;
	
	/**
	 * 付款金额,统一采用分为单位
	 * Enter description here ...
	 * @var double
	 */
	var $totalFee = 0;
	
	
	/**
	 * 商品名称
	 * Enter description here ...
	 * @var String
	 */
	var $goodsName = "";
	
	/**
	 * 客户的ip
	 * Enter description here ...
	 * @var Integer
	 */
	var $spbill_create_ip = "";
	
	/**
	 * 订单时间
	 * Enter description here ...
	 * @var unknown_type
	 */
	var $orderTime = "";
	
	/**
	 * 支付方式参数
	 * Enter description here ...
	 * @var string
	 */
	var $paymentParameter = "";
	
	/**
	 * 是否为测试
	 * Enter description here ...
	 * @var bool
	 */
	var $isTest = false;
}