Sha256: 2768aaefc2c8e506e4fec9ca773294e1e5f08fd163f42a488873558b53f1a7a1
Contents?: true
Size: 1.29 KB
Versions: 18
Compression:
Stored size: 1.29 KB
Contents
module Registration def register_user(session_key, address, first_name, last_name, email, password, 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, '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
18 entries across 18 versions & 1 rubygems