Class: EwayRapid::Message::RefundProcess::RefundMsgProcess

Inherits:
Object
  • Object
show all
Includes:
EwayRapid::Message::RestProcess
Defined in:
lib/eway_rapid/message/process/refund_process.rb

Overview

Refund message process

Class Method Summary collapse

Methods included from EwayRapid::Message::RestProcess

#do_get, #do_post

Class Method Details

.create_request(refund) ⇒ DirectRefundRequest

Parameters:

Returns:



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

Parameters:

  • response (String)

Returns:



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

Parameters:

Returns:

  • (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