class MangoPay::Client
Public Class Methods
# File lib/mangopay/client.rb, line 80 def create_bank_account(params) MangoPay.request(:post, url() + "/bankaccounts/iban", params) end
# File lib/mangopay/client.rb, line 84 def create_payout(params) method = :post path = url() + "/payouts" yield method, path, params if block_given? MangoPay.request(method, path, params) end
see docs.mangopay.com/api-references/client-details/
# File lib/mangopay/client.rb, line 9 def fetch() MangoPay.request(:get, url()) end
Fetch one of your client wallets (fees or credit) with a particular currency; funds_type
may be:
- nil: all wallets - 'fees': fees wallets - 'credit': credit wallets
currency_iso_code
is currncy ISO code see docs.mangopay.com/api-references/client-wallets/
# File lib/mangopay/client.rb, line 49 def fetch_wallet(funds_type, currency_iso_code) method = :get path = url() + "/wallets/#{funds_type}/#{currency_iso_code}" yield method, path if block_given? MangoPay.request(method, path) end
Fetch transactions for one of your client wallets (fees or credit) with a particular currency; funds_type
may be:
- nil: all wallets - 'fees': fees wallets - 'credit': credit wallets
currency_iso_code
is currncy ISO code Optional filters
hash: see MangoPay::Transaction.fetch
See docs.mangopay.com/api-references/client-wallets/
# File lib/mangopay/client.rb, line 71 def fetch_wallet_transactions(funds_type, currency_iso_code, filters = {}) MangoPay.request(:get, url() + "/wallets/#{funds_type}/#{currency_iso_code}/transactions", {}, filters) end
Fetch all your client wallets; funds_type
may be:
- nil: all wallets - 'fees': fees wallets - 'credit': credit wallets
see docs.mangopay.com/api-references/client-wallets/
# File lib/mangopay/client.rb, line 38 def fetch_wallets(funds_type = nil) MangoPay.request(:get, url() + "/wallets/#{funds_type}") end
Fetch transactions for all your client wallets. Optional filters
hash: see MangoPay::Transaction.fetch
See docs.mangopay.com/api-references/client-wallets/
# File lib/mangopay/client.rb, line 59 def fetch_wallets_transactions(filters = {}) MangoPay.request(:get, url() + "/transactions", {}, filters) end
see docs.mangopay.com/api-references/client-details/
# File lib/mangopay/client.rb, line 14 def update(params) MangoPay.request(:put, url(), params) end
see docs.mangopay.com/api-references/client-details/
# File lib/mangopay/client.rb, line 19 def upload_logo(file_content_base64, file_path = nil) if file_content_base64.nil? && !file_path.nil? bts = File.open(file_path, 'rb') { |f| f.read } file_content_base64 = Base64.encode64(bts) end # normally it returns 204 HTTP code on success begin MangoPay.request(:put, url() + '/logo', {'File' => file_content_base64}) rescue ResponseError => ex raise ex unless ex.code == '204' end end
# File lib/mangopay/client.rb, line 75 def validate(client_id, card_id) url = "#{MangoPay.api_path}/cards/#{card_id}/validate" MangoPay.request(:post, url) end