Class: DPay::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dpay/client.rb,
sig/dpay/client.rbs

Constant Summary collapse

VERSION =

Returns:

  • (String)
DPay::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service:, secret_hash:, timeout: Config::DEFAULT_TIMEOUT, http_client: nil, base_urls: nil) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dpay/client.rb', line 9

def initialize(service:, secret_hash:, timeout: Config::DEFAULT_TIMEOUT, http_client: nil, base_urls: nil)
  @config = Config.new(
    service: service, secret_hash: secret_hash, timeout: timeout,
    http_client: http_client, base_urls: base_urls
  )

  api = Internal::ApiRequestor.new(@config, @config.http_client || HTTP::NetHTTPClient.new(@config.timeout))

  @payments = PaymentService.new(api)
  @refunds = RefundService.new(api)
  @banks = BankService.new(api)
  @blik = BlikService.new(api)
  @cards = CardService.new(api)
  @payouts = PayoutService.new(api)
  freeze
end

Instance Attribute Details

#banksBankService (readonly)

Returns the value of attribute banks.

Returns:



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

def banks
  @banks
end

#blikBlikService (readonly)

Returns the value of attribute blik.

Returns:



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

def blik
  @blik
end

#cardsCardService (readonly)

Returns the value of attribute cards.

Returns:



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

def cards
  @cards
end

#configConfig (readonly)

Returns the value of attribute config.

Returns:



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

def config
  @config
end

#paymentsPaymentService (readonly)

Returns the value of attribute payments.

Returns:



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

def payments
  @payments
end

#payoutsPayoutService (readonly)

Returns the value of attribute payouts.

Returns:



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

def payouts
  @payouts
end

#refundsRefundService (readonly)

Returns the value of attribute refunds.

Returns:



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

def refunds
  @refunds
end