Class: Unit::Authorization::ListRequest
- Inherits:
-
Object
- Object
- Unit::Authorization::ListRequest
- Defined in:
- lib/unit/models/authorization/list_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#from_amount ⇒ Object
readonly
Returns the value of attribute from_amount.
-
#include_non_authorized ⇒ Object
readonly
Returns the value of attribute include_non_authorized.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#merchant_category_code ⇒ Object
readonly
Returns the value of attribute merchant_category_code.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#to_amount ⇒ Object
readonly
Returns the value of attribute to_amount.
-
#until_ ⇒ Object
readonly
Returns the value of attribute until_.
Instance Method Summary collapse
-
#initialize(limit = AUTHORIZATION_LIMIT, offset = AUTHORIZATION_OFFSET, account_id = nil, customer_id = nil, card_id = nil, since = nil, until_ = nil, include_non_authorized = nil, status = nil, merchant_category_code = nil, from_amount = nil, to_amount = nil, sort = nil) ⇒ ListRequest
constructor
A new instance of ListRequest.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = AUTHORIZATION_LIMIT, offset = AUTHORIZATION_OFFSET, account_id = nil, customer_id = nil, card_id = nil, since = nil, until_ = nil, include_non_authorized = nil, status = nil, merchant_category_code = nil, from_amount = nil, to_amount = nil, sort = nil) ⇒ ListRequest
Returns a new instance of ListRequest.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/unit/models/authorization/list_request.rb', line 25 def initialize(limit = AUTHORIZATION_LIMIT, offset = AUTHORIZATION_OFFSET, account_id = nil, customer_id = nil, card_id = nil, since = nil, until_ = nil, = nil, status = nil, merchant_category_code = nil, from_amount = nil, to_amount = nil, sort = nil) @limit = limit @offset = offset @account_id = account_id @customer_id = customer_id @card_id = card_id @since = since @until_ = until_ @include_non_authorized = @status = status @merchant_category_code = merchant_category_code @from_amount = from_amount @to_amount = to_amount @sort = sort end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def account_id @account_id end |
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def card_id @card_id end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def customer_id @customer_id end |
#from_amount ⇒ Object (readonly)
Returns the value of attribute from_amount.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def from_amount @from_amount end |
#include_non_authorized ⇒ Object (readonly)
Returns the value of attribute include_non_authorized.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def @include_non_authorized end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def limit @limit end |
#merchant_category_code ⇒ Object (readonly)
Returns the value of attribute merchant_category_code.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def merchant_category_code @merchant_category_code end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def offset @offset end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def since @since end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def sort @sort end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def status @status end |
#to_amount ⇒ Object (readonly)
Returns the value of attribute to_amount.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def to_amount @to_amount end |
#until_ ⇒ Object (readonly)
Returns the value of attribute until_.
8 9 10 |
# File 'lib/unit/models/authorization/list_request.rb', line 8 def until_ @until_ end |
Instance Method Details
#to_hash ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/unit/models/authorization/list_request.rb', line 43 def to_hash payload = { "page[limit]": limit, "page[offset]": offset, "filter[accountId]": account_id, "filter[customerId]": customer_id, "filter[cardId]": card_id, "filter[since]": since, "filter[until]": until_, "filter[includeNonAuthorized]": , "filter[fromAmount]": from_amount, "filter[toAmount]": to_amount, sort: sort } merchant_category_code&.each_with_index&.map do |val, index| params.merge!({ "filter[merchantCategoryCode][#{index}]": val }) end status&.each_with_index&.map do |val, index| params.merge!({ "filter[status][#{index}]": val }) end payload.compact end |