AliwapService.php
1.55 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
<?php
namespace Plugin\Pay\aliwap\v303;
/**
* 支付宝手机网页支付
*/
class AliwapService
{
var $config;
var $alipay_config;
public function __construct()
{
$this->config = require(dirname(__FILE__) . '/AliwapConfig.php');
require_once(dirname(__FILE__) . '/lib/alipay_submit.class.php');
}
/**
* 构造请求参数
* @see QPay_Utils_Interface::getPayRequestPars()
*/
public function getResponse($params)
{
$this->config['cacert'] = dirname(__FILE__) . '/cacert.pem';
//构造要请求的参数数组,无需改动
$parameter = array(
"service" => 'alipay.wap.create.direct.pay.by.user',
"partner" => $this->config['partner'],
"seller_id" => $this->config['seller_id'],
"payment_type" => $this->config['payment_type'],
"notify_url" => $this->config['notify_url'],
"return_url" => $this->config['return_url'],
"out_trade_no" => date('Ymdhis') . $params['orderCode'],
"subject" => 'yoho order:' . $params['orderCode'],
"total_fee" => $params['totalFee'],
"show_url" => $params['showUrl'],
"body" => '有货订单号:' . $params['orderCode'],
"it_b_pay" => $params['payExpire'],
"_input_charset" => $this->config['input_charset'],
);
//建立请求
$alipaySubmit = new \AlipaySubmit($this->config);
$para = $alipaySubmit->buildRequestHttp($parameter);
var_dump($para);
}
}