Class: Stripe::ExchangeRateService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::ExchangeRateService
- Defined in:
- lib/stripe/services/exchange_rate_service.rb
Defined Under Namespace
Classes: ListParams, RetrieveParams
Instance Method Summary collapse
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of objects that contain the rates at which foreign currencies are converted to one another.
-
#retrieve(rate_id, params = {}, opts = {}) ⇒ Object
Retrieves the exchange rates from the given currency to every supported currency.
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.
34 35 36 37 38 39 40 41 42 |
# File 'lib/stripe/services/exchange_rate_service.rb', line 34 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.
45 46 47 48 49 50 51 52 53 |
# File 'lib/stripe/services/exchange_rate_service.rb', line 45 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 |