企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
新建`alipay.php`,并将下边代码复制进去,放到 `application/extra` 目录下, ``` // 支付宝配置文件 return [ //应用ID,您的APPID。 'app_id' => "2017091408724714", //商户私钥 'merchant_private_key' => "MIIEowIBAAKCAQEAzuqhx1DejGM6iPyDpAPS09f7E8SlQLMHpH0LxkMeiLfXf471M1N163tUjwAamimE+BDhGRic6T9J05ddY8liQstKEDkUP5ttFlW7yPZSW0PGeb+0fsoAVoUQKDySRM1jkrwPaf4h5AxfsxXCZ+AZ1J3IlLL2a9Z1REmCCfeh2kFCGiCbzowbFIP00XFXzm/hyVa5XFFdg2LHtkMiQhcQd41920LAg16CyainOTA3/DhQjeYTVjWm3mqJS+l7EpCuq+1kIb1AR4CyZHvgYL8OERG9P+s7D60abTHwoGKnsAlh6mOsQnVy5j1TfebsImI20lYElN3LmcRIQ9tV9qwUowIDAQABAoIBAH6bCkoOrV1xCcvv1gxxWnrM2JAL7qFb6f03lhDF2NUGyBEAw/+XvbtMRz0Ibz6M0ROIIHNeoAQH+YBCSZ5ZBoqgIL00b7NLwr+7zZ71OQcmvTaZmjNKHlLSMESua0E1+ws5jqToHoyPFa9aTQ2KDcQOl0CFEEqDelVCNRMsNhh4Y/X5bhR6hnQl75c0sbUlcLTqnHfVTjHc3h2CGXMfiBVE2chbjVDOWmcinO50UVDjScs00iKwPE7MaEieRsqnbrMWtBdR7M2/JGR8zKQaXUd6oitpMERuu44DwdqmkwnnEvoZIWvN6NVvsUPCfdv182yLoDoxUJO+axqGep1dnmECgYEA53HPBGekQZSy9BOP11y/g6wnlNYnFfxcrRnlt++9y3oQLyvGPAG6OIk/f69aDP87Oye2foOEc/wMXpYKtM24w8Bmn1YRQlMXnoo22LUHc8p5s7KbgNXi6UK5yaAAGbdDicrXBw3TJulSSy8Pff14AiKshahUJyapbZeBbdxHe2UCgYEA5N6gEE2ylobCgAGz/Y89XdFsN2Ez+F7jEYfBf4jPonkUGry7LDM46mEduF9pvivEWcTh/nGWrFCaVfzYKhV1q+F0y+hCbLuRO3YpCP4uB9BpwVklKST79kze9jZKAOgvticU9d5M7OU+IqovmKVwh6mqyw+qYzk4iNlwHadGQ2cCgYEAkICYNjHXdjK3QHjuOBJqaHWWCPFkWe/ElTc0HBGNOHuvmyQDkvepIx9eDASZfr/kZVy4LmlCy3+04WFgsd4329BGwnjkMbrbZlr5P3hXfM4QCkgbmubv05+bi+1f4q5vdpq0gmz5RrQqc1Kgo5Mb2Il5mcGtOPyEkC4l20fLQZkCgYAAmcT5xfpuArSH+XkrdTDICkCqdIraYAVgimarmwRQfNjcqRokp43Cr7aQQU/Zu+usAKRHMq0ejqeZCizXD29boB/aWSWze1qKOWkqKOCeDKH6a+15CivPHayIIORY1EMryzZ23rp89K0REjlFwUlmUb+tAMGFuSS41zlAGqxIiQKBgEXu4NyecfEQ2LVZTCeTU2uGHVdLRnXms5hfQh8FFLl2hjJMlsP2Db3P+oRmh49SfUWSoKRI0s0fu1qwJ8JOolvaAP0JTGl8o63vyGzNI/i0qZflwO8BJNLBgsYMHtoKf5xkAazhfytwDSSTp3qWtXcp6Kw9XiEYjOi8jJAXX07L", //异步通知地址 'notify_url' => "http://www.sxqibo.com/demo/alipay.trade.page.pay-PHP-UTF-8/notify_url.php", //同步跳转 'return_url' => "http://www.sxqibo.com/demo/alipay.trade.page.pay-PHP-UTF-8/return_url.php", //编码格式 'charset' => "UTF-8", //签名方式 'sign_type'=>"RSA2", //支付宝网关 'gatewayUrl' => "https://openapi.alipay.com/gateway.do", //支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。 'alipay_public_key' => "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhLaUQEpBDnaDfwxpVT3PyM+nkNVozOZvIrK+tGyH0y27EBFsDi/Lqb/Dp7iYJkywFRvITVl/CTF+G8Twz9MjGh/I4LjhaexZMHKXcRr3TfJJNE+ND2uWYN0zRwcUdMeVKd59aBDNBX3ubyDgXxTZeCIAGbfDzpqTwBfYnhmI10NJYgQKay1dCgheBZM9xY5CBaYeDhPAlnWk77DGLRlTXjlaYDKVNqwx8gnMK1Xezfl2g6wAF2cNIotq+kPnwJkEflMCGMvJAe8+Fgi2hNC0tzALgBpB3j6WGVh9H2lfHlI2AxKA8lIAh+bNJWsdOcPvEsC/+xoCn3jMyGi3BuSMgwIDAQAB", ]; ``` 浏览器输入 http://tp5_alipay2017/index/alipay/index 控制器代码 ``` namespace app\index\controller; class Alipay{ public function index() { dump(config());exit; } } ``` 确保可以搜索到 `alipay`,如图: ![mark](http://qiniu.newthink.cc/blog/20170918-123043877.png) >调用支付宝配置 `config('alipay');`