Class: Poundpay::ChargePermission

Inherits:
Resource
  • Object
show all
Defined in:
lib/poundpay/elements.rb

Instance Method Summary collapse

Methods inherited from Resource

#collection_name, collection_path, custom_method_collection_url, element_path, #encode, instantiate_collection, new_element_path

Instance Method Details

#deactivateObject



62
63
64
65
66
67
68
69
# File 'lib/poundpay/elements.rb', line 62

def deactivate
  states = ['CREATED', 'ACTIVE']
  unless states.include?(state)
    raise ChargePermissionDeactivateException.new "Charge permission state is #{state}.  Only CREATED or ACTIVE charge permissions may be deactivated."
  end
  attributes['state'] = 'INACTIVE'
  save
end