Class: Stripe::FxQuote
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::FxQuote
- Extended by:
- APIOperations::Create, APIOperations::List
- Defined in:
- lib/stripe/resources/fx_quote.rb
Overview
The FX Quotes API provides three functions:
-
View Stripe’s current exchange rate for any given currency pair.
-
Extend quoted rates for a 1-hour period or a 24-hour period, minimizing uncertainty from FX fluctuations.
-
Preview the FX fees Stripe will charge on your FX transaction, allowing you to anticipate specific settlement amounts before payment costs.
[View the docs](docs.stripe.com/payments/currencies/localize-prices/fx-quotes-api)
Defined Under Namespace
Classes: CreateParams, ListParams, Rates, Usage
Constant Summary collapse
- OBJECT_NAME =
"fx_quote"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the quote was created, measured in seconds since the Unix epoch.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#lock_duration ⇒ Object
readonly
The duration the exchange rate quote remains valid from creation time.
-
#lock_expires_at ⇒ Object
readonly
Time at which the quote will expire, measured in seconds since the Unix epoch.
-
#lock_status ⇒ Object
readonly
Lock status of the quote.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#rates ⇒ Object
readonly
Information about the rates.
-
#to_currency ⇒ Object
readonly
The currency to convert into, typically this is the currency that you want to settle to your Stripe balance.
-
#usage ⇒ Object
readonly
Attribute for field usage.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates an FX Quote object.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of FX quotes that have been issued.
- .object_name ⇒ Object
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#created ⇒ Object (readonly)
Time at which the quote was created, measured in seconds since the Unix epoch.
194 195 196 |
# File 'lib/stripe/resources/fx_quote.rb', line 194 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
196 197 198 |
# File 'lib/stripe/resources/fx_quote.rb', line 196 def id @id end |
#lock_duration ⇒ Object (readonly)
The duration the exchange rate quote remains valid from creation time. Allowed values are none, hour, and day. Note that for the test mode API available in alpha, you can request an extended quote, but it won’t be usable for any transactions.
198 199 200 |
# File 'lib/stripe/resources/fx_quote.rb', line 198 def lock_duration @lock_duration end |
#lock_expires_at ⇒ Object (readonly)
Time at which the quote will expire, measured in seconds since the Unix epoch.
If lock_duration is set to ‘none’ this field will be set to null.
202 203 204 |
# File 'lib/stripe/resources/fx_quote.rb', line 202 def lock_expires_at @lock_expires_at end |
#lock_status ⇒ Object (readonly)
Lock status of the quote. Transitions from active to expired once past the lock_expires_at timestamp.
Can return value none, active, or expired.
206 207 208 |
# File 'lib/stripe/resources/fx_quote.rb', line 206 def lock_status @lock_status end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
208 209 210 |
# File 'lib/stripe/resources/fx_quote.rb', line 208 def object @object end |
#rates ⇒ Object (readonly)
Information about the rates.
210 211 212 |
# File 'lib/stripe/resources/fx_quote.rb', line 210 def rates @rates end |
#to_currency ⇒ Object (readonly)
The currency to convert into, typically this is the currency that you want to settle to your Stripe balance. Three-letter ISO currency code, in lowercase. Must be a supported currency.
212 213 214 |
# File 'lib/stripe/resources/fx_quote.rb', line 212 def to_currency @to_currency end |
#usage ⇒ Object (readonly)
Attribute for field usage
214 215 216 |
# File 'lib/stripe/resources/fx_quote.rb', line 214 def usage @usage end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates an FX Quote object
217 218 219 |
# File 'lib/stripe/resources/fx_quote.rb', line 217 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/fx_quotes", params: params, opts: opts) end |
.field_remappings ⇒ Object
230 231 232 |
# File 'lib/stripe/resources/fx_quote.rb', line 230 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
226 227 228 |
# File 'lib/stripe/resources/fx_quote.rb', line 226 def self.inner_class_types @inner_class_types = { rates: Rates, usage: Usage } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first.
222 223 224 |
# File 'lib/stripe/resources/fx_quote.rb', line 222 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/fx_quotes", params: params, opts: opts) end |
.object_name ⇒ Object
16 17 18 |
# File 'lib/stripe/resources/fx_quote.rb', line 16 def self.object_name "fx_quote" end |