Reqparams.php
2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
namespace WebPlugin\Pay;
/**
* 请求付款的参数类
* Enter description here ...
* @author smile
*
*/
class Reqparams
{
public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $uid=0, $userName='', $_payExpire = '')
{
//到期时间,默认为当前时间加2个小时的时间戳
$_payExpire = empty($_payExpire) ? strtotime('+2 hours') : strtotime($_payExpire);
$payExpireMinute = 0;//剩余分钟数
if ($_payExpire && ($expireTime = $_payExpire - time()) > 0) {
$payExpireMinute = floor($expireTime / 60);
}
$this->orderCode = $_orderCode;
$this->totalFee = $_totalFee;
$this->goodsName = $_goodName;
$this->spbill_create_ip = $client_ip;
$this->orderTime = $_orderTime;
$this->payExpireMinute = $payExpireMinute;
$this->paymentParameter = $_paymentParameter;
$this->isTest = $_isTest;
$this->uid = $uid;
$this->userName = $userName;
}
/**
* 订单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 string
*/
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;
/**
* 用户ID
* @var integer
*/
var $uid = 0;
/**
* 用户名
* @var string
*/
var $userName = '';
}