class MangoPay::Mandate

See docs.mangopay.com/api-references/mandates/

Public Class Methods

cancel(id) click to toggle source
# File lib/mangopay/mandate.rb, line 15
def cancel(id)
  url = "#{MangoPay.api_path}/mandates/#{id}/cancel"
  MangoPay.request(:put, url)
end
create(params, idempotency_key = nil) click to toggle source

params: hash; see docs.mangopay.com/api-references/mandates/

# File lib/mangopay/mandate.rb, line 10
def create(params, idempotency_key = nil)
  url = "#{MangoPay.api_path}/mandates/directdebit/web"
  MangoPay.request(:post, url, params, {}, idempotency_key)
end
fetch_for_user(user_id, filters = {}) click to toggle source
# File lib/mangopay/mandate.rb, line 20
def fetch_for_user(user_id, filters = {})
  url = "#{MangoPay.api_path}/users/#{user_id}/mandates"
  MangoPay.request(:get, url, {}, filters)
end
fetch_for_user_bank_account(user_id, bank_account_id, filters = {}) click to toggle source
# File lib/mangopay/mandate.rb, line 25
def fetch_for_user_bank_account(user_id, bank_account_id, filters = {})
  url = "#{MangoPay.api_path}/users/#{user_id}/bankaccounts/#{bank_account_id}/mandates"
  MangoPay.request(:get, url, {}, filters)
end
transactions(mandate_id, filters = {}) click to toggle source

Fetches list of transactions belonging to given mandate_id.

Optional filters is a hash accepting following keys:

# File lib/mangopay/mandate.rb, line 36
def transactions(mandate_id, filters = {})
  url = url(mandate_id) + '/transactions'
  MangoPay.request(:get, url, {}, filters)
end