recurly 4.26.0 → 4.28.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: 389eea1b74d78e485eb08e34495178d7a383a9ac748e7e7f9f94ff7361520603
4
- data.tar.gz: 22d328b1f98319385cde050be1199a3ec8d7b5f41ab833d7a9013ba87761ff72
3
+ metadata.gz: 16800abba256fceed49ee4141796878faa9b1d10c97752fd18e05ae6f7be3761
4
+ data.tar.gz: 8fcb048d891ab4ae3c6a401cdaf343d1889bd53337b976ca0d86616d53ae8706
5
5
  SHA512:
6
- metadata.gz: a76f723999341f4e174891b7b17033ffdf21c563cabdd8709d648de76f51bb7374a8293b3ac255d95b571f92a1a1e889a07e9cedea9626fe7e659fbc90b165c2
7
- data.tar.gz: 703c91e9c0f5ca8e76f04dd3bf74f81d2355d205dcd92d90a03d3f2bac48ff84ded8b09c63b55b885856f06d123814f83674142a532ec572f132bffaead3ab3e
6
+ metadata.gz: c108d83003c365f301e93d255078a067ff6ecf440ba1efc3d5e0de61d40be977b5de1f1668d4661c927aeb8d8650d4d49765f6be2c9206d4545fc0315a29becf
7
+ data.tar.gz: d1fc3157a45ac11d9e790d2510e7de1496a5549f1dd827b973ea69a056329b8a3b01b725c7b956a3ecbba896c03415316f29b94710408676a404e9ded6e5641a
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 4.26.0
2
+ current_version = 4.28.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.28.0](https://github.com/recurly/recurly-client-ruby/tree/4.28.0) (2023-01-19)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.27.0...4.28.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2021-02-25 (Custom Fields on Line Items) [#821](https://github.com/recurly/recurly-client-ruby/pull/821) ([recurly-integrations](https://github.com/recurly-integrations))
11
+
12
+
13
+
14
+ ## [4.27.0](https://github.com/recurly/recurly-client-ruby/tree/4.27.0) (2023-01-11)
15
+
16
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.26.0...4.27.0)
17
+
18
+
19
+ **Merged Pull Requests**
20
+
21
+ - Generated Latest Changes for v2021-02-25 (Account Preferred Time Zone) [#816](https://github.com/recurly/recurly-client-ruby/pull/816) ([douglasmiller](https://github.com/douglasmiller))
22
+
23
+
24
+
3
25
  ## [4.26.0](https://github.com/recurly/recurly-client-ruby/tree/4.26.0) (2022-11-17)
4
26
 
5
27
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.25.0...4.26.0)
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', '~> 4.26'
8
+ gem 'recurly', '~> 4.28'
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.
@@ -135,6 +135,7 @@ module Recurly
135
135
  # code: account_code,
136
136
  # first_name: "Benjamin",
137
137
  # last_name: "Du Monde",
138
+ # preferred_time_zone: "America/Chicago",
138
139
  # acquisition: {
139
140
  # campaign: "podcast-marketing",
140
141
  # channel: "social_media",
@@ -2245,6 +2246,15 @@ module Recurly
2245
2246
  # :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+.
2246
2247
  #
2247
2248
  # @return [Resources::Invoice] The updated invoice.
2249
+ # @example
2250
+ # begin
2251
+ # invoice = @client.apply_credit_balance(invoice_id: invoice_id)
2252
+ # puts "Applied credit balance to invoice #{invoice}"
2253
+ # rescue Recurly::Errors::NotFoundError
2254
+ # # If the resource was not found, you may want to alert the user or
2255
+ # # just return nil
2256
+ # puts "Resource Not Found"
2257
+ # end
2248
2258
  #
2249
2259
  def apply_credit_balance(invoice_id:, **options)
2250
2260
  path = interpolate_path("/invoices/{invoice_id}/apply_credit_balance", invoice_id: invoice_id)
@@ -74,6 +74,10 @@ module Recurly
74
74
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
75
75
  define_attribute :preferred_locale, String
76
76
 
77
+ # @!attribute preferred_time_zone
78
+ # @return [String] Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
79
+ define_attribute :preferred_time_zone, String
80
+
77
81
  # @!attribute shipping_addresses
78
82
  # @return [Array[ShippingAddressCreate]]
79
83
  define_attribute :shipping_addresses, Array, { :item_type => :ShippingAddressCreate }
@@ -78,6 +78,10 @@ module Recurly
78
78
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
79
79
  define_attribute :preferred_locale, String
80
80
 
81
+ # @!attribute preferred_time_zone
82
+ # @return [String] Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
83
+ define_attribute :preferred_time_zone, String
84
+
81
85
  # @!attribute tax_exempt
82
86
  # @return [Boolean] The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
83
87
  define_attribute :tax_exempt, :Boolean
@@ -66,6 +66,10 @@ module Recurly
66
66
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
67
67
  define_attribute :preferred_locale, String
68
68
 
69
+ # @!attribute preferred_time_zone
70
+ # @return [String] Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
71
+ define_attribute :preferred_time_zone, String
72
+
69
73
  # @!attribute tax_exempt
70
74
  # @return [Boolean] The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
71
75
  define_attribute :tax_exempt, :Boolean
@@ -63,7 +63,7 @@ module Recurly
63
63
  define_attribute :optional, :Boolean
64
64
 
65
65
  # @!attribute percentage_tiers
66
- # @return [Array[PercentageTiersByCurrency]] Array of objects which must have at least one set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier.
66
+ # @return [Array[PercentageTiersByCurrency]] Array of objects which must have at least one set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
67
67
  define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
68
68
 
69
69
  # @!attribute plan_id
@@ -55,7 +55,7 @@ module Recurly
55
55
  define_attribute :optional, :Boolean
56
56
 
57
57
  # @!attribute percentage_tiers
58
- # @return [Array[PercentageTiersByCurrency]] `percentage_tiers` is an array of objects, which must have the set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier.
58
+ # @return [Array[PercentageTiersByCurrency]] `percentage_tiers` is an array of objects, which must have the set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
59
59
  define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
60
60
 
61
61
  # @!attribute revenue_schedule_type
@@ -26,6 +26,10 @@ module Recurly
26
26
  # @return [String] 3-letter ISO 4217 currency code. If `item_code`/`item_id` is part of the request then `currency` is optional, if the site has a single default currency. `currency` is required if `item_code`/`item_id` is present, and there are multiple currencies defined on the site. If `item_code`/`item_id` is not present `currency` is required.
27
27
  define_attribute :currency, String
28
28
 
29
+ # @!attribute custom_fields
30
+ # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
31
+ define_attribute :custom_fields, Array, { :item_type => :CustomField }
32
+
29
33
  # @!attribute description
30
34
  # @return [String] Description that appears on the invoice. If `item_code`/`item_id` is part of the request then `description` must be absent.
31
35
  define_attribute :description, String
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :code, String
16
16
 
17
17
  # @!attribute percentage_tiers
18
- # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value which represents the final tier. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
18
+ # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value which represents the final tier. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. This feature is currently in development and requires approval and enablement, please contact support.
19
19
  define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
20
20
 
21
21
  # @!attribute quantity
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :id, String
20
20
 
21
21
  # @!attribute percentage_tiers
22
- # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier.
22
+ # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
23
23
  define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
24
24
 
25
25
  # @!attribute quantity
@@ -110,6 +110,10 @@ module Recurly
110
110
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
111
111
  define_attribute :preferred_locale, String
112
112
 
113
+ # @!attribute preferred_time_zone
114
+ # @return [String] The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer.
115
+ define_attribute :preferred_time_zone, String
116
+
113
117
  # @!attribute shipping_addresses
114
118
  # @return [Array[ShippingAddress]] The shipping addresses on the account.
115
119
  define_attribute :shipping_addresses, Array, { :item_type => :ShippingAddress }
@@ -75,7 +75,7 @@ module Recurly
75
75
  define_attribute :optional, :Boolean
76
76
 
77
77
  # @!attribute percentage_tiers
78
- # @return [Array[PercentageTiersByCurrency]] Percentage Tiers
78
+ # @return [Array[PercentageTiersByCurrency]] This feature is currently in development and requires approval and enablement, please contact support.
79
79
  define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
80
80
 
81
81
  # @!attribute plan_id
@@ -103,7 +103,7 @@ module Recurly
103
103
  define_attribute :po_number, String
104
104
 
105
105
  # @!attribute previous_invoice_id
106
- # @return [String] On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
106
+ # @return [String] On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed) feature enabled. Sites with Only Bill What Changed enabled should use the [related_invoices endpoint](https://recurly.com/developers/api/v2021-02-25/index.html#operation/list_related_invoices) to see purchase invoices refunded by this invoice.
107
107
  define_attribute :previous_invoice_id, String
108
108
 
109
109
  # @!attribute refundable_amount
@@ -54,6 +54,10 @@ module Recurly
54
54
  # @return [String] 3-letter ISO 4217 currency code.
55
55
  define_attribute :currency, String
56
56
 
57
+ # @!attribute custom_fields
58
+ # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
59
+ define_attribute :custom_fields, Array, { :item_type => :CustomField }
60
+
57
61
  # @!attribute description
58
62
  # @return [String] Description that appears on the invoice. For subscription related items this will be filled in automatically.
59
63
  define_attribute :description, String
@@ -31,7 +31,7 @@ module Recurly
31
31
  define_attribute :object, String
32
32
 
33
33
  # @!attribute percentage_tiers
34
- # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier.
34
+ # @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
35
35
  define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
36
36
 
37
37
  # @!attribute quantity
@@ -35,7 +35,7 @@ module Recurly
35
35
  define_attribute :object, String
36
36
 
37
37
  # @!attribute percentage_tiers
38
- # @return [Array[SubscriptionAddOnPercentageTier]] The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []
38
+ # @return [Array[SubscriptionAddOnPercentageTier]] The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []. This feature is currently in development and requires approval and enablement, please contact support.
39
39
  define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
40
40
 
41
41
  # @!attribute recording_timestamp
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "4.26.0"
2
+ VERSION = "4.28.0"
3
3
  end
data/openapi/api.yaml CHANGED
@@ -343,13 +343,13 @@ tags:
343
343
  - name: external_subscriptions
344
344
  x-displayName: External Subscription
345
345
  description: A subscription from an external resource that is not managed by the
346
- Recurly platform and instead is managed by third-party platforms like Apple Store
347
- and Google Play.
346
+ Recurly platform and instead is managed by third-party platforms like Apple App
347
+ Store and Google Play Store.
348
348
  - name: external_products
349
349
  x-displayName: External Product
350
350
  description: A product from an external resource that is not managed by the Recurly
351
- platform and instead is managed by third-party platforms like Apple Store and
352
- Google Play.
351
+ platform and instead is managed by third-party platforms like Apple App Store
352
+ and Google Play Store.
353
353
  paths:
354
354
  "/sites":
355
355
  get:
@@ -722,6 +722,7 @@ paths:
722
722
  code: accountCode,
723
723
  firstName: 'Benjamin',
724
724
  lastName: 'Du Monde',
725
+ preferredTimeZone: 'America/Chicago',
725
726
  address: {
726
727
  street1: '900 Camp St',
727
728
  city: 'New Orleans',
@@ -750,6 +751,7 @@ paths:
750
751
  "code": account_code,
751
752
  "first_name": "Benjamin",
752
753
  "last_name": "Du Monde",
754
+ "preferred_time_zone": "America/Chicago",
753
755
  "acquisition": {
754
756
  "campaign": "podcast-marketing",
755
757
  "channel": "social_media",
@@ -785,6 +787,7 @@ paths:
785
787
  Code = accountCode,
786
788
  FirstName = "Benjamin",
787
789
  LastName = "Du Monde",
790
+ PreferredTimeZone = "America/Chicago",
788
791
  Address = new Address()
789
792
  {
790
793
  City = "New Orleans",
@@ -815,6 +818,7 @@ paths:
815
818
  code: account_code,
816
819
  first_name: "Benjamin",
817
820
  last_name: "Du Monde",
821
+ preferred_time_zone: "America/Chicago",
818
822
  acquisition: {
819
823
  campaign: "podcast-marketing",
820
824
  channel: "social_media",
@@ -853,6 +857,7 @@ paths:
853
857
  accountReq.setCode(accountCode);
854
858
  accountReq.setFirstName("Aaron");
855
859
  accountReq.setLastName("Du Monde");
860
+ accountReq.setPreferredTimeZone("America/Chicago");
856
861
 
857
862
  address.setStreet1("900 Camp St.");
858
863
  address.setCity("New Orleans");
@@ -879,6 +884,7 @@ paths:
879
884
  "code" => $account_code,
880
885
  "first_name" => "Douglas",
881
886
  "last_name" => "DuMonde",
887
+ "preferred_time_zone" => "America/Chicago",
882
888
  "shipping_addresses" => [
883
889
  [
884
890
  "first_name" => "Douglas",
@@ -908,17 +914,17 @@ paths:
908
914
  - lang: Go
909
915
  source: "accountReq := &recurly.AccountCreate{\n\tCode: &accountCode,\n\tFirstName:
910
916
  recurly.String(\"Isaac\"),\n\tLastName: recurly.String(\"Du Monde\"),\n\tEmail:
911
- \ recurly.String(\"isaac@example.com\"),\n\tBillingInfo: &recurly.BillingInfoCreate{\n\t\tFirstName:
912
- recurly.String(\"Isaac\"),\n\t\tLastName: recurly.String(\"Du Monde\"),\n\t\tAddress:
913
- &recurly.AddressCreate{\n\t\t\tPhone: recurly.String(\"415-555-5555\"),\n\t\t\tStreet1:
914
- \ recurly.String(\"400 Alabama St.\"),\n\t\t\tCity: recurly.String(\"San
915
- Francisco\"),\n\t\t\tPostalCode: recurly.String(\"94110\"),\n\t\t\tCountry:
916
- \ recurly.String(\"US\"),\n\t\t\tRegion: recurly.String(\"CA\"),\n\t\t},\n\t\tNumber:
917
- recurly.String(\"4111111111111111\"),\n\t\tMonth: recurly.String(\"12\"),\n\t\tYear:
918
- \ recurly.String(\"22\"),\n\t\tCvv: recurly.String(\"123\"),\n\t},\n}\n\naccount,
919
- err := client.CreateAccount(accountReq)\nif e, ok := err.(*recurly.Error);
920
- ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
921
- validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
917
+ \ recurly.String(\"isaac@example.com\"),\n\tPreferredTimeZone: recurly.String(\"America/Los_Angeles\"),\n\tBillingInfo:
918
+ &recurly.BillingInfoCreate{\n\t\tFirstName: recurly.String(\"Isaac\"),\n\t\tLastName:
919
+ \ recurly.String(\"Du Monde\"),\n\t\tAddress: &recurly.AddressCreate{\n\t\t\tPhone:
920
+ \ recurly.String(\"415-555-5555\"),\n\t\t\tStreet1: recurly.String(\"400
921
+ Alabama St.\"),\n\t\t\tCity: recurly.String(\"San Francisco\"),\n\t\t\tPostalCode:
922
+ recurly.String(\"94110\"),\n\t\t\tCountry: recurly.String(\"US\"),\n\t\t\tRegion:
923
+ \ recurly.String(\"CA\"),\n\t\t},\n\t\tNumber: recurly.String(\"4111111111111111\"),\n\t\tMonth:
924
+ \ recurly.String(\"12\"),\n\t\tYear: recurly.String(\"22\"),\n\t\tCvv:
925
+ \ recurly.String(\"123\"),\n\t},\n}\n\naccount, err := client.CreateAccount(accountReq)\nif
926
+ e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation
927
+ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
922
928
  Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Account:
923
929
  %s\", account.Id)"
924
930
  "/accounts/{account_id}":
@@ -8092,6 +8098,8 @@ paths:
8092
8098
  summary: Apply available credit to a pending or past due charge invoice
8093
8099
  description: Apply credit payment to the outstanding balance on an existing
8094
8100
  charge invoice from an account’s available balance from existing credit invoices.
8101
+ Credit that was refunded from the invoice cannot be applied back to the invoice
8102
+ as payment.
8095
8103
  parameters:
8096
8104
  - "$ref": "#/components/parameters/site_id"
8097
8105
  - "$ref": "#/components/parameters/invoice_id"
@@ -8110,7 +8118,8 @@ paths:
8110
8118
  "$ref": "#/components/schemas/Error"
8111
8119
  '422':
8112
8120
  description: Tried applying credit to a legacy or closed invoice or there
8113
- was an error processing the credit payment.
8121
+ was an error processing the credit payment, such as no available credit
8122
+ on the account.
8114
8123
  content:
8115
8124
  application/json:
8116
8125
  schema:
@@ -8121,7 +8130,95 @@ paths:
8121
8130
  application/json:
8122
8131
  schema:
8123
8132
  "$ref": "#/components/schemas/Error"
8124
- x-code-samples: []
8133
+ x-code-samples:
8134
+ - lang: Node.js
8135
+ source: |
8136
+ try {
8137
+ const invoice = await client.applyCreditBalance(invoiceId)
8138
+ console.log('Applied credit balance to invoice: ', invoice)
8139
+ } catch (err) {
8140
+ if (err instanceof recurly.errors.ValidationError) {
8141
+ // If the request was not valid, you may want to tell your user
8142
+ // why. You can find the invalid params and reasons in err.params
8143
+ console.log('Failed validation', err.params)
8144
+ } else {
8145
+ // If we don't know what to do with the err, we should
8146
+ // probably re-raise and let our web framework and logger handle it
8147
+ console.log('Unknown Error: ', err)
8148
+ }
8149
+ }
8150
+ - lang: Python
8151
+ source: |
8152
+ try:
8153
+ invoice = client.apply_credit_balance(invoice_id)
8154
+ print("Applied credit balance to invoice %s" % invoice.id)
8155
+ except recurly.errors.NotFoundError:
8156
+ # If the resource was not found, you may want to alert the user or
8157
+ # just return nil
8158
+ print("Resource Not Found")
8159
+ - lang: ".NET"
8160
+ source: |
8161
+ try
8162
+ {
8163
+ Invoice invoice = client.ApplyCreditBalance(invoiceId);
8164
+ Console.WriteLine($"Applied credit balance to invoice #{invoice.Number}");
8165
+ }
8166
+ catch (Recurly.Errors.Validation ex)
8167
+ {
8168
+ // If the request was not valid, you may want to tell your user
8169
+ // why. You can find the invalid params and reasons in ex.Error.Params
8170
+ Console.WriteLine($"Failed validation: {ex.Error.Message}");
8171
+ }
8172
+ catch (Recurly.Errors.ApiError ex)
8173
+ {
8174
+ // Use ApiError to catch a generic error from the API
8175
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
8176
+ }
8177
+ - lang: Ruby
8178
+ source: |
8179
+ begin
8180
+ invoice = @client.apply_credit_balance(invoice_id: invoice_id)
8181
+ puts "Applied credit balance to invoice #{invoice}"
8182
+ rescue Recurly::Errors::NotFoundError
8183
+ # If the resource was not found, you may want to alert the user or
8184
+ # just return nil
8185
+ puts "Resource Not Found"
8186
+ end
8187
+ - lang: Java
8188
+ source: |
8189
+ try {
8190
+ final Invoice invoice = client.applyCreditBalance(invoiceId);
8191
+ System.out.println("Applied credit balance to invoice " + invoice.getId());
8192
+ } catch (final ValidationException e) {
8193
+ // If the request was not valid, you may want to tell your user
8194
+ // why. You can find the invalid params and reasons in e.getError().getParams()
8195
+ System.out.println("Failed validation: " + e.getError().getMessage());
8196
+ } catch (final ApiException e) {
8197
+ // Use ApiException to catch a generic error from the API
8198
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
8199
+ }
8200
+ - lang: PHP
8201
+ source: |
8202
+ try {
8203
+ $invoice = $client->applyCreditBalance($invoice_id);
8204
+
8205
+ echo 'Applied credit balance to invoice:' . PHP_EOL;
8206
+ var_dump($invoice);
8207
+ } catch (\Recurly\Errors\Validation $e) {
8208
+ // If the request was not valid, you may want to tell your user
8209
+ // why. You can find the invalid params and reasons in err.params
8210
+ var_dump($e);
8211
+ } catch (\Recurly\RecurlyError $e) {
8212
+ // If we don't know what to do with the err, we should
8213
+ // probably re-raise and let our web framework and logger handle it
8214
+ var_dump($e);
8215
+ }
8216
+ - lang: Go
8217
+ source: "invoice, err := client.ApplyCreditBalance(invoiceID)\nif e, ok :=
8218
+ err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
8219
+ validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
8220
+ Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Applied credit
8221
+ balance to invoice: %v\", invoice)"
8125
8222
  "/invoices/{invoice_id}/collect":
8126
8223
  put:
8127
8224
  tags:
@@ -14597,6 +14694,8 @@ paths:
14597
14694
  The API request allows the inclusion of one of the following fields: **external_hpp_type** with `'adyen'` and **online_banking_payment_type** with `'ideal'` or `'sofort'` in the **billing_info** object.
14598
14695
 
14599
14696
  For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping
14697
+
14698
+ Note: an email address is required on the account for a Pending Purchase.
14600
14699
  requestBody:
14601
14700
  content:
14602
14701
  application/json:
@@ -16177,6 +16276,11 @@ components:
16177
16276
  behalf of the merchant to the customer. The list of locales is restricted
16178
16277
  to those the merchant has enabled on the site.
16179
16278
  "$ref": "#/components/schemas/PreferredLocaleEnum"
16279
+ preferred_time_zone:
16280
+ type: string
16281
+ example: America/Los_Angeles
16282
+ description: Used to determine the time zone of emails sent on behalf of
16283
+ the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
16180
16284
  cc_emails:
16181
16285
  type: string
16182
16286
  description: Additional email address that should receive account correspondence.
@@ -16279,6 +16383,12 @@ components:
16279
16383
  description: Used to determine the language and locale of emails sent on
16280
16384
  behalf of the merchant to the customer.
16281
16385
  "$ref": "#/components/schemas/PreferredLocaleEnum"
16386
+ preferred_time_zone:
16387
+ type: string
16388
+ example: America/Los_Angeles
16389
+ description: The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
16390
+ used to determine the time zone of emails sent on behalf of the merchant
16391
+ to the customer.
16282
16392
  cc_emails:
16283
16393
  type: string
16284
16394
  description: Additional email address that should receive account correspondence.
@@ -16684,6 +16794,8 @@ components:
16684
16794
  percentage_tiers:
16685
16795
  type: array
16686
16796
  title: Percentage Tiers
16797
+ description: This feature is currently in development and requires approval
16798
+ and enablement, please contact support.
16687
16799
  items:
16688
16800
  "$ref": "#/components/schemas/PercentageTiersByCurrency"
16689
16801
  external_sku:
@@ -16877,7 +16989,8 @@ components:
16877
16989
  Array of objects which must have at least one set of tiers
16878
16990
  per currency and the currency code. The tier_type must be `volume` or `tiered`,
16879
16991
  if not, it must be absent. There must be one tier without an `ending_amount` value
16880
- which represents the final tier.
16992
+ which represents the final tier. This feature is currently in development and
16993
+ requires approval and enablement, please contact support.
16881
16994
  required:
16882
16995
  - code
16883
16996
  - name
@@ -17018,7 +17131,8 @@ components:
17018
17131
  `percentage_tiers` is an array of objects, which must have the set of tiers
17019
17132
  per currency and the currency code. The tier_type must be `volume` or `tiered`,
17020
17133
  if not, it must be absent. There must be one tier without an `ending_amount` value
17021
- which represents the final tier.
17134
+ which represents the final tier. This feature is currently in development and
17135
+ requires approval and enablement, please contact support.
17022
17136
  BillingInfo:
17023
17137
  type: object
17024
17138
  properties:
@@ -18256,7 +18370,11 @@ components:
18256
18370
  type: string
18257
18371
  title: Previous invoice ID
18258
18372
  description: On refund invoices, this value will exist and show the invoice
18259
- ID of the purchase invoice the refund was created from.
18373
+ ID of the purchase invoice the refund was created from. This field is
18374
+ only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed)
18375
+ feature enabled. Sites with Only Bill What Changed enabled should use
18376
+ the [related_invoices endpoint](https://recurly.com/developers/api/v2021-02-25/index.html#operation/list_related_invoices)
18377
+ to see purchase invoices refunded by this invoice.
18260
18378
  maxLength: 13
18261
18379
  number:
18262
18380
  type: string
@@ -19023,6 +19141,8 @@ components:
19023
19141
  format: date-time
19024
19142
  title: End date
19025
19143
  description: If this date is provided, it indicates the end of a time range.
19144
+ custom_fields:
19145
+ "$ref": "#/components/schemas/CustomFields"
19026
19146
  created_at:
19027
19147
  type: string
19028
19148
  format: date-time
@@ -19189,6 +19309,8 @@ components:
19189
19309
  true. This origin creates a charge and opposite credit on the account
19190
19310
  to be used for future invoices.
19191
19311
  "$ref": "#/components/schemas/LineItemCreateOriginEnum"
19312
+ custom_fields:
19313
+ "$ref": "#/components/schemas/CustomFields"
19192
19314
  start_date:
19193
19315
  type: string
19194
19316
  format: date-time
@@ -20662,8 +20784,8 @@ components:
20662
20784
  description: |
20663
20785
  If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
20664
20786
  removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
20665
- add_on.usage_type is percentage.
20666
- There must be one tier without an `ending_amount` value which represents the final tier.
20787
+ add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the final tier.
20788
+ This feature is currently in development and requires approval and enablement, please contact support.
20667
20789
  usage_percentage:
20668
20790
  type: number
20669
20791
  format: float
@@ -20740,8 +20862,9 @@ components:
20740
20862
  minItems: 1
20741
20863
  description: |
20742
20864
  If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
20743
- removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value which represents the final tier.
20744
- Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
20865
+ removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value
20866
+ which represents the final tier. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is
20867
+ percentage. This feature is currently in development and requires approval and enablement, please contact support.
20745
20868
  usage_percentage:
20746
20869
  type: number
20747
20870
  format: float
@@ -20820,8 +20943,8 @@ components:
20820
20943
  description: |
20821
20944
  If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
20822
20945
  removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
20823
- add_on.usage_type is percentage.
20824
- There must be one tier without an `ending_amount` value which represents the final tier.
20946
+ add_on.usage_type is percentage. There must be one tier without an `ending_amount` value which represents the
20947
+ final tier. This feature is currently in development and requires approval and enablement, please contact support.
20825
20948
  usage_percentage:
20826
20949
  type: number
20827
20950
  format: float
@@ -22002,7 +22125,8 @@ components:
22002
22125
  items:
22003
22126
  "$ref": "#/components/schemas/SubscriptionAddOnPercentageTier"
22004
22127
  description: The percentage tiers of the subscription based on the usage_timestamp.
22005
- If tier_type = flat, percentage_tiers = []
22128
+ If tier_type = flat, percentage_tiers = []. This feature is currently
22129
+ in development and requires approval and enablement, please contact support.
22006
22130
  measured_unit_id:
22007
22131
  type: string
22008
22132
  description: The ID of the measured unit associated with the add-on the
@@ -22416,7 +22540,8 @@ components:
22416
22540
  description: Time the object was last updated
22417
22541
  ExternalProduct:
22418
22542
  type: object
22419
- description: Product from an external resource such as Apple App or Google Play.
22543
+ description: Product from an external resource such as Apple App Store or Google
22544
+ Play Store.
22420
22545
  properties:
22421
22546
  id:
22422
22547
  type: string
@@ -22496,8 +22621,8 @@ components:
22496
22621
  description: When the external product was updated in Recurly.
22497
22622
  ExternalSubscription:
22498
22623
  type: object
22499
- description: Subscription from an external resource such as Apple App or Google
22500
- Play.
22624
+ description: Subscription from an external resource such as Apple App Store
22625
+ or Google Play Store.
22501
22626
  properties:
22502
22627
  id:
22503
22628
  type: string
@@ -22786,6 +22911,7 @@ components:
22786
22911
  - item
22787
22912
  - plan
22788
22913
  - subscription
22914
+ - charge
22789
22915
  RefundTypeEnum:
22790
22916
  type: string
22791
22917
  enum:
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: 4.26.0
4
+ version: 4.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2023-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -326,7 +326,7 @@ metadata:
326
326
  changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
327
327
  documentation_uri: https://recurly.github.io/recurly-client-ruby/
328
328
  homepage_uri: https://github.com/recurly/recurly-client-ruby
329
- source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.26.0
329
+ source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.28.0
330
330
  post_install_message:
331
331
  rdoc_options: []
332
332
  require_paths: