ApiOperations
6 months ago
Apps
6 months ago
Billing
6 months ago
BillingPortal
6 months ago
Checkout
6 months ago
Climate
6 months ago
Entitlements
6 months ago
EventData
6 months ago
Events
6 months ago
Exception
6 months ago
FinancialConnections
6 months ago
Forwarding
6 months ago
HttpClient
6 months ago
Identity
6 months ago
Issuing
6 months ago
Radar
6 months ago
Reporting
6 months ago
Service
6 months ago
Sigma
6 months ago
Tax
6 months ago
Terminal
6 months ago
TestHelpers
6 months ago
Treasury
6 months ago
Util
6 months ago
V2
6 months ago
Account.php
6 months ago
AccountLink.php
6 months ago
AccountSession.php
6 months ago
ApiRequestor.php
6 months ago
ApiResource.php
6 months ago
ApiResponse.php
6 months ago
ApplePayDomain.php
6 months ago
Application.php
6 months ago
ApplicationFee.php
6 months ago
ApplicationFeeRefund.php
6 months ago
Balance.php
6 months ago
BalanceTransaction.php
6 months ago
BankAccount.php
6 months ago
BaseStripeClient.php
6 months ago
BaseStripeClientInterface.php
6 months ago
Capability.php
6 months ago
Card.php
6 months ago
CashBalance.php
6 months ago
Charge.php
6 months ago
Collection.php
6 months ago
ConfirmationToken.php
6 months ago
ConnectCollectionTransfer.php
6 months ago
CountrySpec.php
6 months ago
Coupon.php
6 months ago
CreditNote.php
6 months ago
CreditNoteLineItem.php
6 months ago
Customer.php
6 months ago
CustomerBalanceTransaction.php
6 months ago
CustomerCashBalanceTransaction.php
6 months ago
CustomerSession.php
6 months ago
Discount.php
6 months ago
Dispute.php
6 months ago
EphemeralKey.php
6 months ago
ErrorObject.php
6 months ago
Event.php
6 months ago
ExchangeRate.php
6 months ago
File.php
6 months ago
FileLink.php
6 months ago
FundingInstructions.php
6 months ago
Invoice.php
6 months ago
InvoiceItem.php
6 months ago
InvoiceLineItem.php
6 months ago
InvoicePayment.php
6 months ago
InvoiceRenderingTemplate.php
6 months ago
LineItem.php
6 months ago
LoginLink.php
6 months ago
Mandate.php
6 months ago
OAuth.php
6 months ago
OAuthErrorObject.php
6 months ago
PaymentIntent.php
6 months ago
PaymentLink.php
6 months ago
PaymentMethod.php
6 months ago
PaymentMethodConfiguration.php
6 months ago
PaymentMethodDomain.php
6 months ago
Payout.php
6 months ago
Person.php
6 months ago
Plan.php
6 months ago
Price.php
6 months ago
Product.php
6 months ago
ProductFeature.php
6 months ago
PromotionCode.php
6 months ago
Quote.php
6 months ago
Reason.php
6 months ago
RecipientTransfer.php
6 months ago
Refund.php
6 months ago
RelatedObject.php
6 months ago
RequestTelemetry.php
6 months ago
ReserveTransaction.php
6 months ago
Review.php
6 months ago
SearchResult.php
6 months ago
SetupAttempt.php
6 months ago
SetupIntent.php
6 months ago
ShippingRate.php
6 months ago
SingletonApiResource.php
6 months ago
Source.php
6 months ago
SourceMandateNotification.php
6 months ago
SourceTransaction.php
6 months ago
Stripe.php
6 months ago
StripeClient.php
6 months ago
StripeClientInterface.php
6 months ago
StripeObject.php
6 months ago
StripeStreamingClientInterface.php
6 months ago
Subscription.php
6 months ago
SubscriptionItem.php
6 months ago
SubscriptionSchedule.php
6 months ago
TaxCode.php
6 months ago
TaxDeductedAtSource.php
6 months ago
TaxId.php
6 months ago
TaxRate.php
6 months ago
ThinEvent.php
6 months ago
Token.php
6 months ago
Topup.php
6 months ago
Transfer.php
6 months ago
TransferReversal.php
6 months ago
Webhook.php
6 months ago
WebhookEndpoint.php
6 months ago
WebhookSignature.php
6 months ago
ExchangeRate.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace AmeliaVendor\Stripe; |
| 5 | |
| 6 | /** |
| 7 | * <code>ExchangeRate</code> objects allow you to determine the rates that Stripe is currently |
| 8 | * using to convert from one currency to another. Since this number is variable |
| 9 | * throughout the day, there are various reasons why you might want to know the current |
| 10 | * rate (for example, to dynamically price an item for a user with a default |
| 11 | * payment in a foreign currency). |
| 12 | * |
| 13 | * Please refer to our <a href="https://stripe.com/docs/fx-rates">Exchange Rates API</a> guide for more details. |
| 14 | * |
| 15 | * <em>[Note: this integration path is supported but no longer recommended]</em> Additionally, |
| 16 | * you can guarantee that a charge is made with an exchange rate that you expect is |
| 17 | * current. To do so, you must pass in the exchange_rate to charges endpoints. If the |
| 18 | * value is no longer up to date, the charge won't go through. Please refer to our |
| 19 | * <a href="https://stripe.com/docs/exchange-rates">Using with charges</a> guide for more details. |
| 20 | * |
| 21 | * ----- |
| 22 | * |
| 23 | * |
| 24 | * |
| 25 | * <em>This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. You may use the API solely for the purpose of transacting on Stripe. For example, the API may be queried in order to:</em> |
| 26 | * |
| 27 | * - <em>localize prices for processing payments on Stripe</em> |
| 28 | * - <em>reconcile Stripe transactions</em> |
| 29 | * - <em>determine how much money to send to a connected account</em> |
| 30 | * - <em>determine app fees to charge a connected account</em> |
| 31 | * |
| 32 | * <em>Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.</em> |
| 33 | * |
| 34 | * @property string $id Unique identifier for the object. Represented as the three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a> in lowercase. |
| 35 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 36 | * @property \StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. |
| 37 | */ |
| 38 | class ExchangeRate extends ApiResource |
| 39 | { |
| 40 | const OBJECT_NAME = 'exchange_rate'; |
| 41 | /** |
| 42 | * Returns a list of objects that contain the rates at which foreign currencies are |
| 43 | * converted to one another. Only shows the currencies for which Stripe supports. |
| 44 | * |
| 45 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params |
| 46 | * @param null|array|string $opts |
| 47 | * |
| 48 | * @return Collection<ExchangeRate> of ApiResources |
| 49 | * |
| 50 | * @throws Exception\ApiErrorException if the request fails |
| 51 | */ |
| 52 | public static function all($params = null, $opts = null) |
| 53 | { |
| 54 | $url = static::classUrl(); |
| 55 | return static::_requestPage($url, Collection::class, $params, $opts); |
| 56 | } |
| 57 | /** |
| 58 | * Retrieves the exchange rates from the given currency to every supported |
| 59 | * currency. |
| 60 | * |
| 61 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 62 | * @param null|array|string $opts |
| 63 | * |
| 64 | * @return ExchangeRate |
| 65 | * |
| 66 | * @throws Exception\ApiErrorException if the request fails |
| 67 | */ |
| 68 | public static function retrieve($id, $opts = null) |
| 69 | { |
| 70 | $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts); |
| 71 | $instance = new static($id, $opts); |
| 72 | $instance->refresh(); |
| 73 | return $instance; |
| 74 | } |
| 75 | } |