source/index/recharge_alipay.ctrl.php

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
	class recharge_alipayControl extends skymvc{
		public $alipay_config;
		public function __construct(){
			parent::__construct();
		}
		
		 
		public function onInit(){
			
		}
		
		public function onDefault(){
			echo "alipay";
		}
		
		public function get()
		{
		    $id=get_post('id', 'i');
		    if ($id) {
		        $where=" id=".$id;
		    } else {
		        $where="";
		    }
		    $this->alipay=M("open_alipay")->selectRow(array("where"=>$where,"order"=>"id DESC"));
		    if(empty($this->alipay)){
				exit("请先配置支付宝");
			} 
			return $this->alipay;
		}
		
		/**
		*调用支付
		**/
		public function onGo(){
			require_once ROOT_PATH.'api/alimini/AopCertClient.php';
			require_once ROOT_PATH.'api/alimini/AopCertification.php';
			if(ISWAP){
				require_once ROOT_PATH.'api/alimini/request/AlipayTradeWapPayRequest.php';
			}else{
				require_once ROOT_PATH.'api/alimini/request/AlipayTradePagePayRequest.php';
			}
			
			
			$config=$this->get();
			
			$code=post("code","h");
			$aop = new AopCertClient ();
			$appCertPath = ROOT_PATH.$config["appcert_path"];
			$alipayCertPath = ROOT_PATH.$config["alicert_path"];
			$rootCertPath = ROOT_PATH.$config["rootcert_path"];
			$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
			$aop->appId = $config["appid"];
			$aop->rsaPrivateKey = $config["merchant_private_key"];				 
			$aop->alipayrsaPublicKey = $aop->getPublicKey($alipayCertPath);
			$aop->apiVersion = '1.0';
			$aop->signType = 'RSA2';
			$aop->postCharset='utf-8';
			$aop->format='json';
			$aop->isCheckAlipayPublicCert = true;//是否校验自动下载的支付宝公钥证书,如果开启校验要保证支付宝根证书在有效期内
后面还有 202 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。