Class: Unit::Transaction::PatchChargebackTransactionRequest
- Inherits:
-
Object
- Object
- Unit::Transaction::PatchChargebackTransactionRequest
- Defined in:
- lib/unit/models/transaction/patch_chargeback_transaction_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
-
#initialize(account_id, transaction_id, summary = nil, tags = nil) ⇒ PatchChargebackTransactionRequest
constructor
A new instance of PatchChargebackTransactionRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, transaction_id, summary = nil, tags = nil) ⇒ PatchChargebackTransactionRequest
Returns a new instance of PatchChargebackTransactionRequest.
14 15 16 17 18 19 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 14 def initialize(account_id, transaction_id, summary = nil, = nil) @account_id = account_id @summary = summary @tags = @transaction_id = transaction_id end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 8 def account_id @account_id end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
8 9 10 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 8 def summary @summary end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 8 def @tags end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
8 9 10 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 8 def transaction_id @transaction_id end |
Instance Method Details
#to_json_api ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/unit/models/transaction/patch_chargeback_transaction_request.rb', line 21 def to_json_api payload = { data: { type: "chargebackTransaction", attributes: { summary: summary, tags: }, relationships: { account: Unit::Types::Relationship.new("account", account_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |