recurly 3.15.0 → 3.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecaa5f1cc2110480aac4355c469c84d7a423badce1a4860cd494ab9e4966a118
4
- data.tar.gz: b5c805224d670c22eed575410d51af2e801279f7f5dae0d274d84ecc60731363
3
+ metadata.gz: a7b4df1917c4b15c1d01a13889c926f0c262c2ca1d5ccea2d74dabd19f9a8744
4
+ data.tar.gz: 33dbffde9c280aa495676f348a103a18d40c2627b7e98f7876cdca1704e49d45
5
5
  SHA512:
6
- metadata.gz: 322cf51b9d06fb661860d02603896a370b92b0292eae793a1ec911bd5528f8452180e76a80199f0f938b9ff4f7c8458001941a18f899c3bdfdd6b49aaf6e0963
7
- data.tar.gz: 2cace6d2929076220ae9f029865a9bc6ca73e66edd0bafb66bce496e5e70985bb1da9a72fa0265c659c725a187a1fdc42730b696524bc1a66bdd84495ccc6958
6
+ metadata.gz: 549b263ed42946ab85c5efa475a66c11c35d4a0ea4098f814a8096ffb6cf4ad2bb413d1ee7ae5603fea4027cbe3fcc9c7d5bd4d358203f142fa47964a3a21b99
7
+ data.tar.gz: ec7d592254799f676bdc0ca6c95e4b173c35a3535200d5f76fbeb4609600ac6639d194b8705d942e6e184b6b68fce400ce697bc0398cbfbe40bfe2ea7b4a2b15
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.15.0
2
+ current_version = 3.16.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
@@ -1,8 +1,25 @@
1
1
  # Changelog
2
2
 
3
- ## [3.15.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
3
+ ## [3.16.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.14.0...HEAD)
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.15.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Latest Changes for 2019-10-10 \(tax\_identifier / tax\_identifier\_type\) [\#654](https://github.com/recurly/recurly-client-ruby/pull/654) ([douglasmiller](https://github.com/douglasmiller))
10
+ - Latest Changes for 2019-10-10 [\#651](https://github.com/recurly/recurly-client-ruby/pull/651) ([douglasmiller](https://github.com/douglasmiller))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Refund API V2 Error Details [\#652](https://github.com/recurly/recurly-client-ruby/issues/652)
15
+
16
+ **Merged pull requests:**
17
+
18
+ - Release 3.16.0 [\#656](https://github.com/recurly/recurly-client-ruby/pull/656) ([douglasmiller](https://github.com/douglasmiller))
19
+
20
+ ## [3.15.0](https://github.com/recurly/recurly-client-ruby/tree/3.15.0) (2020-11-06)
21
+
22
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.14.0...3.15.0)
6
23
 
7
24
  **Implemented enhancements:**
8
25
 
@@ -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', '~> 3.15'
8
+ gem 'recurly', '~> 3.16'
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.
@@ -568,6 +568,7 @@ module Recurly
568
568
  # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
569
569
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
570
570
  #
571
+ # @param state [String] Filter by state.
571
572
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
572
573
  #
573
574
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
@@ -1470,6 +1471,17 @@ module Recurly
1470
1471
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
1471
1472
  #
1472
1473
  # @return [Resources::Coupon] The restored coupon.
1474
+ # @example
1475
+ # begin
1476
+ # coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
1477
+ # name: "New Coupon Name"
1478
+ # })
1479
+ # puts "Restored coupon #{coupon}"
1480
+ # rescue Recurly::Errors::NotFoundError
1481
+ # # If the resource was not found, you may want to alert the user or
1482
+ # # just return nil
1483
+ # puts "Resource Not Found"
1484
+ # end
1473
1485
  #
1474
1486
  def restore_coupon(coupon_id:, body:, **options)
1475
1487
  path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
@@ -3041,6 +3053,7 @@ module Recurly
3041
3053
  #
3042
3054
  # You may also terminate a subscription with no refund and then manually refund specific invoices.
3043
3055
  #
3056
+ # @param charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
3044
3057
  # @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
3045
3058
  #
3046
3059
  # @return [Resources::Subscription] An expired subscription.
@@ -86,6 +86,14 @@ module Recurly
86
86
  # @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
87
87
  define_attribute :sort_code, String
88
88
 
89
+ # @!attribute tax_identifier
90
+ # @return [String] Tax identifier is required if adding a billing info that is a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents.
91
+ define_attribute :tax_identifier, String
92
+
93
+ # @!attribute tax_identifier_type
94
+ # @return [String] this field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil.
95
+ define_attribute :tax_identifier_type, String
96
+
89
97
  # @!attribute three_d_secure_action_result_token_id
90
98
  # @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
91
99
  define_attribute :three_d_secure_action_result_token_id, String
@@ -10,10 +10,6 @@ module Recurly
10
10
  # @return [String] Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
11
11
  define_attribute :accounting_code, String
12
12
 
13
- # @!attribute add_ons
14
- # @return [Array[AddOnCreate]] Add Ons
15
- define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
16
-
17
13
  # @!attribute allow_any_item_on_subscriptions
18
14
  # @return [Boolean] Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used.
19
15
  define_attribute :allow_any_item_on_subscriptions, :Boolean
@@ -43,7 +43,7 @@ module Recurly
43
43
  define_attribute :collection_method, String
44
44
 
45
45
  # @!attribute coupon_redemptions
46
- # @return [Array[CouponRedemptionMini]] Coupon redemptions
46
+ # @return [Array[CouponRedemptionMini]] Returns subscription level coupon redemptions that are tied to this subscription.
47
47
  define_attribute :coupon_redemptions, Array, { :item_type => :CouponRedemptionMini }
48
48
 
49
49
  # @!attribute created_at
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "3.15.0"
2
+ VERSION = "3.16.0"
3
3
  end
@@ -1142,14 +1142,11 @@ paths:
1142
1142
  const account = await client.deactivateAccount(accountId)
1143
1143
  console.log('Deleted account: ', account.code)
1144
1144
  } catch (err) {
1145
- if (err && err.type === 'not-found') {
1145
+ if (err instanceof recurly.errors.NotFoundError) {
1146
1146
  // If the request was not found, you may want to alert the user or
1147
1147
  // just return null
1148
1148
  console.log('Resource Not Found')
1149
1149
  }
1150
- // If we don't know what to do with the err, we should
1151
- // probably re-raise and let our web framework and logger handle it
1152
- throw err
1153
1150
  }
1154
1151
  - lang: Python
1155
1152
  source: |
@@ -1649,14 +1646,11 @@ paths:
1649
1646
  const account = await client.reactivateAccount(accountId)
1650
1647
  console.log('Reactivated account: ', account.code)
1651
1648
  } catch (err) {
1652
- if (err && err.type === 'not_found') {
1649
+ if (err instanceof recurly.errors.NotFoundError) {
1653
1650
  // If the request was not found, you may want to alert the user or
1654
1651
  // just return null
1655
1652
  console.log('Resource Not Found')
1656
1653
  }
1657
- // If we don't know what to do with the err, we should
1658
- // probably re-raise and let our web framework and logger handle it
1659
- throw err
1660
1654
  }
1661
1655
  - lang: Python
1662
1656
  source: |
@@ -2481,6 +2475,7 @@ paths:
2481
2475
  - "$ref": "#/components/parameters/sort_dates"
2482
2476
  - "$ref": "#/components/parameters/filter_begin_time"
2483
2477
  - "$ref": "#/components/parameters/filter_end_time"
2478
+ - "$ref": "#/components/parameters/filter_state"
2484
2479
  responses:
2485
2480
  '200':
2486
2481
  description: A list of the the coupon redemptions on an account.
@@ -5742,7 +5737,108 @@ paths:
5742
5737
  application/json:
5743
5738
  schema:
5744
5739
  "$ref": "#/components/schemas/Error"
5745
- x-code-samples: []
5740
+ x-code-samples:
5741
+ - lang: Node.js
5742
+ source: |
5743
+ try {
5744
+ const coupon = await client.restoreCoupon(couponId, {
5745
+ name: "New Coupon Name"
5746
+ })
5747
+ console.log('Restored coupon: ', coupon.code)
5748
+ } catch (err) {
5749
+ if (err instanceof recurly.errors.NotFoundError) {
5750
+ // If the request was not found, you may want to alert the user or
5751
+ // just return null
5752
+ console.log('Resource Not Found')
5753
+ }
5754
+
5755
+ }
5756
+ - lang: Python
5757
+ source: |
5758
+ try:
5759
+ coupon = client.restore_coupon(coupon_id, {
5760
+ "name": "New Coupon Name"
5761
+ })
5762
+ print("Restored Coupon %s" % coupon)
5763
+ except recurly.errors.NotFoundError:
5764
+ # If the resource was not found, you may want to alert the user or
5765
+ # just return nil
5766
+ print("Resource Not Found")
5767
+ - lang: ".NET"
5768
+ source: |
5769
+ try
5770
+ {
5771
+ var couponReq = new CouponUpdate() {
5772
+ Name = "New Coupon Name"
5773
+ };
5774
+ Coupon coupon = client.RestoreCoupon(couponId, couponReq);
5775
+ Console.WriteLine($"Restored coupon {coupon.Code}");
5776
+ }
5777
+ catch (Recurly.Errors.Validation ex)
5778
+ {
5779
+ // If the request was not valid, you may want to tell your user
5780
+ // why. You can find the invalid params and reasons in ex.Error.Params
5781
+ Console.WriteLine($"Failed validation: {ex.Error.Message}");
5782
+ }
5783
+ catch (Recurly.Errors.ApiError ex)
5784
+ {
5785
+ // Use ApiError to catch a generic error from the API
5786
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
5787
+ }
5788
+ - lang: Ruby
5789
+ source: |
5790
+ begin
5791
+ coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
5792
+ name: "New Coupon Name"
5793
+ })
5794
+ puts "Restored coupon #{coupon}"
5795
+ rescue Recurly::Errors::NotFoundError
5796
+ # If the resource was not found, you may want to alert the user or
5797
+ # just return nil
5798
+ puts "Resource Not Found"
5799
+ end
5800
+ - lang: Java
5801
+ source: |
5802
+ try {
5803
+ final CouponUpdate couponUpdate = new CouponUpdate();
5804
+ couponUpdate.setName("New Coupon Name");
5805
+
5806
+ final Coupon coupon = client.restoreCoupon(couponId, couponUpdate);
5807
+ System.out.println("Restored coupon: " + coupon.getCode());
5808
+ } catch (ValidationException e) {
5809
+ // If the request was not valid, you may want to tell your user
5810
+ // why. You can find the invalid params and reasons in e.getError().getParams()
5811
+ System.out.println("Failed validation: " + e.getError().getMessage());
5812
+ } catch (ApiException e) {
5813
+ // Use ApiException to catch a generic error from the API
5814
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
5815
+ }
5816
+ - lang: PHP
5817
+ source: |
5818
+ try {
5819
+ $coupon_update = [
5820
+ "name" => "New Coupon Name"
5821
+ ];
5822
+ $coupon = $client->restoreCoupon($coupon_id, $coupon_update);
5823
+
5824
+ echo 'Restored Coupon:' . PHP_EOL;
5825
+ var_dump($coupon);
5826
+ } catch (\Recurly\Errors\NotFound $e) {
5827
+ // Could not find the resource, you may want to inform the user
5828
+ // or just return a NULL
5829
+ echo 'Could not find resource.' . PHP_EOL;
5830
+ var_dump($e);
5831
+ } catch (\Recurly\RecurlyError $e) {
5832
+ // Something bad happened... tell the user so that they can fix it?
5833
+ echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;
5834
+ }
5835
+ - lang: Go
5836
+ source: "updateReq := &recurly.CouponUpdate{\n\tName: recurly.String(\"New
5837
+ Coupon Name\"),\n}\ncoupon, err := client.RestoreCoupon(couponId, updateReq)\nif
5838
+ e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation
5839
+ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
5840
+ Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Restored Coupon:
5841
+ %s\", coupon.Id)"
5746
5842
  "/sites/{site_id}/coupons/{coupon_id}/unique_coupon_codes":
5747
5843
  get:
5748
5844
  tags:
@@ -6741,14 +6837,11 @@ paths:
6741
6837
  const item = await client.deactivateItem(itemId)
6742
6838
  console.log('Deleted item: ', item.code)
6743
6839
  } catch (err) {
6744
- if (err && err.type === 'not-found') {
6840
+ if (err instanceof recurly.errors.NotFoundError) {
6745
6841
  // If the request was not found, you may want to alert the user or
6746
6842
  // just return null
6747
6843
  console.log('Resource Not Found')
6748
6844
  }
6749
- // If we don't know what to do with the err, we should
6750
- // probably re-raise and let our web framework and logger handle it
6751
- throw err
6752
6845
  }
6753
6846
  - lang: Python
6754
6847
  source: |
@@ -6865,14 +6958,11 @@ paths:
6865
6958
  const item = await client.reactivateItem(itemId)
6866
6959
  console.log('Reactivated item: ', item.code)
6867
6960
  } catch (err) {
6868
- if (err && err.type === 'not_found') {
6961
+ if (err instanceof recurly.errors.NotFoundError) {
6869
6962
  // If the request was not found, you may want to alert the user or
6870
6963
  // just return null
6871
6964
  console.log('Resource Not Found')
6872
6965
  }
6873
- // If we don't know what to do with the err, we should
6874
- // probably re-raise and let our web framework and logger handle it
6875
- throw err
6876
6966
  }
6877
6967
  - lang: Python
6878
6968
  source: |
@@ -11451,6 +11541,16 @@ paths:
11451
11541
  - partial
11452
11542
  - none
11453
11543
  default: none
11544
+ - name: charge
11545
+ in: query
11546
+ description: Applicable only if the subscription has usage based add-ons and
11547
+ unbilled usage logged for the current billing cycle. If true, current billing
11548
+ cycle unbilled usage is billed on the final invoice. If false, Recurly will
11549
+ create a negative usage record for current billing cycle usage that will
11550
+ zero out the final invoice line items.
11551
+ schema:
11552
+ default: true
11553
+ type: boolean
11454
11554
  responses:
11455
11555
  '200':
11456
11556
  description: An expired subscription.
@@ -16106,6 +16206,17 @@ components:
16106
16206
  - checking
16107
16207
  - savings
16108
16208
  description: The bank account type. (ACH only)
16209
+ tax_identifier:
16210
+ type: string
16211
+ description: Tax identifier is required if adding a billing info that is
16212
+ a consumer card in Brazil. This would be the customer's CPF, CPF is a
16213
+ Brazilian tax identifier for all tax paying residents.
16214
+ tax_identifier_type:
16215
+ type: string
16216
+ enum:
16217
+ - cpf
16218
+ description: this field and a value of 'cpf' are required if adding a billing
16219
+ info that is an elo or hipercard type in Brazil.
16109
16220
  primary_payment_method:
16110
16221
  type: boolean
16111
16222
  title: Primary Payment Method
@@ -18620,13 +18731,13 @@ components:
18620
18731
  the setup fee will be charged at the time of signup. Setup fees do not
18621
18732
  increase with the quantity of a subscription plan.
18622
18733
  minimum: 0
18623
- maximum: 100000
18734
+ maximum: 1000000
18624
18735
  unit_amount:
18625
18736
  type: number
18626
18737
  format: float
18627
18738
  title: Unit price
18628
18739
  minimum: 0
18629
- maximum: 100000
18740
+ maximum: 1000000
18630
18741
  PlanUpdate:
18631
18742
  type: object
18632
18743
  properties:
@@ -18759,11 +18870,6 @@ components:
18759
18870
  type: object
18760
18871
  title: Hosted pages settings
18761
18872
  "$ref": "#/components/schemas/PlanHostedPages"
18762
- add_ons:
18763
- type: array
18764
- title: Add Ons
18765
- items:
18766
- "$ref": "#/components/schemas/AddOnCreate"
18767
18873
  allow_any_item_on_subscriptions:
18768
18874
  type: boolean
18769
18875
  title: Allow any item on subscriptions
@@ -18784,7 +18890,7 @@ components:
18784
18890
  format: float
18785
18891
  title: Unit price
18786
18892
  minimum: 0
18787
- maximum: 100000
18893
+ maximum: 1000000
18788
18894
  required:
18789
18895
  - currency
18790
18896
  - unit_amount
@@ -18801,7 +18907,7 @@ components:
18801
18907
  format: float
18802
18908
  title: Unit price
18803
18909
  minimum: 0
18804
- maximum: 100000
18910
+ maximum: 1000000
18805
18911
  required:
18806
18912
  - currency
18807
18913
  - unit_amount
@@ -19310,6 +19416,8 @@ components:
19310
19416
  coupon_redemptions:
19311
19417
  type: array
19312
19418
  title: Coupon redemptions
19419
+ description: Returns subscription level coupon redemptions that are tied
19420
+ to this subscription.
19313
19421
  items:
19314
19422
  "$ref": "#/components/schemas/CouponRedemptionMini"
19315
19423
  pending_change:
@@ -19598,6 +19706,7 @@ components:
19598
19706
  * Optionally, override the add-on's default unit amount.
19599
19707
  * If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` must be absent.
19600
19708
  minimum: 0
19709
+ maximum: 1000000
19601
19710
  tiers:
19602
19711
  type: array
19603
19712
  title: Tiers
@@ -19671,6 +19780,7 @@ components:
19671
19780
  title: Unit amount
19672
19781
  description: Optionally, override the add-on's default unit amount.
19673
19782
  minimum: 0
19783
+ maximum: 1000000
19674
19784
  tiers:
19675
19785
  type: array
19676
19786
  title: Tiers
@@ -19711,6 +19821,7 @@ components:
19711
19821
  format: float
19712
19822
  title: Unit amount
19713
19823
  minimum: 0
19824
+ maximum: 1000000
19714
19825
  SubscriptionCancel:
19715
19826
  type: object
19716
19827
  properties:
@@ -19843,7 +19954,7 @@ components:
19843
19954
  the plan's default unit amount. The subscription's current currency will
19844
19955
  be used.
19845
19956
  minimum: 0
19846
- maximum: 100000
19957
+ maximum: 1000000
19847
19958
  quantity:
19848
19959
  type: integer
19849
19960
  title: Quantity
@@ -19993,7 +20104,7 @@ components:
19993
20104
  this value. If not provided, the subscription will inherit the price from
19994
20105
  the subscription plan for the provided currency.
19995
20106
  minimum: 0
19996
- maximum: 100000
20107
+ maximum: 1000000
19997
20108
  quantity:
19998
20109
  type: integer
19999
20110
  title: Quantity
@@ -20127,7 +20238,7 @@ components:
20127
20238
  this value in cents. If not provided, the subscription will inherit the
20128
20239
  price from the subscription plan for the provided currency.
20129
20240
  minimum: 0
20130
- maximum: 100000
20241
+ maximum: 1000000
20131
20242
  quantity:
20132
20243
  type: integer
20133
20244
  title: Quantity
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.0
4
+ version: 3.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -293,7 +293,7 @@ metadata:
293
293
  changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
294
294
  documentation_uri: https://recurly.github.io/recurly-client-ruby/
295
295
  homepage_uri: https://github.com/recurly/recurly-client-ruby
296
- source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/3.15.0
296
+ source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/3.16.0
297
297
  post_install_message:
298
298
  rdoc_options: []
299
299
  require_paths: