微信支付开发步骤:
1.申请API证书,按照 https://kf.qq.com/faq/161222NneAJf161222U7fARv.html 步骤进行操作
2.开通apiv3秘钥
3.获取微信商户平台证书
通过 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay6_0.shtml 获取sdk和工具
通过安装包直接使用sdk的工具生成证书
php -f ./bin/CertificateDownloader.php – -k ${apiV3key} -m ${mchId} -f ${mchPrivateKeyFilePath} -s ${mchSerialNo} -o ${outputFilePath}
生成证书,在通过微信支付平台公钥路径,从平台证书上提取:openssl x509 -in wechatpay_cert.pem -pubkey -noout > wechatpay_pub.pem
有这3个文件就可以了
4.准备好应用appid
我这里是公众号,记得去微信支付中将公众号app_id绑定到微信支付中
5.测试支付