Class: YourMembership::Sa::Members
- Defined in:
- lib/your_membership/sa_members.rb
Overview
YourMembership System Administrator Members Namespace
Class Method Summary collapse
-
.all_getIDs(options = {}) ⇒ Array
Returns a list of member IDs that may be optionally filtered by timestamp, and/or group membership.
-
.all_recentActivity ⇒ Hash
Returns a Hash of recent member activity on your YourMembership Site Returns member community activity information for the purpose of creating a navigation control.
-
.certifications_journalEntry_create(member_id, ceus_earned, ceus_expire_date, description, entry_date, options = {}) ⇒ Boolean
Create a CEU Journal Entry.
-
.commerce_store_getOrderIDs(member_id, options = {}) ⇒ Array
Returns a list of order IDs for a specified member that may be optionally filtered by timestamp and status.
-
.events_event_registration_get(event_id, member_id) ⇒ Array
Returns Event Registration details for the provided Event and Member ID.
-
.profile_create(profile) ⇒ YourMembership::Member
Creates a new member profile and returns a member object.
-
.referrals_get(member_id, options = {}) ⇒ Array
Returns a list of a member’s referrals.
-
.subAccounts_get(member_id, options = {}) ⇒ Array
Returns a list of a member’s sub-accounts.
Methods inherited from Base
build_XML_request, new_call_id, post, response_to_array, response_to_array_of_hashes, response_valid?, response_ym_error?
Class Method Details
.all_getIDs(options = {}) ⇒ Array
Returns a list of member IDs that may be optionally filtered by timestamp, and/or group membership. This method is provided for data synchronization purposes and will return a maximum of 10,000 results. It would typically be used in conjunction with subsequent calls to Sa.People.Profile.Get for each <ID> returned.
18 19 20 21 22 23 |
# File 'lib/your_membership/sa_members.rb', line 18 def self.all_getIDs( = {}) # rubocop:disable Style/MethodName response = post('/', :body => build_XML_request('Sa.Members.All.GetIDs', nil, )) response_valid? response members_hash = response['YourMembership_Response']['Sa.Members.All.GetIDs']['Members'] members_hash ? members_hash.fetch('ID') : [] end |
.all_recentActivity ⇒ Hash
Returns a Hash of recent member activity on your YourMembership Site Returns member community activity information for the purpose of creating a navigation control.
36 37 38 39 40 |
# File 'lib/your_membership/sa_members.rb', line 36 def self.all_recentActivity # rubocop:disable Style/MethodName response = post('/', :body => build_XML_request('Sa.Members.All.RecentActivity')) response_valid? response response['YourMembership_Response']['Sa.Members.All.RecentActivity'].to_h end |
.certifications_journalEntry_create(member_id, ceus_earned, ceus_expire_date, description, entry_date, options = {}) ⇒ Boolean
Create a CEU Journal Entry.
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/your_membership/sa_members.rb', line 147 def self.certifications_journalEntry_create(member_id, ceus_earned, ceus_expire_date, description, entry_date, = {}) # rubocop:disable Style/MethodName ['ID'] = member_id ['CEUsEarned'] = ceus_earned ['CEUsExpireDate'] = ceus_expire_date ['Description'] = description ['EntryDate'] = entry_date response = post('/', :body => build_XML_request('Sa.Members.Certifications.JournalEntry.Create', nil, )) response_valid? response end |
.commerce_store_getOrderIDs(member_id, options = {}) ⇒ Array
Returns a list of order IDs for a specified member that may be optionally filtered by timestamp and status. This method will return a maximum of 1,000 results.
55 56 57 58 59 60 61 62 63 |
# File 'lib/your_membership/sa_members.rb', line 55 def self.commerce_store_getOrderIDs(member_id, = {}) # rubocop:disable Style/MethodName [:ID] = member_id if [:Status] [:Status] = YourMembership::Commerce.convert_order_status([:Status]) end response = post('/', :body => build_XML_request('Sa.Members.Commerce.Store.GetOrderIDs', nil, )) response_valid? response response_to_array response['YourMembership_Response']['Sa.Members.Commerce.Store.GetOrderIDs']['Orders'], ['Order'], 'InvoiceID' end |
.events_event_registration_get(event_id, member_id) ⇒ Array
Returns Event Registration details for the provided Event and Member ID. Includes all Event Registration details for Primary Registrant and Additional Registrants. If the Event Registration contains a related Custom Form, the form data will be included in the <DataSet> element as it is stored in our database.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/your_membership/sa_members.rb', line 75 def self.events_event_registration_get(event_id, member_id) # rubocop:disable Style/MethodName = {} [:EventID] = event_id [:ID] = member_id response = post('/', :body => build_XML_request('Sa.Members.Events.Event.Registration.Get', nil, )) response_valid? response response_to_array_of_hashes response['YourMembership_Response']['Sa.Members.Events.Event.Registration.Get'], ['Registrations', 'Registration'] end |
.profile_create(profile) ⇒ YourMembership::Member
Creates a new member profile and returns a member object.
@todo: This currently returns an authenticated session for each created user. This may not be the desired
permanent operation of this function.
167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/your_membership/sa_members.rb', line 167 def self.profile_create(profile) = {} ['profile'] = profile response = post('/', :body => build_XML_request('Sa.Members.Profile.Create', nil, )) response_valid? response YourMembership::Sa::Auth.authenticate( YourMembership::Session.create, profile.data['Username'], profile.data['Password'], profile.data['PasswordHash'] ) end |
.referrals_get(member_id, options = {}) ⇒ Array
Returns a list of a member’s referrals.
96 97 98 99 100 101 102 103 |
# File 'lib/your_membership/sa_members.rb', line 96 def self.referrals_get(member_id, = {}) [:ID] = member_id response = post('/', :body => build_XML_request('Sa.Members.Referrals.Get', nil, )) response_valid? response response_to_array_of_hashes response['YourMembership_Response']['Sa.Members.Referrals.Get'], ['Member'] end |
.subAccounts_get(member_id, options = {}) ⇒ Array
Returns a list of a member’s sub-accounts.
115 116 117 118 119 120 121 122 |
# File 'lib/your_membership/sa_members.rb', line 115 def self.subAccounts_get(member_id, = {}) # rubocop:disable Style/MethodName [:ID] = member_id response = post('/', :body => build_XML_request('Sa.Members.SubAccounts.Get', nil, )) response_valid? response response_to_array_of_hashes response['YourMembership_Response']['Sa.Members.SubAccounts.Get'], ['Member'] end |