-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问是否支持请求预生成二维码付款方式? #9
Comments
你说的是这个吗,用户跳转到支付宝网页,通过扫码或者密实现支付。然后后台可以异步收到支付提醒 用create_web_trade可以实现 |
不是这个,是这个 |
暂时没有,反正最近我有时间,明天我做一个试试 |
太好啦,我看了半天不会弄… |
试试新版的代码吧, 测试不是很严谨,有bug及时找我 |
好的,我下班了试一下。支持预生成二维码收款的话就可以不用营业执照和备案啦 |
关于DEMO
中Alipay应为AliPay, 别的还没开始试,把密钥啥的输入完发现是要贴路径= = |
哈哈哈, 好的,我稍后会修改文档 |
你是用的Python2吗?里面的code即使是unicode也应该可以取出的,因为python会对unicode做隐式的转换, 比如: a = {u"name": u"Lily"}
a["name"]
u'Lily'
>>> |
返回值为: |
是字典里套了个字典的关系 前面我复制的时候少复制了第一个 |
哦,了解, 我明天修改一下吧,其实我是希望所有result返回内容里面不带有 |
我了解啦 那我等更新了再操作 辛苦了 |
0.6.1 好了,你可以再试试 |
神速(大拇指),试了有问题我再报告哈 |
现在有个问题是
讲的应该是异步检测,检测的结果不管付没付都是生成二维码的结果,也就是成功 |
查了一下,异步检测是要有服务器的,ali会post给你一个支付成功的通知= = |
在node js的F2F项目里,作者写道
看来下是这段,不知道是不是一定要有服务器接收post,还是说可以手动request查一下…… |
notify_url 可以在使用precreate_face_to_face_order 的时候传入,然后支付成功会收到支付宝的回调请求。 然后为了不使用这种回调的方法,可以检查result["trade_status"], 如果是“WAIT_BUYER_PAY”, 说明没有支付,如果是“TRADE_SUCCESS”, 则是支付了
|
好的我一会看一看,谢谢 |
刚传入
返回成功,然后查询时同样传入 |
用户扫码前一直是显示4004的,扫码之后就会有trade_status了,你可以这样试试 alipay = AliPay(appid="", ...)
# create an order
result1 = alipay.precreate_face_to_face_trade(
"out_trade_no", 100, "test subject"
# you may input more parameters here, refer to alipay official doc for details
)
# check order status
paid = False
for i in range(10):
# check every 3s, and 10 times in all
print("now sleep 3s")
time.sleep(3)
result = alipay.query_face_to_face_trade(out_trade_no="out_trade_no24")
if result.get("trade_status", "") == "TRADE_SUCCESS":
paid = True
break
print("not paid...")
# order is not paid in 30s , cancel this order
if paid is False:
alipay.cancel_face_to_face_trade(out_trade_no=out_trade_no) |
果然是要扫一下才行,我以为会有pedding之类的状态,之前看到文档里写的WAIT_BUYER_PAY状态 以为会有 |
是的,我之前看文档, 也是以为有你说的那个状态,感觉文档和实际的有点对不上了 |
然后异步检测是否收款的
The text was updated successfully, but these errors were encountered: