railsとstripeを使い購入時に販売者へ送金するシステムを作りたいがErrorが出てしまいます。
購入機能は実装済みです。
Stripe::InvalidRequestError (Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).):
このようなErrorです。
def create
@product = Post.find(params[:id])
customer = Stripe::Customer.create({
email: params[:stripeEmail],
source: params[:stripeToken],
})
charge = Stripe::Charge.create({
customer: customer.id,
amount: @product.price,
description: "商品ID:#{@product.id} 商品名:#{@product.title}",
currency: "jpy",
})
Stripe::Transfer.create(
amount: 1000,
currency: 'jpy',
destination: "acct_1HTeoFHhVt1bl0H3"
)
rescue Stripe::CardError => e
flash[:error] = e.message
redirect_to "/"
end
rails6
postgresSQL
slim使用
なにかわかる方は回答お願いします。