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

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.



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

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

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



18
19
20
21
22
23
24
25
26
# File 'lib/stripe/services/exchange_rate_service.rb', line 18

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