Class: ActiveMerchant::Fulfillment::Service
- Inherits:
-
Object
- Object
- ActiveMerchant::Fulfillment::Service
show all
- Includes:
- PostsData, RequiresParameters
- Defined in:
- lib/active_fulfillment/fulfillment/service.rb
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Service
Returns a new instance of Service.
10
11
12
13
14
15
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 10
def initialize(options = {})
check_test_mode(options)
@options = {}
@options.update(options)
end
|
Instance Method Details
#fetch_stock_levels(options = {}) ⇒ Object
34
35
36
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 34
def fetch_stock_levels(options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#fetch_tracking_data(order_ids, options = {}) ⇒ Object
45
46
47
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 45
def fetch_tracking_data(order_ids, options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#fetch_tracking_numbers(order_ids, options = {}) ⇒ Object
38
39
40
41
42
43
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 38
def fetch_tracking_numbers(order_ids, options = {})
response = fetch_tracking_data(order_ids, options)
response.params.delete('tracking_companies')
response.params.delete('tracking_urls')
response
end
|
#fulfill(order_id, shipping_address, line_items, options = {}) ⇒ Object
API Requirements for Implementors
30
31
32
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 30
def fulfill(order_id, shipping_address, line_items, options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#test? ⇒ Boolean
21
22
23
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 21
def test?
@options[:test] || Base.mode == :test
end
|
#test_mode? ⇒ Boolean
17
18
19
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 17
def test_mode?
false
end
|
#valid_credentials? ⇒ Boolean
25
26
27
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 25
def valid_credentials?
true
end
|