

railsとstripeを使い購入時に販売者へ送金するシステムを作りたいがErrorが出てしまいます。  
購入機能は実装済みです。

[code]

    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).):
    
[/code]

このようなErrorです。

[code]

      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
    
[/code]

rails6  
postgresSQL  
slim使用

なにかわかる方は回答お願いします。


CC BY-SA 4.0
2020-09-21T03:16:15.240
70574
2020-09-21T04:21:18.300
2020-09-21T04:21:18.300
39630
39630
question
ruby-on-rails ruby
railsとstripeを使い送金したいができない