Class: TaxCloud::AuthorizedService

Inherits:
BaseService show all
Defined in:
lib/service/authorized_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from TaxCloud::BaseService

Instance Method Details

#authorized(api_id, api_key, customer_id, cart_id, order_id, date_authorized) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/service/authorized_service.rb', line 19

def authorized(api_id, api_key, customer_id, cart_id, order_id, date_authorized)
  response = client.request :authorized do
    soap.body = {:apiLoginID => api_id, :apiKey => api_key,
                 'customerID' => customer_id, 'cartID' => cart_id, 'orderID' => order_id, 'dateAuthorized' => date_authorized}

  end

  authorized_response = TaxCloud::AuthorizedResponse.new(response.to_hash[:authorized_response][:authorized_result])

end

#authorized_with_capture(api_id, api_key, customer_id, cart_id, order_id, date_authorized, date_captured) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/service/authorized_service.rb', line 9

def authorized_with_capture(api_id, api_key, customer_id, cart_id, order_id, date_authorized, date_captured)
  response = client.request :authorized_with_capture do
    soap.body = {:apiLoginID => api_id, :apiKey => api_key,
                 'customerID' => customer_id, 'cartID' => cart_id, 'orderID' => order_id, 'dateAuthorized' => date_authorized, 'dateCaptured' => date_captured}

  end

  authorized_with_capture_rsp = TaxCloud::AuthorizedWithCaptureResponse.new(response.to_hash[:authorized_with_capture_response][:authorized_with_capture_result])
end

#captured(api_id, api_key, order_id) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/service/authorized_service.rb', line 30

def captured(api_id, api_key, order_id)
  response = client.request :captured do
    soap.body = {:apiLoginID => api_id, :apiKey => api_key, 'orderID' => order_id}
  end

  captured_response = TaxCloud::CapturedResponse.new(response.to_hash[:captured_response][:captured_result])
end