Class: EwayRapid::Message::CustomerProcess::CustTransparentUpdateMsgProcess

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:



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/eway_rapid/message/process/customer_process.rb', line 225

def self.create_request(input)
  request = CreateAccessCodeRequest.new
  converter = Convert::CustomerToInternalCustomer.new
  payment = InternalModels::Payment.new
  payment.total_amount = 0
  request.payment = payment
  request.customer = converter.do_convert(input)
  request.method = Constants::UPDATE_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:



248
249
250
251
252
# File 'lib/eway_rapid/message/process/customer_process.rb', line 248

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

.send_request(url, api_key, password, version, request) ⇒ Object

Parameters:



242
243
244
# File 'lib/eway_rapid/message/process/customer_process.rb', line 242

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