Class: Paysafe::REST::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/paysafe/rest/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Paysafe::REST::Client

Initializes a new Client object

Parameters:

  • options (Hash)


12
13
14
# File 'lib/paysafe/rest/client.rb', line 12

def initialize(**options)
  @config = Configuration.new(**options)
end

Instance Method Details

#card_paymentsObject



30
31
32
# File 'lib/paysafe/rest/client.rb', line 30

def card_payments
  @card_payments ||= Api::CardPaymentsApi.new(@config)
end

#credentialsHash

Returns:

  • (Hash)


17
18
19
# File 'lib/paysafe/rest/client.rb', line 17

def credentials
  { api_key: api_key, api_secret: api_secret }
end

#credentials?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/paysafe/rest/client.rb', line 22

def credentials?
  credentials.values.all?
end

#customer_vaultObject



26
27
28
# File 'lib/paysafe/rest/client.rb', line 26

def customer_vault
  @customer_vault ||= Api::CustomerVaultApi.new(@config)
end

#paymentsObject



34
35
36
# File 'lib/paysafe/rest/client.rb', line 34

def payments
  @payments ||= Api::PaymentsApi.new(@config)
end