lib/easypost/address.rb in easypost-3.1.3 vs lib/easypost/address.rb in easypost-3.1.4
- old
+ new
@@ -3,23 +3,25 @@
attr_accessor :message # Backwards compatibility
def self.create(params={}, api_key=nil)
url = self.url
+ address = params.reject { |k,_| k == :verify || k == :verify_strict }
+
if params[:verify] || params[:verify_strict]
- verify = params.delete(:verify) || []
- verify_strict = params.delete(:verify_strict) || []
+ verify = params[:verify] || []
+ verify_strict = params[:verify_strict] || []
url += "?"
verify.each do |verification|
url += "verify[]=#{verification}&"
end
verify_strict.each do |verification|
url += "verify_strict[]=#{verification}&"
end
end
- response = EasyPost.make_request(:post, url, api_key, {address: params})
+ response = EasyPost.make_request(:post, url, api_key, {address: address})
return Util.convert_to_easypost_object(response, api_key)
end
def self.create_and_verify(params={}, carrier=nil, api_key=nil)
wrapped_params = {}