recurly 3.23.0 → 3.24.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: 88fb21ff9bb9df689fe849ead892c462a7641966f9523d805e99f7de40e6633d
4
- data.tar.gz: f68162f74081ecaa0a6248315518e41799fb64bce245837854d6bea2244a6502
3
+ metadata.gz: ed0b8401ee5879270989110b1b826589fe628d1befb4209b2f995bc8c2d55124
4
+ data.tar.gz: 62d1aba9f1e248b0ba1c9eeb790cdfd2d935d49e743d2f9cfa8ccaf6d33cb5e7
5
5
  SHA512:
6
- metadata.gz: 147ad743a5a25edebbe89cf7e71cb5125a1523cbf2de343be31d561c741ddc4a6043fc6c5008d52bf368992c009a6c59d232a0b54fbcbe6244fa0e61741ec9b3
7
- data.tar.gz: 8bcff488cb7ccbdaefdb02fbff141057fe4a3c71fa2f36fe58b9eef99ab558a4a350ad618e51ad8edc244aa0fbc719dfc35427df2ed354ee6f711093916831dc
6
+ metadata.gz: 650e5852f33c74e4407668d517f0b2f8c429a358782ac8c7f804378528f88e4b903cd173020666f0a7aeb794143d1e01693e15ae1eaa838bf3d7febef4ccd28a
7
+ data.tar.gz: 545373440597d3477a1eaf2210ae5963ff7a8784524d3332a126550f059917f8d3516becf4a2793be90a048666edb1437f3038f40aca4d6093938f7b26a431c2
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.23.0
2
+ current_version = 3.24.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.24.0](https://github.com/recurly/recurly-client-ruby/tree/3.24.0) (2023-01-11)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.23.0...3.24.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2019-10-10 (Account Preferred Time Zone) [#815](https://github.com/recurly/recurly-client-ruby/pull/815) ([recurly-integrations](https://github.com/recurly-integrations))
11
+
12
+
13
+
3
14
  ## [3.23.0](https://github.com/recurly/recurly-client-ruby/tree/3.23.0) (2022-11-17)
4
15
 
5
16
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.22.0...3.23.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', '~> 3.23'
8
+ gem 'recurly', '~> 3.24'
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.
@@ -2068,6 +2068,15 @@ module Recurly
2068
2068
  # @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+.
2069
2069
  #
2070
2070
  # @return [Resources::Invoice] The updated invoice.
2071
+ # @example
2072
+ # begin
2073
+ # invoice = @client.apply_credit_balance(invoice_id: invoice_id)
2074
+ # puts "Applied credit balance to invoice #{invoice}"
2075
+ # rescue Recurly::Errors::NotFoundError
2076
+ # # If the resource was not found, you may want to alert the user or
2077
+ # # just return nil
2078
+ # puts "Resource Not Found"
2079
+ # end
2071
2080
  #
2072
2081
  def apply_credit_balance(invoice_id:, **options)
2073
2082
  path = interpolate_path("/invoices/{invoice_id}/apply_credit_balance", invoice_id: invoice_id)
@@ -70,6 +70,10 @@ module Recurly
70
70
  # @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.
71
71
  define_attribute :preferred_locale, String
72
72
 
73
+ # @!attribute preferred_time_zone
74
+ # @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)
75
+ define_attribute :preferred_time_zone, String
76
+
73
77
  # @!attribute shipping_addresses
74
78
  # @return [Array[ShippingAddressCreate]]
75
79
  define_attribute :shipping_addresses, Array, { :item_type => :ShippingAddressCreate }
@@ -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 tax_exempt
78
82
  # @return [Boolean] The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
79
83
  define_attribute :tax_exempt, :Boolean
@@ -62,6 +62,10 @@ module Recurly
62
62
  # @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.
63
63
  define_attribute :preferred_locale, String
64
64
 
65
+ # @!attribute preferred_time_zone
66
+ # @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)
67
+ define_attribute :preferred_time_zone, String
68
+
65
69
  # @!attribute tax_exempt
66
70
  # @return [Boolean] The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
67
71
  define_attribute :tax_exempt, :Boolean
@@ -106,6 +106,10 @@ module Recurly
106
106
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
107
107
  define_attribute :preferred_locale, String
108
108
 
109
+ # @!attribute preferred_time_zone
110
+ # @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.
111
+ define_attribute :preferred_time_zone, String
112
+
109
113
  # @!attribute shipping_addresses
110
114
  # @return [Array[ShippingAddress]] The shipping addresses on the account.
111
115
  define_attribute :shipping_addresses, Array, { :item_type => :ShippingAddress }
@@ -91,7 +91,7 @@ module Recurly
91
91
  define_attribute :po_number, String
92
92
 
93
93
  # @!attribute previous_invoice_id
94
- # @return [String] On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
94
+ # @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/v2019-10-10/index.html#operation/list_related_invoices) to see purchase invoices refunded by this invoice.
95
95
  define_attribute :previous_invoice_id, String
96
96
 
97
97
  # @!attribute refundable_amount
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "3.23.0"
2
+ VERSION = "3.24.0"
3
3
  end
data/openapi/api.yaml CHANGED
@@ -7881,6 +7881,8 @@ paths:
7881
7881
  summary: Apply available credit to a pending or past due charge invoice
7882
7882
  description: Apply credit payment to the outstanding balance on an existing
7883
7883
  charge invoice from an account’s available balance from existing credit invoices.
7884
+ Credit that was refunded from the invoice cannot be applied back to the invoice
7885
+ as payment.
7884
7886
  parameters:
7885
7887
  - "$ref": "#/components/parameters/site_id"
7886
7888
  - "$ref": "#/components/parameters/invoice_id"
@@ -7899,7 +7901,8 @@ paths:
7899
7901
  "$ref": "#/components/schemas/Error"
7900
7902
  '422':
7901
7903
  description: Tried applying credit to a legacy or closed invoice or there
7902
- was an error processing the credit payment.
7904
+ was an error processing the credit payment, such as no available credit
7905
+ on the account.
7903
7906
  content:
7904
7907
  application/json:
7905
7908
  schema:
@@ -7910,7 +7913,95 @@ paths:
7910
7913
  application/json:
7911
7914
  schema:
7912
7915
  "$ref": "#/components/schemas/Error"
7913
- x-code-samples: []
7916
+ x-code-samples:
7917
+ - lang: Node.js
7918
+ source: |
7919
+ try {
7920
+ const invoice = await client.applyCreditBalance(invoiceId)
7921
+ console.log('Applied credit balance to invoice: ', invoice)
7922
+ } catch (err) {
7923
+ if (err instanceof recurly.errors.ValidationError) {
7924
+ // If the request was not valid, you may want to tell your user
7925
+ // why. You can find the invalid params and reasons in err.params
7926
+ console.log('Failed validation', err.params)
7927
+ } else {
7928
+ // If we don't know what to do with the err, we should
7929
+ // probably re-raise and let our web framework and logger handle it
7930
+ console.log('Unknown Error: ', err)
7931
+ }
7932
+ }
7933
+ - lang: Python
7934
+ source: |
7935
+ try:
7936
+ invoice = client.apply_credit_balance(invoice_id)
7937
+ print("Applied credit balance to invoice %s" % invoice.id)
7938
+ except recurly.errors.NotFoundError:
7939
+ # If the resource was not found, you may want to alert the user or
7940
+ # just return nil
7941
+ print("Resource Not Found")
7942
+ - lang: ".NET"
7943
+ source: |
7944
+ try
7945
+ {
7946
+ Invoice invoice = client.ApplyCreditBalance(invoiceId);
7947
+ Console.WriteLine($"Applied credit balance to invoice #{invoice.Number}");
7948
+ }
7949
+ catch (Recurly.Errors.Validation ex)
7950
+ {
7951
+ // If the request was not valid, you may want to tell your user
7952
+ // why. You can find the invalid params and reasons in ex.Error.Params
7953
+ Console.WriteLine($"Failed validation: {ex.Error.Message}");
7954
+ }
7955
+ catch (Recurly.Errors.ApiError ex)
7956
+ {
7957
+ // Use ApiError to catch a generic error from the API
7958
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
7959
+ }
7960
+ - lang: Ruby
7961
+ source: |
7962
+ begin
7963
+ invoice = @client.apply_credit_balance(invoice_id: invoice_id)
7964
+ puts "Applied credit balance to invoice #{invoice}"
7965
+ rescue Recurly::Errors::NotFoundError
7966
+ # If the resource was not found, you may want to alert the user or
7967
+ # just return nil
7968
+ puts "Resource Not Found"
7969
+ end
7970
+ - lang: Java
7971
+ source: |
7972
+ try {
7973
+ final Invoice invoice = client.applyCreditBalance(invoiceId);
7974
+ System.out.println("Applied credit balance to invoice " + invoice.getId());
7975
+ } catch (final ValidationException e) {
7976
+ // If the request was not valid, you may want to tell your user
7977
+ // why. You can find the invalid params and reasons in e.getError().getParams()
7978
+ System.out.println("Failed validation: " + e.getError().getMessage());
7979
+ } catch (final ApiException e) {
7980
+ // Use ApiException to catch a generic error from the API
7981
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
7982
+ }
7983
+ - lang: PHP
7984
+ source: |
7985
+ try {
7986
+ $invoice = $client->applyCreditBalance($invoice_id);
7987
+
7988
+ echo 'Applied credit balance to invoice:' . PHP_EOL;
7989
+ var_dump($invoice);
7990
+ } catch (\Recurly\Errors\Validation $e) {
7991
+ // If the request was not valid, you may want to tell your user
7992
+ // why. You can find the invalid params and reasons in err.params
7993
+ var_dump($e);
7994
+ } catch (\Recurly\RecurlyError $e) {
7995
+ // If we don't know what to do with the err, we should
7996
+ // probably re-raise and let our web framework and logger handle it
7997
+ var_dump($e);
7998
+ }
7999
+ - lang: Go
8000
+ source: "invoice, err := client.ApplyCreditBalance(invoiceID)\nif e, ok :=
8001
+ err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
8002
+ validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
8003
+ Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Applied credit
8004
+ balance to invoice: %v\", invoice)"
7914
8005
  "/sites/{site_id}/invoices/{invoice_id}/collect":
7915
8006
  put:
7916
8007
  tags:
@@ -15480,6 +15571,11 @@ components:
15480
15571
  - sv-SE
15481
15572
  - tr-TR
15482
15573
  - zh-CN
15574
+ preferred_time_zone:
15575
+ type: string
15576
+ example: America/Los_Angeles
15577
+ description: Used to determine the time zone of emails sent on behalf of
15578
+ 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)
15483
15579
  cc_emails:
15484
15580
  type: string
15485
15581
  description: Additional email address that should receive account correspondence.
@@ -15612,6 +15708,12 @@ components:
15612
15708
  - sv-SE
15613
15709
  - tr-TR
15614
15710
  - zh-CN
15711
+ preferred_time_zone:
15712
+ type: string
15713
+ example: America/Los_Angeles
15714
+ description: The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
15715
+ used to determine the time zone of emails sent on behalf of the merchant
15716
+ to the customer.
15615
15717
  cc_emails:
15616
15718
  type: string
15617
15719
  description: Additional email address that should receive account correspondence.
@@ -17764,7 +17866,11 @@ components:
17764
17866
  type: string
17765
17867
  title: Previous invoice ID
17766
17868
  description: On refund invoices, this value will exist and show the invoice
17767
- ID of the purchase invoice the refund was created from.
17869
+ ID of the purchase invoice the refund was created from. This field is
17870
+ only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed)
17871
+ feature enabled. Sites with Only Bill What Changed enabled should use
17872
+ the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices)
17873
+ to see purchase invoices refunded by this invoice.
17768
17874
  maxLength: 13
17769
17875
  number:
17770
17876
  type: string
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.23.0
4
+ version: 3.24.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-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -306,7 +306,7 @@ metadata:
306
306
  changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
307
307
  documentation_uri: https://recurly.github.io/recurly-client-ruby/
308
308
  homepage_uri: https://github.com/recurly/recurly-client-ruby
309
- source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/3.23.0
309
+ source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/3.24.0
310
310
  post_install_message:
311
311
  rdoc_options: []
312
312
  require_paths: