Class: EwayRapid::Message::CustomerProcess::CustTransparentRedirectMsgProcess

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

Overview

Create customer with transparent redirect message process

Class Method Summary collapse

Methods included from RestProcess

#do_get, #do_post

Class Method Details

.create_request(input) ⇒ CreateAccessCodeRequest

Parameters:

Returns:



90
91
92
93
94
95
96
97
98
# File 'lib/eway_rapid/message/process/customer_process.rb', line 90

def self.create_request(input)
  request = CreateAccessCodeRequest.new
  convert = Convert::CustomerToInternalCustomer.new(false)
  request.customer = convert.do_convert(input)
  request.method = Constants::CREATE_TOKEN_CUSTOMER_METHOD
  request.transaction_type = Enums::TransactionType::PURCHASE
  request.redirect_url = input.redirect_url
  request
end

.make_result(response) ⇒ CreateCustomerResponse

Parameters:

  • response (String)

Returns:



111
112
113
114
115
# File 'lib/eway_rapid/message/process/customer_process.rb', line 111

def self.make_result(response)
  access_code_response = CreateAccessCodeResponse.from_json(response)
  convert = Convert::Response::AccessCodeToCreateCust.new
  convert.do_convert(access_code_response)
end

.send_request(url, api_key, password, request) ⇒ String

Parameters:

Returns:

  • (String)


105
106
107
# File 'lib/eway_rapid/message/process/customer_process.rb', line 105

def self.send_request(url, api_key, password, request)
  CustTransparentRedirectMsgProcess.new.do_post(url, api_key, password, request)
end