- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在 Google App Engine 中测试一个嵌入 Braintree 平台的应用。我正在使用他们的代码进行此测试来处理虚构的交易。在我的 html 中,我有一个表单,提交后它将其信息路由到下面的“/create_transaction”。服务器代码是:
@app.route("/create_transaction", methods=["POST"])
def create_transaction():
result = braintree.Transaction.sale({
"amount": "1000.00",
"credit_card": {
"number": request.form["number"],
"cvv": request.form["cvv"],
"expiration_month": request.form["month"],
"expiration_year": request.form["year"]
},
"options": {
"submit_for_settlement": True
}
})
if result.is_success:
return "<h1>Success! Transaction ID: {0}</h1>".format(result.transaction.id)
else:
return "<h1>Error: {0}</h1>".format(result.message)
浏览器不会返回结果,而是呈现内部服务器错误 500。回溯如下:
ERROR 2014-09-26 03:08:13,852 app.py:1423] Exception on /create_transaction [POST]
Traceback (most recent call last):
File "/home/manuel/Google/braintree_app/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/manuel/Google/braintree_app/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/manuel/Google/braintree_app/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/manuel/Google/braintree_app/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/manuel/Google/braintree_app/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/manuel/Google/braintree_app/app.py", line 40, in create_transaction
"submit_for_settlement": True
File "/home/manuel/Google/braintree_app/braintree/transaction.py", line 302, in sale
return Transaction.create(params)
File "/home/manuel/Google/braintree_app/braintree/transaction.py", line 397, in create
return Configuration.gateway().transaction.create(params)
File "/home/manuel/Google/braintree_app/braintree/transaction_gateway.py", line 33, in create
return self._post("/transactions", {"transaction": params})
File "/home/manuel/Google/braintree_app/braintree/transaction_gateway.py", line 137, in _post
response = self.config.http().post(url, params)
File "/home/manuel/Google/braintree_app/braintree/util/http.py", line 49, in post
return self.__http_do("POST", path, params)
File "/home/manuel/Google/braintree_app/braintree/util/http.py", line 71, in __http_do
raise e
AttributeError: 'NoneType' object has no attribute 'wrap_socket'
为什么 GAE 会抛出此异常?
最佳答案
我在布伦特里工作。如果您需要更多帮助,您可以随时get in touch with our support team .
这似乎是 problem with certain versions of urllib3 / requests (a Braintree dependency) on GAE .
尝试将其添加到您的 app.yaml
文件中:
libraries:
- name: ssl
version: latest
并确保您已为应用程序启用计费功能。
如果这不能解决问题,您可以查看上面链接的 github 问题以获取更多信息。
关于python - 属性错误: 'NoneType' object has no attribute 'wrap_socket' in GAE using Braintree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26051462/
在 GAE 中,我有一个应用程序将文件存储在 GAE blobstore 服务中。数据存储后,还应将其发送到未部署在 GAE 上的外部 Web 服务。我使用Java。 我的第一个想法是使用 JAX-R
我想找到一个用于验证用户、存储用户的 webapp 框架 并且具有jquery的ajax效果, 那么,你知道这个简单的框架吗? 谢谢 喜欢这个页面:http: //digu.com/reg 最佳答案
为了重新部署 GAE 应用程序,我目前必须在我用于部署的系统上安装 GAE 部署工具。虽然这个过程相对简单,但部署过程是一个手动过程,不能在防火墙后运行,并且部署工具必须安装在每台将用于更新 GAE
This链接显示 GAE 不支持开发服务器上的 cron 作业。那么我的其他选择是什么? 当用户的帐户截止日期已到时,我需要向他们发送电子邮件。 最佳答案 使用本地 cron 服务,并编写一个使用 c
我在运行 Maven GAE Plugin 的 gae:debug 目标时遇到问题.我收到的错误如下。有什么想法吗? 我用“mvn gae:debug”运行它。 [INFO] Packaging we
Google 刚刚宣布支持 App Engine 的 PHP 运行时。我有一个使用 Java 运行时开发的应用程序,它利用了 native App Engine 数据存储区。它目前用作移动客户端的后端
是否有一些前端允许管理员从 Google 应用引擎数据存储区插入、更新、删除记录以及创建修改和删除表,就像您在 mysql 上使用 phpMyAdmin 所做的那样??? 最佳答案 Google Ap
我正在以 GAE 为优势实现 PPO。以下代码是我根据OpenAI的基线实现计算GAE和返回的方式。 advantages = np.zeros_like(rewards) last_adv = 0
这是一个[python代码][1],我想知道它是否也可以用于GAE Java(当代码迁移时)。所以问题是,下面的 python 代码是否可以转换为 Java,而无需任何 Java 所没有的 pytho
当在 GAE 中收到一个 http 帖子时,我从另一个服务器下载一个 txt 文件,进行一些解析,然后返回信息。但是,当我更新这个 txt 文件并尝试通过 GAE 访问它时,似乎有延迟。这是一步一步的
当我运行 gae:run 时,它成功构建 jar 并启动服务器。但看起来服务器没有完全启动,因为我无法转到请求的页面。 当我使用 IDE(不是 maven gae 插件)和由 maven gae 插件
我知道有这样的插件可以在 vim 中调试 python:https://github.com/joonty/vdebug 我正在努力寻找调试 GAE 应用程序的方法,这可能吗?如果是这样,我应该采取什
我在 GAE 上部署了一个 webapp2 python 应用程序。有什么方法可以让我从 GAE 控制台探索源代码或更改项目文件。如果我只想更新已部署的应用程序上的单个 .py 文件而不是再次部署整个
我有一个 Google App 引擎应用程序,我希望它的工作方式有所不同,具体取决于它是在我的本地开发环境中运行(即使用 dev_appserver.py)还是在实际的 GAE 云中运行。 目前,我使
阅读 GAE NDB 数据存储的新文档: https://cloud.google.com/appengine/docs/python/ndb/modelclass#class_methods get
今天我第一次上传我的应用程序,当第一个请求进入以触发应用程序初始化时,它失败了。我已经在 Google GAE DEV 服务器上本地测试了所有内容,Google DEV 服务器和真正的 GAE 环境之
我正在使用 GAE 构建应用程序,并想为此使用 Django。哪个“补丁”更好? app-engine-patch 还是 django-gae-helpers?我指的是它们的功能和 future (其
使用 Google App Engine 标准 Python 2.7,我的dispatch.yaml 中有一个路径来指定“*/flex/*”类型的所有网址以路由到 Flex 服务。 调度.yaml调度
我需要一份关于使用 Flex+BlazeDS+Spring+GAE 的可读教程(在 GAE 数据存储中存储多个表)。有这样的吗? 最佳答案 你必须一步一步来: http://www.springsou
我们要重复 spring-boot-sample-gae 的指令一步一步,但我们仍然无法创建 WAR 文件,并出现以下错误消息: [错误] 无法在项目 gae-demo 上执行目标:无法解析项目 or
我是一名优秀的程序员,十分优秀!