41 Commits

Author SHA1 Message Date
Brandur
863da48398 Add frozen_string_literal to every file and enforce Rubocop rule
Adds the magic `frozen_string_literal: true` comment to every file and
enables a Rubocop rule to make sure that it's always going to be there
going forward as well.

See here for more background [1], but the basic idea is that unlike many
other languages, static strings in code are mutable by default. This has
since been acknowledged as not a particularly good idea, and the
intention is to rectify the mistake when Ruby 3 comes out, where all
string literals will be frozen. The `frozen_string_literal` magic
comment was introduced in Ruby 2.3 as a way of easing the transition,
and allows libraries and projects to freeze their literals in advance.

I don't think this is breaking in any way: it's possible that users
might've been pulling out one of are literals somehow and mutating it,
but that would probably not have been useful for anything and would
certainly not be recommended, so I'm quite comfortable pushing this
change through as a minor version.

As discussed in #641.

[1] https://stackoverflow.com/a/37799399
2018-05-10 14:56:14 -07:00
Olivier Bellone
e02ff7f849
Start using RuboCop for linting 2017-09-27 21:28:25 +02:00
Brandur
02ea970f67 Remove all resource-related test data
Now that we're powering all test suites with the fixture data that's
generated along with the OpenAPI spec, we don't need this secondary
sample data anymore. Remove all of it except for helpers to simulate
different types of error responses.
2017-02-14 12:17:37 -08:00
Brandur
1886d9a625 Move to an alternative system based on StripeClient 2017-02-14 12:17:37 -08:00
Brandur
3cf2ba3527 Use basic JSON.generate instead of make_response abstraction 2017-02-14 12:07:18 -08:00
Brandur
d1d5b9d39d More tests converted 2017-02-14 12:07:18 -08:00
Brandur
0019cfdc7e More updated tests 2017-02-14 12:07:18 -08:00
Brandur
1ef1f79a16 Lots of fixed tests 2017-02-14 12:07:18 -08:00
Olivier Bellone
9735255318 Better tests for sources 2017-01-19 18:32:58 +01:00
Jacqueline
d2f783df34 Add support for multiplan subscriptions (#466)
* Add support for multiplan subscriptions:
Serialize indexed arrays into hashes with index keys in subscription create, subscription update, and upcoming invoice
Add a SubscriptionItem object that supports creation, deletion, update, listing, and retrieval

* Remove helpers that convert items array to indexed hash
2016-09-21 17:44:00 -07:00
Vijay Singh
35bbb7a26b Ruby bindings of ApplePayDomain 2016-09-14 18:16:12 -07:00
Olivier Bellone
be8c56458f Added support for 3D Secure 2016-07-12 17:01:33 +02:00
Kyle Conroy
732a494ac4 Add update class method to API resources (#426)
* Rename the `Update` operation to `Save`
* Add the `update` class method to all saveable resources
* Add tests for update method
* Add tests for plans, invoice items, and application fees
2016-06-29 14:13:42 -07:00
Rasmus Rygaard
f37a1f2f9f Convert return_order response to OrderReturn. 2016-06-17 11:03:56 -07:00
Rasmus Rygaard
dab45737c9 Add order returns. 2016-05-18 17:56:15 -07:00
Jacqueline
60248fbd00 Use v1/subs endpoints for operations on subs and allow direct sub access (#411)
* allow subs to be retrieved & created with new v1/subs API endpoint

* edit tests to check for url

* fix customer subscription URLs to go through v1/customers
2016-05-04 14:14:24 -07:00
Ben Rahn
6dfc4e8c25 add test for handling of charge.outcome subfield 2016-04-11 14:47:30 -07:00
Joshua Kovach
e226ef2ea1 Change everything from url to resource_url 2016-03-11 02:53:50 -05:00
Brandur
555341029b Tweak whitespace for consistency 2016-02-08 08:21:34 -08:00
Ioannis Kolovos
f8532d225e Support for Stripe::CountrySpec 2016-02-06 16:55:29 +02:00
Michael Bianco
2255dd73a8 Adding nil customer value to mock bitcoin receiver hash 2016-01-06 21:47:32 -05:00
Brandur
add851006d Fix fixture data for invoices (and specifically invoice items)
Fixes #228.
2015-09-30 12:02:53 -07:00
Brandur
fef7f8c641 Add a make_account to test data + charge_enabled -> charges_enabled 2015-09-29 15:46:43 -07:00
Rasmus Rygaard
51b0bff8e9 Merge pull request #292 from stripe/rasmus-orders_bindings
Add Relay bindings
2015-09-14 16:36:37 -07:00
Rasmus Rygaard
747dac6ea0 Add Orders. 2015-09-13 20:43:36 -07:00
Rasmus Rygaard
690fd18cb3 Add SKUs, Products 2015-09-13 18:10:47 -07:00
Jacqueline Xu
a705799a2c add 429 rate limit error 2015-09-10 15:31:51 -07:00
Kyle Conroy
13979ce5be Add retrieve and all methods to refunds 2015-08-17 16:15:34 -07:00
Kyle Conroy
34010d7a99 Add evidence tests 2015-07-17 17:20:08 -07:00
Caitlin Johnson
a37912f122 Add top level dispute methods. 2015-07-16 14:19:41 -07:00
Kyle Conroy
8b0a074cbf Merge pull request #262 from stripe/request-ids
Add request IDs to all API errors
2015-07-02 14:33:12 -07:00
Kyle Conroy
053c44f35c Add request IDs and HTTP headers to errors
The request ID, if it exists, is now added to the output for the error
2015-07-02 13:54:02 -07:00
Kyle Conroy
b3610798c2 Rename test data methods 2015-07-02 11:51:38 -07:00
Max Lahey
d1a50a8918 customer card management should use the customer sources endpoint 2015-02-26 17:32:33 -08:00
Brian Krausz
d1bceb0041 Support transfer reversals 2015-02-12 22:24:09 -08:00
Max Lahey
9f175e070f added BitcoinTransaction 2015-01-20 11:58:43 -08:00
Max Lahey
0e9a88f796 Wired up support for BitcoinReceiver 2015-01-20 11:58:41 -08:00
wangjohn
ad26262a2c Adding support for listing file uploads. 2015-01-12 12:44:46 -08:00
wangjohn
ef249b7ceb Create the file upload api resource (+ bump version) 2014-12-22 18:04:53 -08:00
Harlow Ward
1d97c81d8b Consistently use symbols for hash keys
* Updated keys to symbols to match the rest of the test helper
2014-11-14 15:45:25 -08:00
Russell Davis
d6e2dae298 Change Helpers to Stripe::TestData 2014-11-14 14:10:45 -08:00