微信公众号支付开发演示的应用

这是使用最简的代码实现微信支付演示的应用。适合新手学习!教程请前往开发文档
<?php
namespace addons\rhaPay\controller;
use app\common\controller\Addon;
use app\common\model\Payment;
class Index extends Addon
{
public $isWexinLogin=true;
public function index(){
$money =1;//设置金额
$member = getMember();//获取会员信息
$model = new Payment();
$id = $model->addPayment($member['id'], $this->mid, $money, '微信支付演示');
$payUrl=getWxPayUrl($this->mid,['payment_id' => $id,'view'=>$this->addonRoot.'/view/index/pay.html']);
$this->redirect($payUrl);
}
}

0 个评论

要回复文章请先登录注册