Class: EwayRapid::Message::Convert::Response::CancelAuthorisationToRefund
- Inherits:
-
Object
- Object
- EwayRapid::Message::Convert::Response::CancelAuthorisationToRefund
- Defined in:
- lib/eway_rapid/message/convert/response/cancel_authorisation_to_refund.rb
Instance Attribute Summary collapse
-
#refund ⇒ Object
readonly
Returns the value of attribute refund.
Instance Method Summary collapse
- #do_convert(cancel) ⇒ RefundResponse
-
#initialize(refund) ⇒ CancelAuthorisationToRefund
constructor
A new instance of CancelAuthorisationToRefund.
Constructor Details
#initialize(refund) ⇒ CancelAuthorisationToRefund
Returns a new instance of CancelAuthorisationToRefund.
9 10 11 |
# File 'lib/eway_rapid/message/convert/response/cancel_authorisation_to_refund.rb', line 9 def initialize(refund) @refund = refund end |
Instance Attribute Details
#refund ⇒ Object (readonly)
Returns the value of attribute refund.
6 7 8 |
# File 'lib/eway_rapid/message/convert/response/cancel_authorisation_to_refund.rb', line 6 def refund @refund end |
Instance Method Details
#do_convert(cancel) ⇒ RefundResponse
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/eway_rapid/message/convert/response/cancel_authorisation_to_refund.rb', line 15 def do_convert(cancel) response = RefundResponse.new response.refund = @refund status = Models::TransactionStatus.new status.status = cancel.transaction_status detail = Models::ProcessingDetails.new detail.response_code = cancel.errors detail.response_code = cancel.response_code status.processing_details = detail status.transaction_id = Integer(cancel.transaction_id) response.transaction_status = status response.errors = cancel.errors.split(/\s*,\s*/) if cancel.errors response end |