Sha256: 410409046e5d39d4fc837dadcdaa3ec9cbdd1ec00785078baa42ba0c143e5584

Contents?: true

Size: 1.15 KB

Versions: 16

Compression:

Stored size: 1.15 KB

Contents

module Cobrato
  class Client
    attr_reader :http

    def initialize(token)
      @http = Http.new(token)
    end

    def authenticated?
      http.get("") do |response|
        response.code == 200
      end
    rescue RequestError => e
      raise e unless e.code == 401
      false
    end

    def payees
      Resources::Payee.new(http)
    end

    def bank_accounts
      Resources::BankAccount.new(http)
    end

    def charge_configs
      Resources::ChargeConfig.new(http)
    end

    def payment_configs
      Resources::PaymentConfig.new(http)
    end

    def payments
      Resources::Payment.new(http)
    end

    def charges
      Resources::Charge.new(http)
    end

    def webhooks
      Resources::Webhook.new(http)
    end

    def charging_types
      Resources::ChargingType.new(http)
    end

    def regress_cnabs
      Resources::RegressCnab.new(http)
    end

    def remittance_cnabs
      Resources::RemittanceCnab.new(http)
    end

    def credit_cards
      Resources::CreditCard.new(http)
    end

    def payers
      Resources::Payer.new(http)
    end

    def charge_templates
      Resources::ChargeTemplate.new(http)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cobrato-client-0.26.0 lib/cobrato/client.rb
cobrato-client-0.25.0 lib/cobrato/client.rb
cobrato-client-0.24.1 lib/cobrato/client.rb
cobrato-client-0.24.0 lib/cobrato/client.rb
cobrato-client-0.23.0 lib/cobrato/client.rb
cobrato-client-0.23.0.beta12 lib/cobrato/client.rb
cobrato-client-0.23.0.beta11 lib/cobrato/client.rb
cobrato-client-0.23.0.beta10 lib/cobrato/client.rb
cobrato-client-0.23.0.beta9 lib/cobrato/client.rb
cobrato-client-0.23.0.beta8 lib/cobrato/client.rb
cobrato-client-0.23.0.beta7 lib/cobrato/client.rb
cobrato-client-0.23.0.beta6 lib/cobrato/client.rb
cobrato-client-0.23.0.beta5 lib/cobrato/client.rb
cobrato-client-0.23.0.beta4 lib/cobrato/client.rb
cobrato-client-0.23.0.beta3 lib/cobrato/client.rb
cobrato-client-0.23.0.beta2 lib/cobrato/client.rb