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 key functions:
-
View current exchange rates: The object shows Stripe’s current exchange rate for any given currency pair.
-
Extended quotes: The API provides rate quotes valid for a 1-hour period or a 24-hour period, eliminating uncertainty from FX fluctuations.
-
View FX fees: The API provides information on the FX fees Stripe will charge on your FX transaction, allowing you to anticipate specific settlement amounts before payment costs.
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.
-
.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
#==, #[], #[]=, 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.
152 153 154 |
# File 'lib/stripe/resources/fx_quote.rb', line 152 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
154 155 156 |
# File 'lib/stripe/resources/fx_quote.rb', line 154 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.
156 157 158 |
# File 'lib/stripe/resources/fx_quote.rb', line 156 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.
160 161 162 |
# File 'lib/stripe/resources/fx_quote.rb', line 160 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.
164 165 166 |
# File 'lib/stripe/resources/fx_quote.rb', line 164 def lock_status @lock_status end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
166 167 168 |
# File 'lib/stripe/resources/fx_quote.rb', line 166 def object @object end |
#rates ⇒ Object (readonly)
Information about the rates.
168 169 170 |
# File 'lib/stripe/resources/fx_quote.rb', line 168 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.
170 171 172 |
# File 'lib/stripe/resources/fx_quote.rb', line 170 def to_currency @to_currency end |
#usage ⇒ Object (readonly)
Attribute for field usage
172 173 174 |
# File 'lib/stripe/resources/fx_quote.rb', line 172 def usage @usage end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates an FX Quote object
175 176 177 |
# File 'lib/stripe/resources/fx_quote.rb', line 175 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/fx_quotes", params: params, opts: opts) 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.
180 181 182 |
# File 'lib/stripe/resources/fx_quote.rb', line 180 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/fx_quotes", params: params, opts: opts) end |
.object_name ⇒ Object
14 15 16 |
# File 'lib/stripe/resources/fx_quote.rb', line 14 def self.object_name "fx_quote" end |