Class: Yoomoney::Resources::PersonalData

Inherits:
Object
  • Object
show all
Defined in:
lib/yoomoney/resources/personal_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PersonalData

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PersonalData.

Parameters:



53
54
55
# File 'lib/yoomoney/resources/personal_data.rb', line 53

def initialize(client:)
  @client = client
end

Instance Method Details

#create(body:, idempotence_key:, request_options: {}) ⇒ Yoomoney::Models::PersonalDataAPI

Создание персональных данных



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/yoomoney/resources/personal_data.rb', line 19

def create(params)
  parsed, options = Yoomoney::PersonalDataCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "personal_data",
    headers: parsed.except(:body).transform_keys(idempotence_key: "idempotence-key"),
    body: parsed[:body],
    model: Yoomoney::PersonalDataAPI,
    options: options
  )
end

#retrieve(personal_data_id, request_options: {}) ⇒ Yoomoney::Models::PersonalDataAPI

Информация о персональных данных

Parameters:

Returns:

See Also:



41
42
43
44
45
46
47
48
# File 'lib/yoomoney/resources/personal_data.rb', line 41

def retrieve(personal_data_id, params = {})
  @client.request(
    method: :get,
    path: ["personal_data/%1$s", personal_data_id],
    model: Yoomoney::PersonalDataAPI,
    options: params[:request_options]
  )
end