Check for nil customer value when determining bitcoin receiver URL

Stripe API responses include `customer: nil`, which causes `refresh`
to throw an exception
This commit is contained in:
Michael Bianco 2016-01-06 21:45:29 -05:00
parent 121a8bfee4
commit c259547dd7

View File

@ -10,7 +10,7 @@ module Stripe
end
def url
if respond_to?(:customer)
if respond_to?(:customer) && !self.customer.nil?
"#{Customer.url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
else
"#{self.class.url}/#{CGI.escape(id)}"