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?
metadata = metadata(params[:metadata])
result_hash[:metadata] = metadata if metadata
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
|