Class: EwayRapid::Message::RefundProcess::CancelAuthorisationMsgProcess
- Inherits:
-
Object
- Object
- EwayRapid::Message::RefundProcess::CancelAuthorisationMsgProcess
- Includes:
- EwayRapid::Message::RestProcess
- Defined in:
- lib/eway_rapid/message/process/refund_process.rb
Overview
cancel authorisation message process
Class Method Summary collapse
- .create_request(refund) ⇒ CancelAuthorisationRequest
- .get_refund ⇒ Models::Refund
- .make_result(response) ⇒ RefundResponse
- .send_request(url, api_key, password, request) ⇒ Object
- .set_refund(refund) ⇒ Object
Methods included from EwayRapid::Message::RestProcess
Class Method Details
.create_request(refund) ⇒ CancelAuthorisationRequest
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 39 def self.create_request(refund) set_refund(refund) request = CancelAuthorisationRequest.new # @type [InternalModels::RefundDetails] refund_detail = refund.refund_details unless refund_detail fail 'Refund detail has been null' end request.transaction_id = refund_detail.original_transaction_id request end |
.get_refund ⇒ Models::Refund
70 71 72 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 70 def self.get_refund @refund end |
.make_result(response) ⇒ RefundResponse
58 59 60 61 62 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 58 def self.make_result(response) cancel_response = CancelAuthorisationResponse.from_json(response) converter = Convert::Response::CancelAuthorisationToRefund.new(get_refund) converter.do_convert(cancel_response) end |
.send_request(url, api_key, password, request) ⇒ Object
52 53 54 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 52 def self.send_request(url, api_key, password, request) CancelAuthorisationMsgProcess.new.do_post(url, api_key, password, request) end |
.set_refund(refund) ⇒ Object
65 66 67 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 65 def self.set_refund(refund) @refund = refund end |