Class: Cobrato::Client
- Inherits:
-
Object
- Object
- Cobrato::Client
- Defined in:
- lib/cobrato/client.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
- #bank_accounts ⇒ Object
- #charge_configs ⇒ Object
- #charge_templates ⇒ Object
- #charges ⇒ Object
- #charging_types ⇒ Object
- #credit_cards ⇒ Object
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
- #payees ⇒ Object
- #payers ⇒ Object
- #payment_configs ⇒ Object
- #payment_methods ⇒ Object
- #payments ⇒ Object
- #people ⇒ Object
- #regress_cnabs ⇒ Object
- #remittance_cnabs ⇒ Object
- #webhooks ⇒ Object
Constructor Details
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
3 4 5 |
# File 'lib/cobrato/client.rb', line 3 def http @http end |
Instance Method Details
#authenticated? ⇒ Boolean
9 10 11 12 13 14 15 16 |
# File 'lib/cobrato/client.rb', line 9 def authenticated? http.get("") do |response| response.code == 200 end rescue RequestError => e raise e unless e.code == 401 false end |
#bank_accounts ⇒ Object
22 23 24 |
# File 'lib/cobrato/client.rb', line 22 def bank_accounts Resources::BankAccount.new(http) end |
#charge_configs ⇒ Object
26 27 28 |
# File 'lib/cobrato/client.rb', line 26 def charge_configs Resources::ChargeConfig.new(http) end |
#charge_templates ⇒ Object
70 71 72 |
# File 'lib/cobrato/client.rb', line 70 def charge_templates Resources::ChargeTemplate.new(http) end |
#charges ⇒ Object
38 39 40 |
# File 'lib/cobrato/client.rb', line 38 def charges Resources::Charge.new(http) end |
#charging_types ⇒ Object
46 47 48 |
# File 'lib/cobrato/client.rb', line 46 def charging_types Resources::ChargingType.new(http) end |
#credit_cards ⇒ Object
58 59 60 |
# File 'lib/cobrato/client.rb', line 58 def credit_cards Resources::CreditCard.new(http) end |
#payees ⇒ Object
18 19 20 |
# File 'lib/cobrato/client.rb', line 18 def payees Resources::Payee.new(http) end |
#payers ⇒ Object
62 63 64 |
# File 'lib/cobrato/client.rb', line 62 def payers Resources::Payer.new(http) end |
#payment_configs ⇒ Object
30 31 32 |
# File 'lib/cobrato/client.rb', line 30 def payment_configs Resources::PaymentConfig.new(http) end |
#payment_methods ⇒ Object
74 75 76 |
# File 'lib/cobrato/client.rb', line 74 def payment_methods Resources::PaymentMethod.new(http) end |
#payments ⇒ Object
34 35 36 |
# File 'lib/cobrato/client.rb', line 34 def payments Resources::Payment.new(http) end |
#people ⇒ Object
66 67 68 |
# File 'lib/cobrato/client.rb', line 66 def people Resources::Person.new(http) end |
#regress_cnabs ⇒ Object
50 51 52 |
# File 'lib/cobrato/client.rb', line 50 def regress_cnabs Resources::RegressCnab.new(http) end |
#remittance_cnabs ⇒ Object
54 55 56 |
# File 'lib/cobrato/client.rb', line 54 def remittance_cnabs Resources::RemittanceCnab.new(http) end |