Construct the recipient card URL if the recipient property exists.

This commit is contained in:
Amber Feng 2014-05-21 10:49:38 -07:00
parent ca07ef08fd
commit bc43fff551

View File

@ -5,7 +5,11 @@ module Stripe
include Stripe::APIOperations::List
def url
"#{Customer.url}/#{CGI.escape(customer)}/cards/#{CGI.escape(id)}"
if recipient
"#{Recipient.url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
elsif customer
"#{Customer.url}/#{CGI.escape(customer)}/cards/#{CGI.escape(id)}"
end
end
def self.retrieve(id, api_key=nil)