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: 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

#==, #[], #[]=, #_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

#createdObject (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

#idObject (readonly)

Unique identifier for the object.



109
110
111
# File 'lib/stripe/resources/fx_quote.rb', line 109

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.



111
112
113
# File 'lib/stripe/resources/fx_quote.rb', line 111

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.



115
116
117
# File 'lib/stripe/resources/fx_quote.rb', line 115

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.



119
120
121
# File 'lib/stripe/resources/fx_quote.rb', line 119

def lock_status
  @lock_status
end

#objectObject (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

#ratesObject (readonly)

Information about the rates.



123
124
125
# File 'lib/stripe/resources/fx_quote.rb', line 123

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.



125
126
127
# File 'lib/stripe/resources/fx_quote.rb', line 125

def to_currency
  @to_currency
end

#usageObject (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_remappingsObject



143
144
145
# File 'lib/stripe/resources/fx_quote.rb', line 143

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



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 FX quotes that have been issued. 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_nameObject



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

def self.object_name
  "fx_quote"
end