Class: Unit::CheckPayment::ReturnCheckPaymentRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/check_payment/return_check_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment_id, return_reason_code) ⇒ ReturnCheckPaymentRequest

Returns a new instance of ReturnCheckPaymentRequest.

Parameters:

  • payment_id (String)
  • return_reason_code (String)


12
13
14
15
# File 'lib/unit/models/check_payment/return_check_payment_request.rb', line 12

def initialize(payment_id, return_reason_code)
  @payment_id = payment_id
  @return_reason_code = return_reason_code
end

Instance Attribute Details

#payment_idObject (readonly)

Returns the value of attribute payment_id.



8
9
10
# File 'lib/unit/models/check_payment/return_check_payment_request.rb', line 8

def payment_id
  @payment_id
end

#return_reason_codeObject (readonly)

Returns the value of attribute return_reason_code.



8
9
10
# File 'lib/unit/models/check_payment/return_check_payment_request.rb', line 8

def return_reason_code
  @return_reason_code
end

Instance Method Details

#to_json_apiObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/unit/models/check_payment/return_check_payment_request.rb', line 17

def to_json_api
  payload = {
    data: {
      type: "checkPaymentReturn",
      attributes: { returnReasonCode: return_reason_code }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end