class EwayRapid::Message::RefundProcess::CancelAuthorisationMsgProcess

cancel authorisation message process

Public Class Methods

create_request(refund) click to toggle source

@param [Models::Refund] refund @return [CancelAuthorisationRequest]

# 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() click to toggle source

@return [Models::Refund]

# File lib/eway_rapid/message/process/refund_process.rb, line 70
def self.get_refund
  @refund
end
make_result(response) click to toggle source

@param [String] response @return [RefundResponse]

# 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, version, request) click to toggle source
# File lib/eway_rapid/message/process/refund_process.rb, line 52
def self.send_request(url, api_key, password, version, request)
  CancelAuthorisationMsgProcess.new.do_post(url, api_key, password, version, request)
end
set_refund(refund) click to toggle source

@param [Models::Refund] refund

# File lib/eway_rapid/message/process/refund_process.rb, line 65
def self.set_refund(refund)
  @refund = refund
end