recurly 3.19.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/.github/workflows/docs.yml +1 -1
- data/.github_changelog_generator +8 -0
- data/.travis.yml +0 -3
- data/CHANGELOG.md +202 -268
- data/CONTRIBUTING.md +0 -4
- data/GETTING_STARTED.md +20 -17
- data/README.md +0 -3
- data/lib/recurly/client/operations.rb +774 -630
- data/lib/recurly/client.rb +44 -28
- data/lib/recurly/errors/api_errors.rb +3 -2
- data/lib/recurly/errors.rb +5 -23
- data/lib/recurly/pager.rb +5 -15
- data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
- data/lib/recurly/requests/account_create.rb +2 -6
- data/lib/recurly/requests/account_purchase.rb +2 -6
- data/lib/recurly/requests/account_update.rb +0 -4
- data/lib/recurly/requests/add_on_create.rb +2 -2
- data/lib/recurly/requests/add_on_pricing.rb +5 -5
- data/lib/recurly/requests/add_on_update.rb +2 -2
- data/lib/recurly/requests/address.rb +1 -9
- data/lib/recurly/requests/billing_info_create.rb +2 -30
- data/lib/recurly/requests/coupon_create.rb +1 -1
- data/lib/recurly/requests/external_transaction.rb +1 -1
- data/lib/recurly/requests/invoice_address.rb +1 -1
- data/lib/recurly/requests/invoice_collect.rb +1 -1
- data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
- data/lib/recurly/requests/line_item_create.rb +2 -6
- data/lib/recurly/requests/plan_create.rb +0 -4
- data/lib/recurly/requests/plan_pricing.rb +0 -4
- data/lib/recurly/requests/plan_update.rb +0 -4
- data/lib/recurly/requests/pricing.rb +0 -4
- data/lib/recurly/requests/purchase_create.rb +1 -1
- data/lib/recurly/requests/shipping_address_create.rb +1 -1
- data/lib/recurly/requests/shipping_address_update.rb +1 -1
- data/lib/recurly/requests/subscription_add_on_create.rb +6 -2
- data/lib/recurly/requests/subscription_add_on_tier.rb +5 -1
- data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
- data/lib/recurly/requests/subscription_change_create.rb +1 -9
- data/lib/recurly/requests/subscription_create.rb +5 -9
- data/lib/recurly/requests/subscription_pause.rb +1 -1
- data/lib/recurly/requests/subscription_purchase.rb +2 -6
- data/lib/recurly/requests/subscription_update.rb +1 -5
- data/lib/recurly/requests/tier.rb +2 -2
- data/lib/recurly/requests/tier_pricing.rb +22 -0
- data/lib/recurly/resources/account.rb +0 -4
- data/lib/recurly/resources/account_mini.rb +0 -4
- data/lib/recurly/resources/add_on.rb +1 -1
- data/lib/recurly/resources/add_on_pricing.rb +5 -5
- data/lib/recurly/resources/address.rb +1 -9
- data/lib/recurly/resources/address_with_name.rb +46 -0
- data/lib/recurly/resources/billing_info.rb +1 -5
- data/lib/recurly/resources/billing_info_updated_by.rb +1 -1
- data/lib/recurly/resources/coupon.rb +5 -17
- data/lib/recurly/resources/invoice.rb +7 -7
- data/lib/recurly/resources/invoice_address.rb +1 -1
- data/lib/recurly/resources/line_item.rb +7 -7
- data/lib/recurly/resources/payment_method.rb +0 -4
- data/lib/recurly/resources/plan.rb +1 -5
- data/lib/recurly/resources/plan_pricing.rb +0 -4
- data/lib/recurly/resources/pricing.rb +0 -4
- data/lib/recurly/resources/shipping_address.rb +1 -1
- data/lib/recurly/resources/subscription.rb +0 -4
- data/lib/recurly/resources/subscription_add_on.rb +6 -2
- data/lib/recurly/resources/subscription_add_on_tier.rb +5 -1
- data/lib/recurly/resources/subscription_change.rb +0 -12
- data/lib/recurly/resources/tax_info.rb +0 -4
- data/lib/recurly/resources/tier.rb +2 -2
- data/lib/recurly/resources/tier_pricing.rb +22 -0
- data/lib/recurly/resources/transaction.rb +3 -7
- data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
- data/lib/recurly/resources/usage.rb +5 -1
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +1949 -2573
- data/scripts/build +2 -2
- data/scripts/bump +11 -0
- data/scripts/changelog +14 -0
- data/scripts/format +2 -2
- data/scripts/prepare-release +29 -43
- data/scripts/release +20 -5
- metadata +15 -22
- data/.changelog_config.yaml +0 -11
- data/CODE_OF_CONDUCT.md +0 -130
- data/lib/recurly/errors/network_errors.rb +0 -10
- data/lib/recurly/requests/billing_info_verify.rb +0 -14
- data/lib/recurly/requests/dunning_campaigns_bulk_update.rb +0 -18
- data/lib/recurly/requests/subscription_change_billing_info_create.rb +0 -14
- data/lib/recurly/resources/dunning_campaign.rb +0 -50
- data/lib/recurly/resources/dunning_campaigns_bulk_update_response.rb +0 -18
- data/lib/recurly/resources/dunning_cycle.rb +0 -58
- data/lib/recurly/resources/dunning_interval.rb +0 -18
- data/lib/recurly/resources/line_item_list.rb +0 -26
- data/lib/recurly/resources/subscription_change_billing_info.rb +0 -14
- data/lib/recurly/resources/subscription_change_preview.rb +0 -86
- data/lib/recurly/resources/tax_detail.rb +0 -26
data/CONTRIBUTING.md
CHANGED
@@ -7,10 +7,6 @@ however, we may not get to these right away. Although we try to be quick, our pr
|
|
7
7
|
writing code. If you want a timely response (especially if you have an emergency), we recommend
|
8
8
|
you contact our [official support team](https://support.recurly.com/).
|
9
9
|
|
10
|
-
## Code of Conduct
|
11
|
-
|
12
|
-
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
13
|
-
|
14
10
|
#### Table Of Contents
|
15
11
|
|
16
12
|
* [I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
|
data/GETTING_STARTED.md
CHANGED
@@ -5,7 +5,7 @@ This repository houses the official ruby client for Recurly's V3 API.
|
|
5
5
|
In your Gemfile, add `recurly` as a dependency.
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'recurly', '~>
|
8
|
+
gem 'recurly', '~> 4.0'
|
9
9
|
```
|
10
10
|
|
11
11
|
> *Note*: We try to follow [semantic versioning](https://semver.org/) and will only apply breaking changes to major versions.
|
@@ -106,17 +106,19 @@ plans.each_page.each_with_index do |data, page_num|
|
|
106
106
|
end
|
107
107
|
```
|
108
108
|
|
109
|
-
Pagination endpoints take a number of options to sort and filter the results. They can be passed in as keyword
|
109
|
+
Pagination endpoints take a number of options to sort and filter the results. They can be passed in as a hash provided by the `:params` keyword argument.
|
110
110
|
The names, types, and descriptions of these arguments are listed in the rubydocs for each method:
|
111
111
|
|
112
112
|
```ruby
|
113
113
|
options = {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
114
|
+
params: {
|
115
|
+
limit: 200, # number of items per page
|
116
|
+
state: :active, # only active plans
|
117
|
+
sort: :updated_at,
|
118
|
+
order: :asc,
|
119
|
+
begin_time: DateTime.new(2017,1,1), # January 1st 2017,
|
120
|
+
end_time: DateTime.now
|
121
|
+
}
|
120
122
|
}
|
121
123
|
|
122
124
|
plans = client.list_plans(**options)
|
@@ -200,12 +202,11 @@ plan = client.create_plan(body: plan_data)
|
|
200
202
|
|
201
203
|
# Error Handling
|
202
204
|
|
203
|
-
|
205
|
+
All errors thrown by this library are based off of the `Recurly::Errors::APIError`. There
|
204
206
|
|
205
|
-
|
206
|
-
2. [Network Errors](./lib/recurly/errors/network_errors.rb)
|
207
|
+
This library throws one main type of exception, `Recurly::Errors::APIError`. There exists an additional hierarchy of errors to facilitate the process of rescuing various classes of errors. More detail can be found in the [Api Errors Module](./lib/recurly/errors/api_errors.rb).
|
207
208
|
|
208
|
-
You
|
209
|
+
You can catch specific or generic versions of these exceptions. Example:
|
209
210
|
|
210
211
|
```ruby
|
211
212
|
begin
|
@@ -233,15 +234,17 @@ rescue Recurly::Errors::ValidationError => ex
|
|
233
234
|
#=> #<Recurly::Error:0x007fbbdf8a32c8 @attributes={:type=>"validation", :message=>"Code 'iexistalready' already exists", :params=>[{"param"=>"code", "message"=>"'iexistalready' already exists"}]}>
|
234
235
|
puts ex.status_code
|
235
236
|
#=> 422
|
237
|
+
rescue Recurly::Errors::TimeoutError => ex
|
238
|
+
# catch a specific server error
|
239
|
+
rescue Recurly::Errors::ServerError => ex
|
240
|
+
# catch a generic server error
|
236
241
|
rescue Recurly::Errors::APIError => ex
|
237
242
|
# catch a generic api error
|
238
|
-
rescue Recurly::Errors::TimeoutError => ex
|
239
|
-
# catch a specific network error
|
240
|
-
rescue Recurly::Errors::NetworkError => ex
|
241
|
-
# catch a generic network error
|
242
243
|
end
|
243
244
|
```
|
244
245
|
|
246
|
+
`Recurly::Errors::APIError` instances provide access to the response via the `#get_response` method.
|
247
|
+
|
245
248
|
# HTTP Metadata
|
246
249
|
|
247
250
|
Sometimes you might want to get some additional information about the underlying HTTP request and response. Instead of
|
@@ -266,7 +269,7 @@ response = @client.remove_line_item(
|
|
266
269
|
line_item_id: "a959576b2b10b012"
|
267
270
|
).get_response
|
268
271
|
```
|
269
|
-
And it can be captured on exceptions through the {Recurly::
|
272
|
+
And it can be captured on exceptions through the {Recurly::APIError} object:
|
270
273
|
|
271
274
|
```ruby
|
272
275
|
begin
|
data/README.md
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# Recurly
|
2
2
|
|
3
|
-
[](https://rubygems.org/gems/recurly)
|
4
|
-
[](CODE_OF_CONDUCT.md)
|
5
|
-
|
6
3
|
This repository houses the official ruby client for Recurly's V3 API.
|
7
4
|
|
8
5
|
> *Note*:
|