Class: Stripe::FxQuote

Inherits:
APIResource show all
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

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

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

included

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

#createdObject (readonly)

Time at which the quote was created, measured in seconds since the Unix epoch.



154
155
156
# File 'lib/stripe/resources/fx_quote.rb', line 154

def created
  @created
end

#idObject (readonly)

Unique identifier for the object.



156
157
158
# File 'lib/stripe/resources/fx_quote.rb', line 156

def id
  @id
end

#lock_durationObject (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.



158
159
160
# File 'lib/stripe/resources/fx_quote.rb', line 158

def lock_duration
  @lock_duration
end

#lock_expires_atObject (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.



162
163
164
# File 'lib/stripe/resources/fx_quote.rb', line 162

def lock_expires_at
  @lock_expires_at
end

#lock_statusObject (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.



166
167
168
# File 'lib/stripe/resources/fx_quote.rb', line 166

def lock_status
  @lock_status
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



168
169
170
# File 'lib/stripe/resources/fx_quote.rb', line 168

def object
  @object
end

#ratesObject (readonly)

Information about the rates.



170
171
172
# File 'lib/stripe/resources/fx_quote.rb', line 170

def rates
  @rates
end

#to_currencyObject (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.



172
173
174
# File 'lib/stripe/resources/fx_quote.rb', line 172

def to_currency
  @to_currency
end

#usageObject (readonly)

Attribute for field usage



174
175
176
# File 'lib/stripe/resources/fx_quote.rb', line 174

def usage
  @usage
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Creates an FX Quote object



177
178
179
# File 'lib/stripe/resources/fx_quote.rb', line 177

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.



182
183
184
# File 'lib/stripe/resources/fx_quote.rb', line 182

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/fx_quotes", params: params, opts: opts)
end

.object_nameObject



16
17
18
# File 'lib/stripe/resources/fx_quote.rb', line 16

def self.object_name
  "fx_quote"
end