mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-09-22 00:00:31 -04:00
Ensure delete parameters are passed through for subscriptions.
This commit is contained in:
parent
d6ebab3310
commit
b0f0c03990
@ -1,8 +1,8 @@
|
||||
module Stripe
|
||||
module APIOperations
|
||||
module Delete
|
||||
def delete
|
||||
response, api_key = Stripe.request(:delete, url, @api_key)
|
||||
def delete(params = {})
|
||||
response, api_key = Stripe.request(:delete, url, @api_key, params)
|
||||
refresh_from(response, api_key)
|
||||
self
|
||||
end
|
||||
|
@ -22,13 +22,14 @@ module Stripe
|
||||
|
||||
should "subscriptions should be deletable" do
|
||||
@mock.expects(:get).once.returns(test_response(test_customer))
|
||||
@mock.expects(:delete).once.returns(test_response(test_subscription({:deleted => true})))
|
||||
|
||||
customer = Stripe::Customer.retrieve('test_customer')
|
||||
subscription = customer.subscriptions.first
|
||||
subscription.delete
|
||||
|
||||
assert subscription.deleted
|
||||
@mock.expects(:delete).once.with("#{Stripe.api_base}/v1/customers/c_test_customer/subscriptions/#{subscription.id}?at_period_end=true", nil, nil).returns(test_response(test_subscription))
|
||||
subscription.delete :at_period_end => true
|
||||
|
||||
@mock.expects(:delete).once.with("#{Stripe.api_base}/v1/customers/c_test_customer/subscriptions/#{subscription.id}", nil, nil).returns(test_response(test_subscription))
|
||||
subscription.delete
|
||||
end
|
||||
|
||||
should "subscriptions should be updateable" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user