无法使用Stripe保存或取消订阅

jco*_*o40 6 ruby ruby-on-rails subscriptions stripe-payments

在Ruby on Rails中使用stripe的API我无法保存订阅.

我能够检索并更新和保存客户对象:

customer = Stripe::Customer.retrieve(some_customer_id) #this works
customer.save #this works
Run Code Online (Sandbox Code Playgroud)

我也能够检索订阅:subscription = customer.subscriptions.retrieve("some_subscription_id")#this works

但是,在尝试保存订阅时:subscription.save #this不起作用

我一直这样:

NoMethodError: undefined method `save' for 
#<Stripe::StripeObject:0x007ff37147c720>
from /Users/me/.rvm/gems/ruby-2.0.0-p353/gems/stripe-    
1.9.9/lib/stripe/stripe_object.rb:158:in `method_missing'
Run Code Online (Sandbox Code Playgroud)

同样在尝试取消订阅时:

customer.subscriptions.retrieve("sub_3QM09lOz64QuSf").delete()
Run Code Online (Sandbox Code Playgroud)

我明白了:

NoMethodError: undefined method `delete' for 
    #<Stripe::StripeObject:0x007ff36d3f0d50>
from /Users/me/.rvm/gems/ruby-2.0.0-p353/gems/stripe-
    1.9.9/lib/stripe/stripe_object.rb:158:in `method_missing'
Run Code Online (Sandbox Code Playgroud)

没有这个,我无法让客户直接从网站取消.

我错过了什么?

McF*_*den 9

升级到他们最新的宝石,bundle update stripe然后再试一次.订阅在1.10.0附近有所改变,之后需要一个版本来保存它们.通过将gemfile配置为使用其github存储库,您实际上使用的是捆绑时可用的最新版本.