Class: Cobrato::Resources::Payment

Inherits:
Base
  • Object
show all
Defined in:
lib/cobrato/resources/payment.rb

Instance Attribute Summary

Attributes inherited from Base

#http

Instance Method Summary collapse

Methods inherited from Base

#collection_name, #create, crud, #destroy, #initialize, #list, #parsed_body, #show, #update

Methods included from Hooks

#notify

Constructor Details

This class inherits a constructor from Cobrato::Resources::Base

Instance Method Details

#cancel(id) ⇒ Object



6
7
8
9
10
# File 'lib/cobrato/resources/payment.rb', line 6

def cancel(id)
  http.post("#{resource_base_path}/#{id}/cancel") do |response|
    respond_with_entity response
  end
end

#register_error(id) ⇒ Object



30
31
32
33
34
# File 'lib/cobrato/resources/payment.rb', line 30

def register_error(id)
  http.post("#{resource_base_path}/#{id}/register_error") do |response|
    respond_with_entity response
  end
end

#reschedule(id, params) ⇒ Object



24
25
26
27
28
# File 'lib/cobrato/resources/payment.rb', line 24

def reschedule(id, params)
  http.post("#{resource_base_path}/#{id}/reschedule", params: params) do |response|
    respond_with_entity response
  end
end

#schema(params) ⇒ Object



12
13
14
15
16
# File 'lib/cobrato/resources/payment.rb', line 12

def schema(params)
  http.get("#{resource_base_path}/schema", params: params) do |response|
    parsed_body(response)
  end
end

#unauthorize(id) ⇒ Object



18
19
20
21
22
# File 'lib/cobrato/resources/payment.rb', line 18

def unauthorize(id)
  http.post("#{resource_base_path}/#{id}/unauthorize") do |response|
    respond_with_entity response
  end
end