recurly 4.9.0 → 4.10.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: 38f52125b8c12aad80f605fc94ea0587a73ea82823fb8aec6b2deae2f706983c
4
- data.tar.gz: f223a30e3a884cb319e020cb074aa00b88aeb0d44529ddab8539f5636dc38ce0
3
+ metadata.gz: d58a4d771c61445679b271441c64f1341a58f0c39d768b5abebe635be7fc1b7f
4
+ data.tar.gz: 238128901760f8f548091ee71778a17d8599db24f746a88deb8d55eb8d224de7
5
5
  SHA512:
6
- metadata.gz: 7ec68d64ac36472c09c7267b3439eb2b3d63e0d7c17ad8245068c0378395e1562d4de229b360c8aab6ac2995db1c4fa1804c230f4ec1831213bb51cf8bed6d36
7
- data.tar.gz: 922e7c9f74131d607115100ae592da8f6d50fa72760d66d90b6e15ec824a31e1d34c6202895f43d37a482bf493bbd5e06bad3fa184008b54bc42d637f2ef062f
6
+ metadata.gz: 699d6dadd3afa732926744cd611e11deb5e0d592edf497a31249e5af4d012f5c02adbe1cc3aed8f1066b9254098ae74e92b8910c977aa5dd41c223b7a8adfb98
7
+ data.tar.gz: 120cda82a9e8993f3f4325ac50a3204f6d211b664f7fac160794e92eec51ccef15ec433412d286cd91d6a79f253eff83eb701ae82702144e8facdf02e4338a59
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 4.9.0
2
+ current_version = 4.10.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
data/.travis.yml CHANGED
@@ -8,7 +8,9 @@ rvm:
8
8
  - 3.0
9
9
  bundler_args: --binstubs
10
10
  before_install:
11
+ - sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates
11
12
  - gem update --system
12
13
  - gem install bundler
14
+ dist: focal
13
15
  script:
14
- - ./scripts/test
16
+ - ./scripts/test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.10.0](https://github.com/recurly/recurly-client-ruby/tree/4.10.0) (2021-11-22)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.9.0...4.10.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2021-02-25 [#739](https://github.com/recurly/recurly-client-ruby/pull/739) ([recurly-integrations](https://github.com/recurly-integrations))
11
+ - Generated Latest Changes for v2021-02-25 [#736](https://github.com/recurly/recurly-client-ruby/pull/736) ([recurly-integrations](https://github.com/recurly-integrations))
12
+ - Allow API base url configuration [#735](https://github.com/recurly/recurly-client-ruby/pull/735) ([cbarton](https://github.com/cbarton))
13
+ - Generated Latest Changes for v2021-02-25 [#734](https://github.com/recurly/recurly-client-ruby/pull/734) ([recurly-integrations](https://github.com/recurly-integrations))
14
+ - Generated Latest Changes for v2021-02-25 [#728](https://github.com/recurly/recurly-client-ruby/pull/728) ([recurly-integrations](https://github.com/recurly-integrations))
15
+
16
+
17
+
3
18
  ## [4.9.0](https://github.com/recurly/recurly-client-ruby/tree/4.9.0) (2021-09-16)
4
19
 
5
20
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.8.0...4.9.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.9'
8
+ gem 'recurly', '~> 4.10'
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.
@@ -3,6 +3,7 @@ require "erb"
3
3
  require "net/https"
4
4
  require "base64"
5
5
  require "securerandom"
6
+ require "uri"
6
7
  require_relative "./schema/json_parser"
7
8
  require_relative "./schema/file_parser"
8
9
 
@@ -10,8 +11,7 @@ module Recurly
10
11
  class Client
11
12
  require_relative "./client/operations"
12
13
 
13
- BASE_HOST = "v3.recurly.com"
14
- BASE_PORT = 443
14
+ BASE_URL = "https://v3.recurly.com"
15
15
  CA_FILE = File.join(File.dirname(__FILE__), "../data/ca-certificates.crt")
16
16
  BINARY_TYPES = [
17
17
  "application/pdf",
@@ -52,12 +52,15 @@ module Recurly
52
52
  # client = Recurly::Client.new(api_key: API_KEY2)
53
53
  # sub = client.get_subscription(subscription_id: 'uuid-abcd7890')
54
54
  #
55
+ # @param base_url [String] The base URL for the API. Defaults to "https://v3.recurly.com"
56
+ # @param ca_file [String] The CA bundle to use when connecting to the API. Defaults to "data/ca-certificates.crt"
55
57
  # @param api_key [String] The private API key
56
58
  # @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
57
- def initialize(api_key:, logger: nil)
59
+ def initialize(base_url: BASE_URL, ca_file: CA_FILE, api_key:, logger: nil)
58
60
  raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
59
61
 
60
62
  set_api_key(api_key)
63
+ set_connection_options(base_url, ca_file)
61
64
 
62
65
  if logger.nil?
63
66
  @logger = Logger.new(STDOUT).tap do |l|
@@ -158,7 +161,7 @@ module Recurly
158
161
  end
159
162
 
160
163
  def run_request(request, options = {})
161
- self.class.connection_pool.with_connection do |http|
164
+ self.class.connection_pool.with_connection(uri: @base_uri, ca_file: @ca_file) do |http|
162
165
  set_http_options(http, options)
163
166
 
164
167
  retries = 0
@@ -338,6 +341,11 @@ module Recurly
338
341
  @api_key = api_key.to_s
339
342
  end
340
343
 
344
+ def set_connection_options(base_url, ca_file)
345
+ @base_uri = URI.parse(base_url)
346
+ @ca_file = ca_file
347
+ end
348
+
341
349
  def build_url(path, options)
342
350
  path = scope_by_site(path, options)
343
351
  query_params = map_array_params(options.fetch(:params, {}))
@@ -1,36 +1,38 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "net/https"
2
4
 
3
5
  module Recurly
4
6
  class ConnectionPool
5
7
  def initialize
6
8
  @mutex = Mutex.new
7
- @pool = []
9
+ @pool = Hash.new { |h, k| h[k] = [] }
8
10
  end
9
11
 
10
- def with_connection
12
+ def with_connection(uri:, ca_file: nil)
11
13
  http = nil
12
14
  @mutex.synchronize do
13
- http = @pool.pop
15
+ http = @pool[[uri.host, uri.port]].pop
14
16
  end
15
17
 
16
18
  # create connection if the pool was empty
17
- http ||= init_http_connection
19
+ http ||= init_http_connection(uri, ca_file)
18
20
 
19
21
  response = yield http
20
22
 
21
23
  if http.started?
22
24
  @mutex.synchronize do
23
- @pool.push(http)
25
+ @pool[[uri.host, uri.port]].push(http)
24
26
  end
25
27
  end
26
28
 
27
29
  response
28
30
  end
29
31
 
30
- def init_http_connection
31
- http = Net::HTTP.new(Client::BASE_HOST, Client::BASE_PORT)
32
- http.use_ssl = true
33
- http.ca_file = Client::CA_FILE
32
+ def init_http_connection(uri, ca_file)
33
+ http = Net::HTTP.new(uri.host, uri.port)
34
+ http.use_ssl = uri.scheme == "https"
35
+ http.ca_file = ca_file
34
36
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
35
37
  http.keep_alive_timeout = 600
36
38
 
@@ -6,6 +6,14 @@ module Recurly
6
6
  module Requests
7
7
  class BillingInfoCreate < Request
8
8
 
9
+ # @!attribute account_number
10
+ # @return [String] The bank account number. (ACH, Bacs only)
11
+ define_attribute :account_number, String
12
+
13
+ # @!attribute account_type
14
+ # @return [String] The bank account type. (ACH only)
15
+ define_attribute :account_type, String
16
+
9
17
  # @!attribute address
10
18
  # @return [Address]
11
19
  define_attribute :address, :Address
@@ -58,6 +66,10 @@ module Recurly
58
66
  # @return [String] Expiration month
59
67
  define_attribute :month, String
60
68
 
69
+ # @!attribute name_on_account
70
+ # @return [String] The name associated with the bank account (ACH, SEPA, Bacs only)
71
+ define_attribute :name_on_account, String
72
+
61
73
  # @!attribute number
62
74
  # @return [String] Credit card number, spaces and dashes are accepted.
63
75
  define_attribute :number, String
@@ -70,6 +82,14 @@ module Recurly
70
82
  # @return [Boolean] The `primary_payment_method` field is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` with a value of `true`. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
71
83
  define_attribute :primary_payment_method, :Boolean
72
84
 
85
+ # @!attribute routing_number
86
+ # @return [String] The bank's rounting number. (ACH only)
87
+ define_attribute :routing_number, String
88
+
89
+ # @!attribute sort_code
90
+ # @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
91
+ define_attribute :sort_code, String
92
+
73
93
  # @!attribute tax_identifier
74
94
  # @return [String] Tax identifier is required if adding a billing info that is a consumer card in Brazil or in Argentina. This would be the customer's CPF (Brazil) and CUIT (Argentina). CPF and CUIT are tax identifiers for all residents who pay taxes in Brazil and Argentina respectively.
75
95
  define_attribute :tax_identifier, String
@@ -90,6 +110,10 @@ module Recurly
90
110
  # @return [String] An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
91
111
  define_attribute :transaction_type, String
92
112
 
113
+ # @!attribute type
114
+ # @return [String] The payment method type for a non-credit card based billing info. The value of `bacs` is the only accepted value (Bacs only)
115
+ define_attribute :type, String
116
+
93
117
  # @!attribute vat_number
94
118
  # @return [String] VAT number
95
119
  define_attribute :vat_number, String
@@ -51,7 +51,7 @@ module Recurly
51
51
  define_attribute :revenue_schedule_type, String
52
52
 
53
53
  # @!attribute shipping
54
- # @return [SubscriptionChangeShippingCreate] The shipping address can currently only be changed immediately, using SubscriptionUpdate.
54
+ # @return [SubscriptionChangeShippingCreate] Shipping addresses are tied to a customer's account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription.
55
55
  define_attribute :shipping, :SubscriptionChangeShippingCreate
56
56
 
57
57
  # @!attribute timeframe
@@ -34,6 +34,10 @@ module Recurly
34
34
  # @return [Integer] Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
35
35
  define_attribute :avalara_transaction_type, Integer
36
36
 
37
+ # @!attribute bill_for_account_id
38
+ # @return [String] The UUID of the account responsible for originating the line item.
39
+ define_attribute :bill_for_account_id, String
40
+
37
41
  # @!attribute created_at
38
42
  # @return [DateTime] When the line item was created.
39
43
  define_attribute :created_at, DateTime
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "4.9.0"
2
+ VERSION = "4.10.0"
3
3
  end
data/openapi/api.yaml CHANGED
@@ -16345,6 +16345,28 @@ components:
16345
16345
  characters comprising a country code; two check digits; and a number that
16346
16346
  includes the domestic bank account number, branch identifier, and potential
16347
16347
  routing information
16348
+ name_on_account:
16349
+ type: string
16350
+ maxLength: 255
16351
+ description: The name associated with the bank account (ACH, SEPA, Bacs
16352
+ only)
16353
+ account_number:
16354
+ type: string
16355
+ maxLength: 255
16356
+ description: The bank account number. (ACH, Bacs only)
16357
+ routing_number:
16358
+ type: string
16359
+ maxLength: 15
16360
+ description: The bank's rounting number. (ACH only)
16361
+ sort_code:
16362
+ type: string
16363
+ maxLength: 15
16364
+ description: Bank identifier code for UK based banks. Required for Bacs
16365
+ based billing infos. (Bacs only)
16366
+ type:
16367
+ "$ref": "#/components/schemas/AchTypeEnum"
16368
+ account_type:
16369
+ "$ref": "#/components/schemas/AchAccountTypeEnum"
16348
16370
  tax_identifier:
16349
16371
  type: string
16350
16372
  description: Tax identifier is required if adding a billing info that is
@@ -17898,6 +17920,12 @@ components:
17898
17920
  "$ref": "#/components/schemas/LegacyCategoryEnum"
17899
17921
  account:
17900
17922
  "$ref": "#/components/schemas/AccountMini"
17923
+ bill_for_account_id:
17924
+ type: string
17925
+ title: Bill For Account ID
17926
+ maxLength: 13
17927
+ description: The UUID of the account responsible for originating the line
17928
+ item.
17901
17929
  subscription_id:
17902
17930
  type: string
17903
17931
  title: Subscription ID
@@ -19961,8 +19989,10 @@ components:
19961
19989
  SubscriptionChangeShippingCreate:
19962
19990
  type: object
19963
19991
  title: Shipping details that will be changed on a subscription
19964
- description: The shipping address can currently only be changed immediately,
19965
- using SubscriptionUpdate.
19992
+ description: Shipping addresses are tied to a customer's account. Each account
19993
+ can have up to 20 different shipping addresses, and if you have enabled multiple
19994
+ subscriptions per account, you can associate different shipping addresses
19995
+ to each subscription.
19966
19996
  properties:
19967
19997
  method_id:
19968
19998
  type: string
@@ -21378,20 +21408,26 @@ components:
21378
21408
  - en-AU
21379
21409
  - en-CA
21380
21410
  - en-GB
21411
+ - en-IE
21381
21412
  - en-NZ
21382
21413
  - en-US
21383
21414
  - es-ES
21384
21415
  - es-MX
21385
21416
  - es-US
21417
+ - fi-FI
21386
21418
  - fr-CA
21387
21419
  - fr-FR
21388
21420
  - hi-IN
21421
+ - it-IT
21389
21422
  - ja-JP
21423
+ - ko-KR
21390
21424
  - nl-BE
21391
21425
  - nl-NL
21392
21426
  - pt-BR
21393
21427
  - pt-PT
21428
+ - ro-RO
21394
21429
  - ru-RU
21430
+ - sk-SK
21395
21431
  - tr-TR
21396
21432
  - zh-CN
21397
21433
  BillToEnum:
@@ -21531,16 +21567,22 @@ components:
21531
21567
  OriginEnum:
21532
21568
  type: string
21533
21569
  enum:
21570
+ - carryforward_credit
21571
+ - carryforward_gift_credit
21534
21572
  - credit
21573
+ - external_refund
21535
21574
  - gift_card
21536
21575
  - immediate_change
21576
+ - import
21537
21577
  - line_item_refund
21538
21578
  - open_amount_refund
21579
+ - prepayment
21539
21580
  - purchase
21581
+ - refund
21540
21582
  - renewal
21541
21583
  - termination
21584
+ - usage_correction
21542
21585
  - write_off
21543
- - prepayment
21544
21586
  InvoiceStateEnum:
21545
21587
  type: string
21546
21588
  enum:
@@ -21777,6 +21819,7 @@ components:
21777
21819
  - roku
21778
21820
  - sepadirectdebit
21779
21821
  - wire_transfer
21822
+ - braintree_v_zero
21780
21823
  CardTypeEnum:
21781
21824
  type: string
21782
21825
  enum:
@@ -21852,6 +21895,7 @@ components:
21852
21895
  - ach_transactions_not_supported
21853
21896
  - ach_validation_exception
21854
21897
  - amazon_amount_exceeded
21898
+ - amazon_declined_review
21855
21899
  - amazon_invalid_authorization_status
21856
21900
  - amazon_invalid_close_attempt
21857
21901
  - amazon_invalid_create_order_reference
@@ -21868,13 +21912,17 @@ components:
21868
21912
  - batch_processing_error
21869
21913
  - billing_agreement_already_accepted
21870
21914
  - billing_agreement_not_accepted
21915
+ - billing_agreement_not_found
21916
+ - billing_agreement_replaced
21871
21917
  - call_issuer
21872
21918
  - call_issuer_update_cardholder_data
21919
+ - cancelled
21873
21920
  - cannot_refund_unsettled_transactions
21874
21921
  - card_not_activated
21875
21922
  - card_type_not_accepted
21876
21923
  - cardholder_requested_stop
21877
21924
  - contact_gateway
21925
+ - contract_not_found
21878
21926
  - currency_not_supported
21879
21927
  - customer_canceled_transaction
21880
21928
  - cvv_required
@@ -21886,9 +21934,12 @@ components:
21886
21934
  - declined_saveable
21887
21935
  - declined_security_code
21888
21936
  - deposit_referenced_chargeback
21937
+ - direct_debit_type_not_accepted
21889
21938
  - duplicate_transaction
21890
21939
  - exceeds_daily_limit
21940
+ - exceeds_max_amount
21891
21941
  - expired_card
21942
+ - finbot_disconnect
21892
21943
  - finbot_unavailable
21893
21944
  - fraud_address
21894
21945
  - fraud_address_recurly
@@ -21896,36 +21947,45 @@ components:
21896
21947
  - fraud_gateway
21897
21948
  - fraud_generic
21898
21949
  - fraud_ip_address
21950
+ - fraud_manual_decision
21899
21951
  - fraud_risk_check
21900
21952
  - fraud_security_code
21901
21953
  - fraud_stolen_card
21902
21954
  - fraud_too_many_attempts
21903
21955
  - fraud_velocity
21956
+ - gateway_account_setup_incomplete
21904
21957
  - gateway_error
21905
21958
  - gateway_rate_limited
21906
21959
  - gateway_timeout
21907
21960
  - gateway_token_not_found
21908
21961
  - gateway_unavailable
21962
+ - gateway_validation_exception
21909
21963
  - insufficient_funds
21910
21964
  - invalid_account_number
21911
21965
  - invalid_amount
21966
+ - invalid_billing_agreement_status
21912
21967
  - invalid_card_number
21913
21968
  - invalid_data
21914
21969
  - invalid_email
21915
- - invalid_gateway_configuration
21916
21970
  - invalid_gateway_access_token
21971
+ - invalid_gateway_configuration
21917
21972
  - invalid_issuer
21918
21973
  - invalid_login
21919
21974
  - invalid_merchant_type
21975
+ - invalid_name
21976
+ - invalid_payment_method
21977
+ - invalid_payment_method_hard
21920
21978
  - invalid_transaction
21921
21979
  - issuer_unavailable
21922
21980
  - merch_max_transaction_limit_exceeded
21981
+ - moneybot_disconnect
21923
21982
  - moneybot_unavailable
21924
21983
  - no_billing_information
21925
21984
  - no_gateway
21926
21985
  - no_gateway_found_for_transaction_amount
21927
21986
  - partial_approval
21928
21987
  - partial_credits_not_supported
21988
+ - payer_authentication_rejected
21929
21989
  - payment_cannot_void_authorization
21930
21990
  - payment_not_accepted
21931
21991
  - paypal_account_issue
@@ -21935,7 +21995,9 @@ components:
21935
21995
  - paypal_hard_decline
21936
21996
  - paypal_invalid_billing_agreement
21937
21997
  - paypal_primary_declined
21998
+ - processor_not_available
21938
21999
  - processor_unavailable
22000
+ - recurly_credentials_not_found
21939
22001
  - recurly_error
21940
22002
  - recurly_failed_to_get_token
21941
22003
  - recurly_token_mismatch
@@ -21943,10 +22005,18 @@ components:
21943
22005
  - reference_transactions_not_enabled
21944
22006
  - restricted_card
21945
22007
  - restricted_card_chargeback
22008
+ - rjs_token_expired
22009
+ - roku_invalid_card_number
22010
+ - roku_invalid_cib
22011
+ - roku_invalid_payment_method
22012
+ - roku_zip_code_mismatch
21946
22013
  - simultaneous
21947
22014
  - ssl_error
21948
22015
  - temporary_hold
22016
+ - three_d_secure_action_required
22017
+ - three_d_secure_action_result_token_mismatch
21949
22018
  - three_d_secure_authentication
22019
+ - three_d_secure_connection_error
21950
22020
  - three_d_secure_not_supported
21951
22021
  - too_many_attempts
21952
22022
  - total_credit_exceeds_capture
@@ -21958,10 +22028,13 @@ components:
21958
22028
  - transaction_cannot_be_voided
21959
22029
  - transaction_failed_to_settle
21960
22030
  - transaction_not_found
22031
+ - transaction_service_v2_disconnect
22032
+ - transaction_service_v2_unavailable
21961
22033
  - transaction_settled
21962
22034
  - transaction_stale_at_gateway
21963
22035
  - try_again
21964
22036
  - unknown
22037
+ - unmapped_partner_error
21965
22038
  - vaultly_service_unavailable
21966
22039
  - zero_dollar_auth_not_supported
21967
22040
  ExportDates:
@@ -22014,3 +22087,15 @@ components:
22014
22087
  - automatic
22015
22088
  - manual
22016
22089
  - trial
22090
+ AchTypeEnum:
22091
+ type: string
22092
+ description: The payment method type for a non-credit card based billing info.
22093
+ The value of `bacs` is the only accepted value (Bacs only)
22094
+ enum:
22095
+ - bacs
22096
+ AchAccountTypeEnum:
22097
+ type: string
22098
+ description: The bank account type. (ACH only)
22099
+ enum:
22100
+ - checking
22101
+ - savings
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.9.0
4
+ version: 4.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-16 00:00:00.000000000 Z
11
+ date: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -302,7 +302,7 @@ metadata:
302
302
  changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
303
303
  documentation_uri: https://recurly.github.io/recurly-client-ruby/
304
304
  homepage_uri: https://github.com/recurly/recurly-client-ruby
305
- source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.9.0
305
+ source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.10.0
306
306
  post_install_message:
307
307
  rdoc_options: []
308
308
  require_paths: