class EwayRapid::Message::CustomerProcess::CustDirectUpdateMsgProcess

Create customer with direct payment method message process

Public Class Methods

create_request(input) click to toggle source

@param [Models::Customer] input @return [DirectPaymentRequest]

# File lib/eway_rapid/message/process/customer_process.rb, line 152
def self.create_request(input)
  request = DirectPaymentRequest.new
  converter = Convert::CustomerToInternalCustomer.new
  payment = InternalModels::Payment.new
  payment.total_amount = 0
  request.payment = payment
  request.customer = converter.do_convert(input)
  request.customer_ip = input.customer_device_ip
  request.method = Constants::UPDATE_TOKEN_CUSTOMER_METHOD
  request.transaction_type = Enums::TransactionType::MOTO
  request
end
make_result(response) click to toggle source

@param [String] response @return [CreateCustomerResponse]

# File lib/eway_rapid/message/process/customer_process.rb, line 175
def self.make_result(response)
  direct_response = DirectPaymentResponse.from_json(response)
  converter = Convert::Response::DirectPaymentToCreateCust.new
  converter.do_convert(direct_response)
end
send_request(url, api_key, password, version, request) click to toggle source

@param [String] url @param [String] api_key @param [String] password @param [DirectPaymentRequest] request

# File lib/eway_rapid/message/process/customer_process.rb, line 169
def self.send_request(url, api_key, password, version, request)
  CustDirectUpdateMsgProcess.new.do_post(url, api_key, password, version, request)
end