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 up to 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.
Defined Under Namespace
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 that the quote is locked for, 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 active FX quotes.
- .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?, field_encodings, #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.
107 108 109 |
# File 'lib/stripe/resources/fx_quote.rb', line 107 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
109 110 111 |
# File 'lib/stripe/resources/fx_quote.rb', line 109 def id @id end |
#lock_duration ⇒ Object (readonly)
The duration that the quote is locked for, from creation time. The quote will be usable for the duration specified.
111 112 113 |
# File 'lib/stripe/resources/fx_quote.rb', line 111 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.
115 116 117 |
# File 'lib/stripe/resources/fx_quote.rb', line 115 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.
119 120 121 |
# File 'lib/stripe/resources/fx_quote.rb', line 119 def lock_status @lock_status end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
121 122 123 |
# File 'lib/stripe/resources/fx_quote.rb', line 121 def object @object end |
#rates ⇒ Object (readonly)
Information about the rates.
123 124 125 |
# File 'lib/stripe/resources/fx_quote.rb', line 123 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.
125 126 127 |
# File 'lib/stripe/resources/fx_quote.rb', line 125 def to_currency @to_currency end |
#usage ⇒ Object (readonly)
Attribute for field usage
127 128 129 |
# File 'lib/stripe/resources/fx_quote.rb', line 127 def usage @usage end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates an FX Quote object
130 131 132 |
# File 'lib/stripe/resources/fx_quote.rb', line 130 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/fx_quotes", params: params, opts: opts) end |
.field_remappings ⇒ Object
143 144 145 |
# File 'lib/stripe/resources/fx_quote.rb', line 143 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
139 140 141 |
# File 'lib/stripe/resources/fx_quote.rb', line 139 def self.inner_class_types @inner_class_types = { rates: Rates, usage: Usage } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of active FX quotes. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first.
135 136 137 |
# File 'lib/stripe/resources/fx_quote.rb', line 135 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 |