lib/stripe/card.rb in stripe-2.0.3 vs lib/stripe/card.rb in stripe-2.1.0
- old
+ new
@@ -3,14 +3,14 @@
include Stripe::APIOperations::Save
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List
def resource_url
- if respond_to?(:recipient)
+ if respond_to?(:recipient) && !recipient.nil? && !recipient.empty?
"#{Recipient.resource_url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
- elsif respond_to?(:customer)
+ elsif respond_to?(:customer) && !customer.nil? && !customer.empty?
"#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
- elsif respond_to?(:account)
+ elsif respond_to?(:account) && !account.nil? && !account.empty?
"#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
end
end
def self.update(id, params=nil, opts=nil)