Sha256: 7b76d54154ddb176d74a8972d7b0105c057a336f941bda7eb8e05e2cf454a6c2
Contents?: true
Size: 1.33 KB
Versions: 14
Compression:
Stored size: 1.33 KB
Contents
module Registration def register_user(session_key, address, first_name, last_name, email, password, promotion, special_offer, phone, options={}) parameters = { 'FirstName': first_name, 'LastName': last_name, 'ElectronicAddress': { 'Address': email, 'AllowMarketing': special_offer || 0, }, 'WebLogin': { 'Login': email, 'LoginTypeId': 1, 'Password': password }, 'Address': { 'AddressTypeId': 3, 'City': address.city, 'PostalCode': address.postal_code, 'StateId': address.state, 'Street1': address.street1, 'Street2': address.street2, 'CountryId': address.country }, 'ConstituentTypeId': 1, 'OriginalSourceId': 3, 'SourceId': promotion, 'Phones': [ { 'PhoneNumber': phone, 'PhoneTypeId': 1 }, ], } options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'}) self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options) end end
Version data entries
14 entries across 14 versions & 1 rubygems