#ryo-ymd_error

1 messages ¡ Page 1 of 1 (latest)

latent forumBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1213113062748594317

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

balmy valley
#
    def self.list(cus_id:, status: nil)
      response = Stripe::Invoice.list({ customer: cus_id, status: status, expand: %w[data.discounts] })

      invoices = response.data.map { |invoice| StripeWrapper::Invoice.new(invoice) }

      while response.has_more
        response = response.next_page

        invoices.concat(response.data.map { |invoice| StripeWrapper::Invoice.new(invoice) })
      end

      new(invoices: invoices)
    end

Stripe Gem is used to get all of them. This code works perfectly in all cases, but there is one customer who is not right.

timid patioBOT
opaque forum
#

According to the requestId, the API call returned successful response

#

I invite you to debug your code and see what is the content of each var and why you are calling data function on a String