lib/mangopay/kyc_document.rb in mangopay-3.0.20 vs lib/mangopay/kyc_document.rb in mangopay-3.0.21

- old
+ new

@@ -13,10 +13,11 @@ MangoPay.request(:put, url(user_id, document_id), params) end # Fetches the KYC document belonging to the given +user_id+, with the given +document_id+. def fetch(user_id, document_id) - MangoPay.request(:get, url(user_id, document_id)) + url = (user_id) ? url(user_id, document_id) : "#{MangoPay.api_path}/KYC/documents/#{CGI.escape(document_id.to_s)}" + MangoPay.request(:get, url) end # Fetches list of KYC documents: # - for the particular user if +user_id+ is provided (not nil) # - or for all users otherwise.