Class: SlimpayClient::RecurrentDirectDebit
- Defined in:
- lib/slimpay_client/recurrent_direct_debit.rb
Overview
An abstract CardAlias to be inherited from.
Defines API CardAlias non-semantic methods.
Instance Method Summary collapse
- #cancel(id = 'rec-direct-debit1') ⇒ Object
- #get_one(id = 1) ⇒ Object
-
#initialize ⇒ RecurrentDirectDebit
constructor
A new instance of RecurrentDirectDebit.
Methods inherited from Base
Constructor Details
#initialize ⇒ RecurrentDirectDebit
Returns a new instance of RecurrentDirectDebit.
6 7 8 9 |
# File 'lib/slimpay_client/recurrent_direct_debit.rb', line 6 def initialize @resource_name = self.class.to_s.demodulize.underscore.dasherize.pluralize super end |
Instance Method Details
#cancel(id = 'rec-direct-debit1') ⇒ Object
18 19 20 21 22 23 |
# File 'lib/slimpay_client/recurrent_direct_debit.rb', line 18 def cancel(id = 'rec-direct-debit1') url = "recurrent-direct-debits/#{id}/cancellation" = {} response = HTTParty.post("#{@endpoint}/#{url}", body: .to_json, headers: ) follow_up_api(response) end |
#get_one(id = 1) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/slimpay_client/recurrent_direct_debit.rb', line 11 def get_one(id = 1) url = "#{@endpoint}/recurrent-direct-debits/#{id}" response = HTTParty.get(url, headers: ) generate_api_methods(JSON.parse(response.body)) SlimpayClient.answer(response) end |