614 Commits

Author SHA1 Message Date
Brandur
66d8ecd0d0 Bump version to 2.0.2 2017-03-16 09:06:27 -07:00
Jay Hayes
20553e7422 Replace invalid message Faraday::Response#code with valid #status
The Faraday::Response object does not respond to #code. The correct
message is #status. It seems this case was previously unhandled by the
test suite as there was no case for the server responding "success" with
an invalid JSON body.
2017-03-16 06:24:45 -05:00
Brandur
1bb9ac48b9 Bump version to 2.0.1 2017-02-22 08:11:30 -08:00
Brandur
77c8535fa3 Properly encode file uploads
As described in #506, file uploads were broken on the way over to
Faraday and unfortunately I didn't catch it because the file upload
creation test wasn't using a matcher that was strict enough to really
catch anything.

Here we add the multipart middleware to our Faraday connection, add a
compatibility layer to `FileUpload` so that we can support `File` like
the rest-client based version always did (Faraday generally expects an
`UploadIO` object), and then tighten up our tests so that we'd be able
to catch future regressions.

Fixes #506.
2017-02-21 17:35:21 -08:00
Brandur
ea90ddb6d3 Bump version to 2.0.0 2017-02-14 14:24:40 -08:00
Brandur
d8f3609f25 Don't shadow outer variable 2017-02-14 12:19:16 -08:00
Brandur
3f549fb5ad Port all tests over to OpenAPI
Follows the path established in 2d75c8f by porting the rest of
stripe-ruby's tests over to OpenAPI. There are a few other changes here
where I've removed some tests that are duplicated or don't make much
sense, or reorganized how we test certain things, but this commit is
largely the same migration operation applied in bulk a few dozen test
suites.
2017-02-14 12:17:37 -08:00
Brandur
4debb6ba5d Use one default connect per thread 2017-02-14 12:17:37 -08:00
Brandur
d4bcfd9f78 Refactor errors interfaces 2017-02-14 12:17:37 -08:00
Brandur
2ade248e32 All tests working! 2017-02-14 12:17:37 -08:00
Brandur
31020c4596 Move profiling information to SystemProfiler + merge tests 2017-02-14 12:17:37 -08:00
Brandur
de08a9b986 Lots of broken tests, but working implementation! 2017-02-14 12:17:37 -08:00
Brandur
41f58e3cde Functional and tested StripeClient 2017-02-14 12:17:37 -08:00
Brandur
1c780e2b3f Working test suite! 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
593bbab53f Use unambiguous wording "StripeResponse object" instead of "structure" 2017-02-14 12:17:37 -08:00
Brandur
b5ad0e30d7 Change to hash parameter for now for 1.9 support 2017-02-14 12:17:37 -08:00
Brandur
44fbe04bb7 Add test suite for StripeResponse 2017-02-14 12:17:37 -08:00
Brandur
843ea88219 Add a StripeResponse to objects created by API calls 2017-02-14 12:17:37 -08:00
Brandur
98c42e0b69 Bump version to 1.58.0 2017-01-19 14:11:17 -08:00
Olivier Bellone
9735255318 Better tests for sources 2017-01-19 18:32:58 +01:00
Brandur
b291bce240 Alphabetize class name list 2017-01-13 12:41:35 -08:00
Brandur
09c4885d31 Consolidate errors to one file + document them
Right now we have every error class in a separate file which doesn't do
anyone a lot of good, especially given that most of them are just stubs
that derive directly from `StripeError`.

This patch pulls them all into one file and gives them some
documentation. It follows #487 and #488 as minor refactoring work.
2017-01-13 10:28:10 -08:00
Brandur
fb555a764e Bump version to 1.57.1 2016-11-28 17:52:27 -08:00
Brandur
11a6eec5f5 Don't allow protected fields in Save.update API operation
As described in #481, adding a protected field like `legal_entity` as
part of an update API operation can cause some issues like a custom
encoding scheme not being considered and special handling around empty
values being ignored.

As a an easy fix for this, let's disallow access to protected fields in
the same way that we disallow them from being set directly on an
instance of a given model.

Helps address (but is not a complete fix for) #481.
2016-11-28 11:42:57 -08:00
Brandur
58184c2039 Bump version to 1.57.0 2016-11-21 18:03:06 -08:00
Olivier Bellone
4122f9bbb3 Adds 3DS retrieve endpoint 2016-11-21 19:36:58 +01:00
Brandur
b3828b6736 Bump version to 1.56.2 2016-11-17 11:54:35 -08:00
Amos47
46d992cf0d allow to_s to also pretty_generate embedded StripeObjects 2016-11-17 14:28:51 -05:00
Brandur
c826049813 Bump version to 1.56.1 2016-11-09 15:16:33 -08:00
Brandur
e3e070785b Fix memory leak
Fixes a memory leak caused by a doubled up `instance_eval`. See [1] for
context and discussion.

[1] https://github.com/stripe/stripe-ruby/issues/477
2016-11-08 17:38:58 -08:00
Feram
f14bf618e5 Fix typo unkown 2016-11-06 05:19:10 +00:00
takiy33
2e1931b153 Remove respond_to? method for Ruby 1.9.2 or earlier 2016-11-03 23:10:10 +09:00
Brandur
2de99c55ce Bump version to 1.56.0 2016-10-24 09:23:06 -07:00
Brandur
1437fa5418 Bump version to 1.55.1 2016-10-24 09:16:29 -07:00
Barry Kim
4faa7d169f Create accessor methods in update_attributes 2016-10-21 17:06:58 -07:00
Brandur
dff2bf10dd Alphabetize class list
This is a pretty pedestrian change, but here we alphabetize the list of
StripeObject class mappings so that it's easier to scan it for
accidental omissions.
2016-10-14 16:31:51 -07:00
Brandur
7b9169712f Rename error class to be singular "permissions"
The addition of this class was unreleased so this is not a breaking
change.
2016-10-14 10:29:09 -07:00
Jack Flintermann
1806d9524c handle 403 status codes 2016-10-14 08:57:19 -04:00
Kyle Conroy
c131bcbcac Correctly encode the subscription items array (#467)
* Correctly encode the subscription items array

* Use super

* Handle non-arrays as well

* Also encode items on create
2016-09-27 13:46:57 -07: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
Brandur
7637eb48bf Bump version to 1.55.0 2016-09-15 10:27:19 -07:00
Vijay Singh
e2cc264c12 Hoist extend and include directives to top of class 2016-09-15 10:14:42 -07:00
Vijay Singh
7ac03e0a88 Changed from ApplePay::Domain to ApplePayDomain 2016-09-14 18:43:56 -07:00
Vijay Singh
35bbb7a26b Ruby bindings of ApplePayDomain 2016-09-14 18:16:12 -07:00
Brandur
3b595a9e7f Bump version to 1.54.0 2016-09-01 10:24:30 -07:00
Brandur
805b65478c Bump version to 1.53.0 2016-08-31 08:10:34 -07:00
Brandur
73a1cf33de Bump version to 1.52.0 2016-08-30 14:48:55 -07:00
Brandur
22839df560 Nicen this code up a little bit and add a comment 2016-08-30 13:42:11 -07:00
Brandur
c796958516 Generalize saving nested resources
Since #433, saving API resources nested under other API resources has
not been the default. Instead, any instances where this should occur
have been special cased with specific method implementations that would
set the `#save_with_parent` flag when a field is written.

This ended up causing some problems because as seen in #457, because
places that we need to do this aren't well vetted, some were forgotten.

This makes implementation of new fields that need this behavior simpler
by implementing a `.save_nested_resource` metraprogramming method on the
`APIResource` class. This can be called as necessary by any concrete API
resource implementations.

We replace existing implementatinos and also add one to `Subscription`,
which had previously been suffering from a similar problem where its
`#source` had not received a special case.
2016-08-30 11:52:16 -07:00