ruby list_all_charges.rb

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby list_all_charges.rb相关的知识,希望对你有一定的参考价值。

require 'stripe'
Stripe.api_key = "sk_example"

# Get the first 100 charges. Use limit => 100 to change the default value from 10 to 100
charges = Stripe::Charge.all(:limit => 100)

# Print the charge ID for each one
charges.each do |charge|
  puts charge.id
end

# If there are more than 100 charges, paginate through each set of 100
while charges.has_more do 
  charges = Stripe::Charge.all(:limit => 100, :starting_after => charges.data.last.id)
  
  charges.each do |charge|
    puts charge.id
  end
end

以上是关于ruby list_all_charges.rb的主要内容,如果未能解决你的问题,请参考以下文章

Ruby运算符

Ruby 25 岁了!Ruby 之父说 Ruby 3 有望 3 倍提速

如何学习ruby?Ruby学习技巧分享

ruby Ruby脚本,看看是否用openssl编译了ruby

什么是ruby?

ruby和ruby ee