Class: CDEKApiClient::API::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/cdek_api_client/api/payment.rb

Overview

Handles payment and registry-related API requests.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Payment

Initializes the Payment object.



10
11
12
# File 'lib/cdek_api_client/api/payment.rb', line 10

def initialize(client)
  @client = client
end

Instance Method Details

#get_checks(check_data) ⇒ Hash

Gets check information.



27
28
29
30
# File 'lib/cdek_api_client/api/payment.rb', line 27

def get_checks(check_data)
  response = @client.request('get', 'check', query: check_data)
  handle_response(response)
end

#get_payments(date) ⇒ Hash

Gets payment information for a specific date.



18
19
20
21
# File 'lib/cdek_api_client/api/payment.rb', line 18

def get_payments(date)
  response = @client.request('get', 'payment', query: { date: date })
  handle_response(response)
end

#get_registries(date) ⇒ Hash

Gets registry information for a specific date.



36
37
38
39
# File 'lib/cdek_api_client/api/payment.rb', line 36

def get_registries(date)
  response = @client.request('get', 'registries', query: { date: date })
  handle_response(response)
end