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.
8
9
10
11
12
13
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 8
def initialize(options = {})
check_test_mode(options)
@options = {}
@options.update(options)
end
|
Instance Method Details
#fetch_stock_levels(options = {}) ⇒ Object
28
29
30
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 28
def fetch_stock_levels(options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#fetch_tracking_data(order_ids, options = {}) ⇒ Object
43
44
45
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 43
def fetch_tracking_data(order_ids, options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#fetch_tracking_numbers(order_ids, options = {}) ⇒ Object
36
37
38
39
40
41
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 36
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
24
25
26
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 24
def fulfill(order_id, shipping_address, line_items, options = {})
raise NotImplementedError.new("Subclasses must implement")
end
|
#test? ⇒ Boolean
19
20
21
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 19
def test?
@options[:test] || Base.mode == :test
end
|
#test_mode? ⇒ Boolean
15
16
17
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 15
def test_mode?
false
end
|
#valid_credentials? ⇒ Boolean
47
48
49
|
# File 'lib/active_fulfillment/fulfillment/service.rb', line 47
def valid_credentials?
raise NotImplementedError.new("Subclasses must implement")
end
|