对应代码:
# try to pre-authorization the initiator preAuthCharge = None try: errandorFeeUsdCents = floatFeeToUsdCentInt(initiatorErrandFee) gLog.debug("errandorFeeUsdCents=%s", errandorFeeUsdCents) preAuthCharge = stripe.Charge.create(amount=errandorFeeUsdCents, currency="usd", customer=customer.id, capture=False, description="Pre-authorization %.2f$ before publish task"%(initiatorErrandFee), receipt_email=curUser.email) gLog.debug("preAuthCharge=%s", preAuthCharge) except Exception as e: gLog.debug("Before publish task, stripe pre-authorization %.2f$ failed %s"%(initiatorErrandFee, e)) return genRespFailDict(code=BadRequest.code, message="Fail to Pre-authorization %.2f$ before publish task"%(initiatorErrandFee)) |
去尝试预扣款,
试了一个信用卡,是可以成功预扣款的。
但是另外2张储蓄卡,确保卡内都有足够余额,但是预扣款失败
对应log:
[2017-02-07 13:22:00,885 DEBUG Task.py:129 post] errandorFeeUsdCents=1153 [2017-02-07 13:22:02,278 DEBUG Task.py:138 post] Before publish task, stripe pre-authorization 11.53$ failed Request req_A4iLXkjiWf3DZD: Your card was declined. |
如图:
stripe charge failed
stripe charge pre auth failed
stripe charge declined
可以看出,异常错误是:
stripe charge Request Your card was declined
Stripe API Reference – Create a charge
https://stripe.com/docs/api#capture_charge
https://stripe.com/docs/api#refunds
Common Credit Card Errors/Declines on the Checkout page – Cratejoy Help
Avoiding fraud and disputes : Stripe: Help & Support
How to override Stripe’s API error on card decline?
Stripe – Credit Card Declined – Anyone else experiencing repeatedly?:startups
Why was a customer’s charge declined? : Stripe: Help & Support
When a charge is declined by your customer’s bank, we show as much information as we receive about the decline in your dashboard.
->
https://dashboard.stripe.com/login
登录后,看到很多blocked的:
点击进去后看到详情:
$5.80 USD ch_19kxxxxxxxxxxfTq Manage rules Payment blocked due to high risk Stripe risk evaluation: high Primary risk factor: This payment was attempted from an IP address (104.194.87.14) that appears to be used by anonymizing services (e.g. public proxies, Tor exit nodes, or hosting providers). Learn more about risk evaluations. |
点击 Manage Roles:
点击:
Learn more about risk evaluations.
-》
Stripe risk evaluation high This payment was attempted from an IP address that appears to be used by anonymizing services (e.g. public proxies, Tor exit nodes, or hosting providers). Learn more about risk evaluations.
Stripe blocked risk evaluation high
Block rules
Stripe的现代化的工具箱,用于保护免于欺诈性质的支付
Stripe risk evaluation: high Primary risk factor: This payment was attempted from an IP address (104.194.87.14) that appears to be used by anonymizing services (e.g. public proxies, Tor exit nodes, or hosting providers). Learn more about risk evaluations. Primary risk factor: This payment was attempted from an IP address (103.192.224.118) that appears to be used by anonymizing services (e.g. public proxies, Tor exit nodes, or hosting providers). Learn more about risk evaluations. |
104.194.87.14来自加拿大
103.192.224.118来自香港特别行政区
-》看起来是:
好像是代理服务器,导致的不同的IP地址?
-》Stripe检测到这些IP地址(是属于代理服务器之类的?)所以不是很靠谱
所以把预扣券block拦截住了?
-》只能让美国的客户,去自己试试能否正常发布任务,能否正常扣款
-》后来,经过美国客户的尝试,是可以正常使用自己的储蓄卡去正常的预扣款的。
【总结】
此处,由于测试的手机端去访问国外的Amazon的app服务器,需要翻墙才可以,所以手机端的网络访问使用到了代理,而Amazon的服务器中运行代码去执行stripe的预扣款,而stripe内部的系统,判断出IP地址异常(术语网络代理之类的),误判为高风险而block阻止了该交易,导致预扣款失败。
解决办法是:
直接使用正常的手机,比如美国的客户自己的手机端,去操作,就是正常的IP了,就不会被误判为高风险,就可以正常预扣款了。
转载请注明:在路上 » 【已解决】stripe针对某个储蓄卡预扣款失败