Class: EwayRapid::Message::CustomerProcess::CustDirectUpdateMsgProcess
- Inherits:
-
Object
- Object
- EwayRapid::Message::CustomerProcess::CustDirectUpdateMsgProcess
- Includes:
- RestProcess
- Defined in:
- lib/eway_rapid/message/process/customer_process.rb
Overview
Create customer with direct payment method message process
Class Method Summary collapse
- .create_request(input) ⇒ DirectPaymentRequest
- .make_result(response) ⇒ CreateCustomerResponse
- .send_request(url, api_key, password, request) ⇒ Object
Methods included from RestProcess
Class Method Details
.create_request(input) ⇒ DirectPaymentRequest
151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/eway_rapid/message/process/customer_process.rb', line 151 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) ⇒ CreateCustomerResponse
174 175 176 177 178 |
# File 'lib/eway_rapid/message/process/customer_process.rb', line 174 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, request) ⇒ Object
168 169 170 |
# File 'lib/eway_rapid/message/process/customer_process.rb', line 168 def self.send_request(url, api_key, password, request) CustDirectUpdateMsgProcess.new.do_post(url, api_key, password, request) end |