Method: Unit::Fee::CreateFeeRequest#to_json_api

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

#to_json_apiObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/unit/models/fee/create_fee_request.rb', line 23

def to_json_api
  payload = {
    "data": {
      "type": "fee",
      "attributes": {
        "amount": amount,
        "description": description,
        "tags": tags,
        "idempotencyKey": idempotency_key
      },
      "relationships": {
        "account": Unit::Types::Relationship.new("depositAccount", ).to_hash
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end