lib/braintree/customer.rb in braintree-1.1.2 vs lib/braintree/customer.rb in braintree-1.1.3
- old
+ new
@@ -77,10 +77,10 @@
Http.delete("/customers/#{customer_id}")
SuccessfulResult.new
end
def self.find(customer_id)
- raise ArgumentError, "customer_id should be a string" unless customer_id.is_a?(String)
+ raise ArgumentError, "customer_id contains invalid characters" unless customer_id.to_s =~ /\A[\w-]+\z/
raise ArgumentError, "customer_id cannot be blank" if customer_id.to_s == ""
response = Http.get("/customers/#{customer_id}")
new(response[:customer])
rescue NotFoundError
raise NotFoundError, "customer with id #{customer_id.inspect} not found"