在
Ruby on Rails中使用stripe的API我无法保存订阅.
我能够检索并更新和保存客户对象:
@H_502_4@customer = Stripe::Customer.retrieve(some_customer_id) #this works customer.save #this works我也能够检索订阅:
subscription = customer.subscriptions.retrieve(“some_subscription_id”)#this works
但是,在尝试保存订阅时:
subscription.save #this不起作用
我一直这样:
@H_502_4@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'同样在尝试取消订阅时:
@H_502_4@customer.subscriptions.retrieve("sub_3QM09lOz64QuSf").delete()我明白了:
@H_502_4@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'没有这个,我无法让客户直接从网站取消.
我错过了什么?