Class: Stripe::ExchangeRateService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/exchange_rate_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#list(params = {}, opts = {}) ⇒ Object

[Deprecated] The ExchangeRate APIs are deprecated. Please use the FX Quotes API instead.

Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.



9
10
11
12
13
14
15
16
17
# File 'lib/stripe/services/exchange_rate_service.rb', line 9

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/exchange_rates",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(rate_id, params = {}, opts = {}) ⇒ Object

[Deprecated] The ExchangeRate APIs are deprecated. Please use the FX Quotes API instead.

Retrieves the exchange rates from the given currency to every supported currency.



22
23
24
25
26
27
28
29
30
# File 'lib/stripe/services/exchange_rate_service.rb', line 22

def retrieve(rate_id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/exchange_rates/%<rate_id>s", { rate_id: CGI.escape(rate_id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end