PHP后台微信支付和支付宝支付开发(4)

/** * 支付页面 */ public function doalipay() { $o_id = I("get.o_id", 0, "intval"); $info = $this->model->findone(array("a.id" => $o_id, 'a.status' => array('neq', '-1'))); //10代表订单待支付的状态 if ($info['order_status'] != 10) { $this->error("订单已支付!"); } vendor("Payment.Alipay.Alipay"); $alipay = new \Alipay(); $param['order_sn'] = $info['order_code']; // $param['order_amount'] = $info['pay_price']; $param['order_amount'] = 0.01;//测试支付时,将支付价格设为0.01元,土豪朋友忽略此提示O(∩_∩)O~ $param['order_subject'] = '支付宝支付测试'; $param['return_url'] = 'http://' . $_SERVER['SERVER_NAME'] . '/index.php/Wine/Orders/pay_ok/o_id/'.$o_id; $return = $alipay->submit($param); echo $return; exit; }

就是这么简单几步,到此,支付宝支付的流程就已经结束了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/e83244d50f2ad82c0e7c6b1a1edebbbb.html