dedemao / alipay Goto Github PK
View Code? Open in Web Editor NEW一个PHP文件搞定支付宝支付系列,包括电脑网站支付,手机网站支付,现金红包、消费红包、扫码支付,JSAPI支付、单笔转账到支付宝账户、交易结算(分账、分润)、网页授权获取用户信息等
Home Page: https://www.dedemao.com/alipay/demo.html
License: MIT License
一个PHP文件搞定支付宝支付系列,包括电脑网站支付,手机网站支付,现金红包、消费红包、扫码支付,JSAPI支付、单笔转账到支付宝账户、交易结算(分账、分润)、网页授权获取用户信息等
Home Page: https://www.dedemao.com/alipay/demo.html
License: MIT License
网页授权获取用户信息中scope的值为auth_user,已经替代之前的auth_userinfo。
alipay.user.info.share已经替代了alipay.user.userinfo.share
$userinfo得到的用户信息参数['alipay_user_info_share_response']已经替代了['alipay_user_userinfo_share_response']
1
Originally posted by @lifnn99526 in #20 (comment)
感觉很奇怪啊,不知道为什么,是不是支付改了规则?
The each() function is deprecated. This message will be suppressed on further calls
代码所在电脑网站支付文件。
实际支付成功后,同步跳转可以正常验证支付。而异步通知一直是错误。
没有看到app支付呀???能否写一个呢??
同步验签是成功的,异步验签失败
1
return.php
if($result===true){
下 没有 exit()
然后 没有 else 导致 '不合法的请求' 每次都执行
transfers.php 記得更新有新版本接口了
openssl_sign(): supplied key param cannot be coerced into a private key
可以加一下支付宝 公钥证书
模式的的吗?
notify_url 和支付宝设置的回调地址是不是一个?我这notify_url 回调方法里面 $_POST 为空怎么回事
网页授权获取用户信息 非最新版 获取不了获取昵称、头像、手机号等信息(需用户授权)
` function getCertSN($certPath): string
{
if (!is_file($certPath)) {
throw new Exception('unknown certPath -- [getCertSN]');
}
$x509data = file_get_contents($certPath);
if (false === $x509data) {
throw new Exception('Alipay CertSN Error -- [getCertSN]');
}
openssl_x509_read($x509data);
$certdata = openssl_x509_parse($x509data);
if (empty($certdata)) {
throw new Exception('Alipay openssl_x509_parse Error -- [getCertSN]');
}
$issuer_arr = [];
foreach ($certdata['issuer'] as $key => $val) {
$issuer_arr[] = $key.'='.$val;
}
$issuer = implode(',', array_reverse($issuer_arr));
return md5($issuer.$certdata['serialNumber']);
}`
appCertSn需要对应生成才可以
创建订单时候是否支持定义订单过期时间?
例如当面付,提交的编码参数和异步通知回调是对应不上的,测试发现如在curlPost方法内添加
`
$headers = array('content-type: application/x-www-form-urlencoded;charset=' . $this->charset);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
`两者的编码格式就能对应上了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.