Class: EwayRapid::Message::CustomerProcess::CustResponsiveUpdateMsgProcess

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

Overview

Create customer with responsive shared method message process

Class Method Summary collapse

Methods included from RestProcess

#do_get, #do_post

Class Method Details

.create_request(input) ⇒ CreateAccessCodeSharedRequest

Parameters:

Returns:



187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/eway_rapid/message/process/customer_process.rb', line 187

def self.create_request(input)
  request = CreateAccessCodeSharedRequest.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.cancel_url = input.cancel_url
  request
end

.make_result(response) ⇒ CreateCustomerResponse

Parameters:

  • response (String)

Returns:



211
212
213
214
215
# File 'lib/eway_rapid/message/process/customer_process.rb', line 211

def self.make_result(response)
  shared_response = CreateAccessCodeSharedResponse.from_json(response)
  converter = Convert::Response::AccessCodeSharedToCreateCust.new
  converter.do_convert(shared_response)
end

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

Parameters:



205
206
207
# File 'lib/eway_rapid/message/process/customer_process.rb', line 205

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