Home > php教程 > php手册 > body text

PHP 在ecshop上集成 手机网页支付

WBOY
Release: 2016-06-21 08:50:20
Original
1521 people have browsed it

参考alipay网页支付接口的代码 

其实原理跟ecshop上集成的alipay支付差不多  就是因为利用curl请求的时候相应时间过长 所以不能直接去先post数据再生成button

 

/**

* 生成支付代码

* @param   array   $order      订单信息

* @param   array   $payment    支付方式信息

*/

function get_code($order, $payment)

{

if (!defined('EC_CHARSET'))

{

$charset = 'utf-8';

}

else

{

$charset = EC_CHARSET;

}

 

$jsonorder = json_encode($order);

$jsonpayment = json_encode($payment);

$jsonorder = urlencode($jsonorder);

$jsonpayment = urlencode($jsonpayment);

 

$button = '

';

 

return $button;

}



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template