Class: MangoPay::Conversion

Inherits:
Resource show all
Includes:
HTTPCalls::Fetch, HTTPCalls::Update
Defined in:
lib/mangopay/conversion.rb

Class Method Summary collapse

Methods included from HTTPCalls::Update

included

Methods included from HTTPCalls::Fetch

included, parse_id_or_filters

Methods inherited from Resource

class_name, url

Class Method Details

.create_instant_conversion(params) ⇒ Object



13
14
15
16
# File 'lib/mangopay/conversion.rb', line 13

def create_instant_conversion(params)
  url = "#{MangoPay.api_path}/conversions/instant-conversion"
  MangoPay.request(:post, url, params)
end

.create_quote(params) ⇒ Object



28
29
30
31
# File 'lib/mangopay/conversion.rb', line 28

def create_quote(params)
  url = "#{MangoPay.api_path}/conversions/quote"
  MangoPay.request(:post, url, params)
end

.create_quoted_conversion(params) ⇒ Object



18
19
20
21
# File 'lib/mangopay/conversion.rb', line 18

def create_quoted_conversion(params)
  url = "#{MangoPay.api_path}/conversions/quoted-conversion"
  MangoPay.request(:post, url, params)
end

.get(id, params) ⇒ Object



23
24
25
26
# File 'lib/mangopay/conversion.rb', line 23

def get(id, params)
  url = "#{MangoPay.api_path}/conversions/#{id}"
  MangoPay.request(:get, url, params)
end

.get_quote(id, params) ⇒ Object



33
34
35
36
# File 'lib/mangopay/conversion.rb', line 33

def get_quote(id, params)
  url = "#{MangoPay.api_path}/conversions/quote/#{id}"
  MangoPay.request(:get, url, params)
end

.get_rate(debited_currency, credited_currency, params) ⇒ Object



8
9
10
11
# File 'lib/mangopay/conversion.rb', line 8

def get_rate(debited_currency, credited_currency, params)
  url = "#{MangoPay.api_path}/conversions/rate/#{debited_currency}/#{credited_currency}"
  MangoPay.request(:get, url, params)
end