Class: Lago::Api::Resources::Customers::Wallets::WhitelistParams

Inherits:
Object
  • Object
show all
Defined in:
lib/lago/api/resources/customers/wallets/whitelist_params.rb

Instance Method Summary collapse

Instance Method Details

#metadata(params) ⇒ Object



46
47
48
49
50
# File 'lib/lago/api/resources/customers/wallets/whitelist_params.rb', line 46

def (params)
  return unless params

  params.to_h.transform_keys(&:to_s).transform_values(&:to_s)
end

#wallet(params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/lago/api/resources/customers/wallets/whitelist_params.rb', line 9

def wallet(params)
  result_hash = params.compact.slice(
    :external_customer_id,
    :rate_amount,
    :name,
    :code,
    :priority,
    :paid_credits,
    :granted_credits,
    :currency,
    :expiration_at,
    :transaction_metadata,
    :invoice_requires_successful_payment,
    :ignore_paid_top_up_limits_on_creation,
    :transaction_name,
    :paid_top_up_min_amount_cents,
    :paid_top_up_max_amount_cents,
  )

  recurring_rules = recurring_rules_params(params[:recurring_transaction_rules])
  result_hash[:recurring_transaction_rules] = recurring_rules if recurring_rules.any?

  applies_to = applies_to_params(params[:applies_to])
  result_hash[:applies_to] = applies_to if applies_to.any?

   = (params[:metadata])
  result_hash[:metadata] =  if 

  payment_method = payment_method_params(params[:payment_method])
  result_hash[:payment_method] = payment_method if payment_method.any?

  invoice_custom_section = invoice_custom_section_params(params[:invoice_custom_section])
  result_hash[:invoice_custom_section] = invoice_custom_section if invoice_custom_section

  { 'wallet' => result_hash }
end