Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for exchange_rates API requests #386

Merged
merged 1 commit into from
Oct 31, 2017

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries @alixander-stripe

Adds support for the new /v1/exchange_rates endpoints.

@brandur-stripe
Copy link
Contributor

I hate to ask, but mind bumping this one so ExchangeRates becomes singular?

@ob-stripe ob-stripe force-pushed the ob-exchange-rates branch 2 times, most recently from 8045b3c to 77ffb5b Compare October 31, 2017 16:15
@ob-stripe
Copy link
Contributor Author

Done, ptal @brandur-stripe

array(),
array(
'id' => 'usd',
'object' => 'exchange_rates',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe switch this over to exchange_rate (and there are three other instances below to replace in this file as well).

@brandur-stripe
Copy link
Contributor

Minor comment, but otherwise looks good. Thanks OB!

ptal @ob-stripe

@ob-stripe
Copy link
Contributor Author

Oops! Should be fixed now.


$currency = "usd";
$rates = ExchangeRate::retrieve($currency);
$this->assertEquals('exchange_rate', $rates->object);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish we could do $this->assertInstanceOf(ExchangeRate::class, $rates); here instead, but unfortunately that doesn't fly with PHP <= 5.4 😢

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh ...

Well, it's worth noting that 5.4 has been EOLed for more than two years (since mid-2015) and hasn't even been receiving security fixes for more than a year, which means that it's not safe to use. This approach works fine for now, but it's totally plausible to drop support for it at this point. (If you're not updating off of PHP 5.4, you're also probably not bothering to update your version of stripe-php.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I misread that. It's 5.5 has been EOLed for two years and hasn't been receiving updates for a year.

5.4 has been EOLed for three years (mid-2014) and hasn't been receiving updates for two years!

Copy link
Contributor

@arcanedev-maroc arcanedev-maroc Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://php.net/supported-versions.php

Version specific notes
PHP 5.6
As it is the final PHP 5 release, support for PHP 5.6 has been extended: active support will run for an additional four months, and the security fix period has been doubled from one to two years. Other releases are unaffected.

@brandur-stripe brandur-stripe merged commit 2fd503e into master Oct 31, 2017
@brandur-stripe brandur-stripe deleted the ob-exchange-rates branch October 31, 2017 18:51
@brandur-stripe
Copy link
Contributor

Released as 5.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants