Class: PayPro::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/pay_pro/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Client

Returns a new instance of Client.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/pay_pro/client.rb', line 20

def initialize(config = {})
  @config = case config
            when Hash
              PayPro.config.merge(config)
            when String
              PayPro.config.merge(api_key: config)
            when PayPro::Config
              config
            else
              raise ConfigurationError.new(message: "Invalid argument: #{config}")
            end

  check_api_key!
  setup_endpoints
end

Instance Attribute Details

#chargebacksObject (readonly)

Returns the value of attribute chargebacks.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def chargebacks
  @chargebacks
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/pay_pro/client.rb', line 5

def config
  @config
end

#customersObject (readonly)

Returns the value of attribute customers.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def customers
  @customers
end

#eventsObject (readonly)

Returns the value of attribute events.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def events
  @events
end

#installment_plan_periodsObject (readonly)

Returns the value of attribute installment_plan_periods.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def installment_plan_periods
  @installment_plan_periods
end

#installment_plansObject (readonly)

Returns the value of attribute installment_plans.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def installment_plans
  @installment_plans
end

#mandatesObject (readonly)

Returns the value of attribute mandates.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def mandates
  @mandates
end

#pay_methodsObject (readonly)

Returns the value of attribute pay_methods.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def pay_methods
  @pay_methods
end

#paymentsObject (readonly)

Returns the value of attribute payments.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def payments
  @payments
end

#refundsObject (readonly)

Returns the value of attribute refunds.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def refunds
  @refunds
end

#subscription_periodsObject (readonly)

Returns the value of attribute subscription_periods.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def subscription_periods
  @subscription_periods
end

#subscriptionsObject (readonly)

Returns the value of attribute subscriptions.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def subscriptions
  @subscriptions
end

#webhooksObject (readonly)

Returns the value of attribute webhooks.



7
8
9
# File 'lib/pay_pro/client.rb', line 7

def webhooks
  @webhooks
end