Class: EwayRapid::Message::RefundProcess::RefundMsgProcess
- Inherits:
-
Object
- Object
- EwayRapid::Message::RefundProcess::RefundMsgProcess
- Includes:
- EwayRapid::Message::RestProcess
- Defined in:
- lib/eway_rapid/message/process/refund_process.rb
Overview
Refund message process
Class Method Summary collapse
- .create_request(refund) ⇒ DirectRefundRequest
- .make_result(response) ⇒ RefundResponse
- .send_request(url, api_key, password, request) ⇒ String
Methods included from EwayRapid::Message::RestProcess
Class Method Details
.create_request(refund) ⇒ DirectRefundRequest
11 12 13 14 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 11 def self.create_request(refund) converter = Convert::Request::RefundToDirectRefundReq.new converter.do_convert(refund) end |
.make_result(response) ⇒ RefundResponse
26 27 28 29 30 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 26 def self.make_result(response) response = DirectRefundResponse.from_json(response) converter = Convert::Response::DirectRefundToRefundResponse.new converter.do_convert(response) end |
.send_request(url, api_key, password, request) ⇒ String
18 19 20 21 22 |
# File 'lib/eway_rapid/message/process/refund_process.rb', line 18 def self.send_request(url, api_key, password, request) url = url + '/' + request.refund.original_transaction_id.to_s + '/' + Constants::REFUND_SUB_PATH_METHOD url = URI.encode(url) RefundMsgProcess.new.do_post(url, api_key, password, request) end |