Module: Unit::Fee

Defined in:
lib/unit/models/fee/fee.rb,
lib/unit/models/fee/create_fee_request.rb,
lib/unit/models/fee/reverse_fee_request.rb

Defined Under Namespace

Classes: CreateFeeRequest, ReverseFeeRequest

Class Method Summary collapse

Class Method Details

.create_fee(account_id:, amount:, description:, tags: nil, idempotency_key: nil) ⇒ Object

Request to create fee

Parameters:

  • account_id (String)
  • amount (Integer)
  • description (String)
  • tags (Hash) (defaults to: nil)
    • optional

  • idempotency_key (String) (defaults to: nil)
    • optional

See Also:



16
17
18
19
# File 'lib/unit/models/fee/fee.rb', line 16

def create_fee(account_id:, amount:, description:, tags: nil, idempotency_key: nil)
  request = CreateFeeRequest.new(, amount, description, tags, idempotency_key)
  Unit::Resource::FeeResource.create_fee(request)
end

.reverse_fee(account_id:, transaction_id:, description:, tags: nil, idempotency_key: nil) ⇒ Object

Request to reverse a fee

Parameters:

  • account_id (String)
  • transaction_id (Integer)
  • description (String)
  • tags (Hash) (defaults to: nil)
    • optional

  • idempotency_key (String) (defaults to: nil)
    • optional

See Also:



28
29
30
31
# File 'lib/unit/models/fee/fee.rb', line 28

def reverse_fee(account_id:, transaction_id:, description:, tags: nil, idempotency_key: nil)
  request = ReverseFeeRequest.new(, transaction_id, description, tags, idempotency_key)
  Unit::Resource::FeeResource.reverse_fee(request)
end