私はStripeのテストAPIキーを使ってRailsアプリケーションにサブスクリプションを作成しました。 ダミーカードを使用して作成した費用は、私の側ではうまくいっていますが、ストライプダッシュボードの場合、テストの残高は同じままです。顧客の詳細は追加されません。なぜ私が間違っていたのか分かりません。なぜ私はできないのですか?そして、その顧客データをStripeにどのように追加できますか?ログでは200 OKレスポンスを得ていますが、テストバランスが更新されていないため、ライブモードで何かが機能しなくなるのではないかと心配しています。ストライプテストトランザクション(Rails)で資金を受け取っていません
class SubscribersController < ApplicationController
before_filter :authenticate_user!
def new
end
def update
token = params[:stripeToken]
customer = Stripe::Customer.create(
card: token,
plan: 1020,
email: current_user.email
)
current_user.subscribed = true
current_user.stripeid = customer.id
current_user.save
redirect_to profiles_user_path
end
end
と_form.html.erb
<%= form_tag profiles_user_path, method: :get do %>
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<%= Rails.configuration.stripe[:publishable_key] %>"
data-description="A month's subscription"
data-amount="8999"></script><span> $89 per month </span>
<% end %>
をあなたはどちらかあなたの中に、警告やエラーを取得していますRailsログ、またはブラウザのコンソールを使用して更新アクションを呼び出す –
いいえ、すべてがスムーズに進んでいますが、エラーは発生せず、テストAPIキーを使用しています。 –
ストライプダッシュボードのログはどうですか? –