Class: Gemgento::API::SOAP::Sales::RecurringProfile
- Inherits:
-
Object
- Object
- Gemgento::API::SOAP::Sales::RecurringProfile
- Defined in:
- lib/gemgento/api/soap/sales/recurring_profile.rb
Class Method Summary collapse
-
.fetch_all ⇒ Boolean
Fetch and sync all recurring profiles from Magento.
-
.list ⇒ Array(Hash), Boolean
Get a list of all recurring profiles from Magento.
-
.update_state(profile_id, state) ⇒ Boolean
Update a recurring profile state in Magento.
Class Method Details
.fetch_all ⇒ Boolean
Fetch and sync all recurring profiles from Magento.
10 11 12 13 14 15 16 17 |
# File 'lib/gemgento/api/soap/sales/recurring_profile.rb', line 10 def self.fetch_all if magento_profiles = list magento_profiles.each{ |source| sync_magento_to_local(source) } return true else return false end end |
.list ⇒ Array(Hash), Boolean
Get a list of all recurring profiles from Magento.
22 23 24 25 26 27 28 29 30 |
# File 'lib/gemgento/api/soap/sales/recurring_profile.rb', line 22 def self.list response = MagentoApi.create_call(:sales_recurring_profile_list) if response.success? return response.body[:result][:item].is_a?(Array) ? response.body[:result][:item] : [response.body[:result][:item]] else return false end end |
.update_state(profile_id, state) ⇒ Boolean
Update a recurring profile state in Magento.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/gemgento/api/soap/sales/recurring_profile.rb', line 37 def self.update_state(profile_id, state) = { profile_id: profile_id, state: state } response = MagentoApi.create_call(:sales_recurring_profile_update_state, ) if response.success? return true else return response.body[:faultstring] end end |