我在使用Rails5进行条带支付处理时遇到了错误。
Stripe::AuthenticationError (No API key provided. Set your API key using "Stripe.api_key = <API-KEY>".
这是我的stripe.rb文件:
Rails.configuration.stripe = {
:publishable_key => ENV["stripe_public_key"],
:secret_key => ENV["stripe_api_k
每次运行heroku命令时,都会收到以下错误:
Your Ruby version is 1.9.3, but your Gemfile specified 2.1.2
自从我推送了几个更改之后,这种情况就一直在发生(添加clock.rb文件并对其进行更改:一个需要迁移数据库的新模型)。
有人知道为什么会发生这种事吗?它只是在我将ruby '2.1.2‘添加到宝石文件之后才开始的。但在那之前我得到了。
这是我的宝石档案:
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', &
我在django代码中建立了一个模型:
import stripe
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.db.models.signals import post_save
from django.db import models
stripe.api_key = settings.STRIPE_SECRET_KEY
#Stripe
class UserStripe(models.Model):
user = model
我有一个包含以下内容的Rakefile:
namespace :geo_data do
desc 'Imports geo data to Heroku'
task :heroku_import => :environment do
system "heroku pg:psql DATABASE -c 'DELETE FROM <table name>' -a <heroku app name>"
# some more stuff...
end
end
每当我运行rake geo_da
? 我已经在我的Ruby on Rails网站上集成了Stripe。如果我用ngrok测试它,一切正常,但是当我使用我的heroku网站地址作为stripe webhook时,它抛出了一个400错误请求错误。如果我查阅文档,它会说缺少一个必需的参数。这可能是因为我没有ssl证书吗?我在Heroku上是免费的,但heroku的网址以https开头……这不是很安全吗?我已经在heroku网站上输入了可发布的、秘密的和签名的密钥。 Routes.rb Rails.application.routes.draw do
mount StripeEvent::Engine, at: '
我正在开发一个应用程序,允许会员升级到高级会员(在与条纹支付后)访问额外的功能。我只在生产环境中使用测试模式下的条纹,因此我正在寻找一种在Heroku控制台中创建高级用户的方法。会是这样的吗?:
user = User.find_by(name:’existing user name’)
user.update_attribute(‘premium’).save
我的schema.rb文件中有t.boolean "premium"。
我是编程新手,所以如果你需要任何额外的文件信息,请让我知道。谢谢!
编辑更新:以下是我的费用控制器代码:
class ChargesContro
当托管在Heroku上时,我的Stripe重定向URL有一些问题。
在本地运行时,所有这些都按预期的方式工作,用户使用可发布的密钥将OAuth连接到数据库,然后在站点中正常运行。
然而,在Heroku上,用户通过OAuth连接到Stripe,输入他们的详细信息和密码,然后在重定向时,他们会收到以下错误消息:
Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL.
到目前为止,这些文档并没有提供帮
我一直在尝试访问我在Rails加密凭据中设置的API密钥。我使用Vim将密钥添加到文件中,并仔细检查它们是否正确保存。 我在config/environments中的测试、开发和生产文件中添加了config.require_master_key = true。 但是,当我尝试使用其中一个API键时,它返回nil。 我的凭证设置如下: # Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
secret_key_base: 1234567890
str
在从rails 5.1升级到rails 5.2.3之后,我将收到这个弃用警告:
secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0. (called from <main> at /config/initializers/stripe.rb:3
如果我看一下条形初始化器,我有:
Rails.configuration.stripe = {
publishable_key: Rails.application.secrets.strip
老实说,我不是红宝石开发商。我正在一个红宝石网站上做一些修复工作。它托管在Heroku服务器上。
我所做的更改不涉及添加或删除任何创业板,而只涉及功能更改。
由于下列问题,我无法推动我的改变:
remote: ! A security vulnerability has been detected in your application.
remote: ! To protect your application you must take action. Your application
remote: ! is currently exposing its c
为什么我的条带订阅不起作用?我收到以下错误,但我无法解决此问题。
当我在条带管理面板中创建付款时,我得到了ID参考。我目前使用我的表中的ID来匹配条带中的ID。我不确定如何纠正这一点。
payment = customer.subscriptions.create(
source: params[:stripeToken],
plan: @subscription
# the subscription.id is the database id
# the plan.id in stripe uses the same id as