mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-09 00:01:53 -05:00
Fix cards
This commit is contained in:
parent
89f207f993
commit
58a965523a
@ -5,11 +5,11 @@ module Stripe
|
||||
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
|
||||
|
||||
@ -2,7 +2,7 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
module Stripe
|
||||
class CustomerCardTest < Test::Unit::TestCase
|
||||
FIXTURE = API_FIXTURES.fetch(:source)
|
||||
FIXTURE = API_FIXTURES.fetch(:card)
|
||||
|
||||
setup do
|
||||
@customer =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user