-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWechatPay.php
61 lines (55 loc) · 1.26 KB
/
WechatPay.php
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
<?php
namespace iiyii\wechat\sdk;
use yii\base\Event;
use yii\base\InvalidConfigException;
use yii\base\InvalidParamException;
use Yii;
use iiyii\wechat\sdk\WechatBasePay;
use yii\web\HttpException;
use yii\log\Logger;
/**
* 微信公众号支付API类
* 相关文档请参考 http://mp.weixin.qq.com/wiki 微信公众平台开发者文档
*
* @package iiyii\wechat\components
* @version 1.0.0alpha
*/
class WechatPay extends WechatBasePay
{
/**
* 作用:获取结果,默认不使用证书
*/
private function getResult()
{
$this->postXml();
$this->result = $this->xmlToArray($this->response);
return $this->result;
}
/**
* 刷卡支付
* @return [type] [description]
*/
public function getMicropay()
{
$this->url = self::WECHAT_MICRO_PAY_URL;
return $this->getResult();
}
/**
* 统一支付
* @return [type] [description]
*/
public function getpay()
{
$this->url = self::WECHAT_UNIFIED_PAY_URL;
return $this->getResult();
}
/**
* 订单查询
* @return [type] [description]
*/
public function getOrderInfo()
{
$this->url = self::ORDER_QUERY_URL;
return $this->getResult();
}
}