lib/braintree/subscription.rb in braintree-1.2.1 vs lib/braintree/subscription.rb in braintree-2.0.0
- old
+ new
@@ -18,10 +18,14 @@
# :price => "1.00",
# :trial_period => true,
# :trial_duration => "2",
# :trial_duration_unit => Subscription::TrialDurationUnit::Day
# )
+ #
+ # == More Information
+ #
+ # For more detailed documentation on Subscriptions, see http://www.braintreepaymentsolutions.com/gateway/subscription-api
class Subscription
include BaseModule
module Status
Active = 'Active'
@@ -88,10 +92,10 @@
block.call(search)
response = Http.post "/subscriptions/advanced_search?page=#{page}", {:search => search.to_hash}
attributes = response[:subscriptions]
attributes[:items] = Util.extract_attribute_as_array(attributes, :subscription).map { |attrs| new(attrs) }
- PagedCollection.new(attributes) { |page_number| Subscription.search(page_number, &block) }
+ ResourceCollection.new(attributes) { |page_number| Subscription.search(page_number, &block) }
end
def self.update(subscription_id, attributes)
Util.verify_keys(_update_signature, attributes)
response = Http.put "/subscriptions/#{subscription_id}", :subscription => attributes