recurly 3.18.1 → 3.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/.changelog_config.yaml +11 -0
  4. data/.github/workflows/docs.yml +1 -1
  5. data/.travis.yml +2 -0
  6. data/CHANGELOG.md +231 -163
  7. data/GETTING_STARTED.md +1 -1
  8. data/lib/recurly/client/operations.rb +212 -134
  9. data/lib/recurly/client.rb +5 -3
  10. data/lib/recurly/errors/api_errors.rb +2 -0
  11. data/lib/recurly/pager.rb +1 -1
  12. data/lib/recurly/requests/account_create.rb +4 -0
  13. data/lib/recurly/requests/account_purchase.rb +4 -0
  14. data/lib/recurly/requests/account_update.rb +4 -0
  15. data/lib/recurly/requests/add_on_create.rb +3 -3
  16. data/lib/recurly/requests/add_on_pricing.rb +4 -0
  17. data/lib/recurly/requests/add_on_update.rb +1 -1
  18. data/lib/recurly/requests/address.rb +1 -1
  19. data/lib/recurly/requests/billing_info_create.rb +6 -2
  20. data/lib/recurly/requests/billing_info_verify.rb +14 -0
  21. data/lib/recurly/requests/dunning_campaigns_bulk_update.rb +18 -0
  22. data/lib/recurly/requests/invoice_address.rb +1 -1
  23. data/lib/recurly/requests/invoice_collect.rb +1 -1
  24. data/lib/recurly/requests/line_item_create.rb +6 -2
  25. data/lib/recurly/requests/plan_create.rb +4 -0
  26. data/lib/recurly/requests/plan_pricing.rb +4 -0
  27. data/lib/recurly/requests/plan_update.rb +4 -0
  28. data/lib/recurly/requests/pricing.rb +4 -0
  29. data/lib/recurly/requests/purchase_create.rb +1 -1
  30. data/lib/recurly/requests/shipping_address_create.rb +1 -1
  31. data/lib/recurly/requests/shipping_address_update.rb +1 -1
  32. data/lib/recurly/requests/subscription_change_billing_info_create.rb +14 -0
  33. data/lib/recurly/requests/subscription_change_create.rb +8 -0
  34. data/lib/recurly/requests/subscription_create.rb +6 -2
  35. data/lib/recurly/requests/subscription_pause.rb +1 -1
  36. data/lib/recurly/requests/subscription_purchase.rb +6 -2
  37. data/lib/recurly/requests/subscription_update.rb +5 -1
  38. data/lib/recurly/resources/account.rb +4 -0
  39. data/lib/recurly/resources/account_mini.rb +4 -0
  40. data/lib/recurly/resources/add_on_pricing.rb +4 -0
  41. data/lib/recurly/resources/address.rb +1 -1
  42. data/lib/recurly/resources/billing_info.rb +5 -1
  43. data/lib/recurly/resources/billing_info_updated_by.rb +1 -1
  44. data/lib/recurly/resources/dunning_campaign.rb +50 -0
  45. data/lib/recurly/resources/dunning_campaigns_bulk_update_response.rb +18 -0
  46. data/lib/recurly/resources/dunning_cycle.rb +58 -0
  47. data/lib/recurly/resources/dunning_interval.rb +18 -0
  48. data/lib/recurly/resources/invoice.rb +6 -2
  49. data/lib/recurly/resources/invoice_address.rb +1 -1
  50. data/lib/recurly/resources/line_item.rb +7 -3
  51. data/lib/recurly/resources/payment_method.rb +4 -0
  52. data/lib/recurly/resources/plan.rb +4 -0
  53. data/lib/recurly/resources/plan_pricing.rb +4 -0
  54. data/lib/recurly/resources/pricing.rb +4 -0
  55. data/lib/recurly/resources/shipping_address.rb +1 -1
  56. data/lib/recurly/resources/subscription.rb +4 -0
  57. data/lib/recurly/resources/subscription_change.rb +8 -0
  58. data/lib/recurly/resources/subscription_change_billing_info.rb +14 -0
  59. data/lib/recurly/resources/subscription_change_preview.rb +8 -0
  60. data/lib/recurly/resources/tax_detail.rb +26 -0
  61. data/lib/recurly/resources/tax_info.rb +4 -0
  62. data/lib/recurly/resources/transaction.rb +5 -1
  63. data/lib/recurly/version.rb +1 -1
  64. data/openapi/api.yaml +796 -122
  65. data/scripts/build +2 -2
  66. data/scripts/format +2 -2
  67. data/scripts/prepare-release +43 -29
  68. data/scripts/release +5 -20
  69. metadata +16 -9
  70. data/.github_changelog_generator +0 -8
  71. data/scripts/bump +0 -11
  72. data/scripts/changelog +0 -14
@@ -103,12 +103,14 @@ module Recurly
103
103
  handle_response! request, http_response
104
104
  end
105
105
 
106
- def post(path, request_data, request_class, **options)
107
- request_class.new(request_data).validate!
106
+ def post(path, request_data = nil, request_class = nil, **options)
108
107
  request = Net::HTTP::Post.new build_url(path, options)
109
108
  request.set_content_type(JSON_CONTENT_TYPE)
110
109
  set_headers(request, options[:headers])
111
- request.body = JSON.dump(request_data)
110
+ if request_data
111
+ request_class.new(request_data).validate!
112
+ request.body = JSON.dump(request_data)
113
+ end
112
114
  http_response = run_request(request, options)
113
115
  handle_response! request, http_response
114
116
  end
@@ -28,6 +28,8 @@ module Recurly
28
28
 
29
29
  class ServiceNotAvailableError < InternalServerError; end
30
30
 
31
+ class TaxServiceError < InternalServerError; end
32
+
31
33
  class BadGatewayError < ServerError; end
32
34
 
33
35
  class ServiceUnavailableError < ServerError; end
data/lib/recurly/pager.rb CHANGED
@@ -24,7 +24,7 @@ module Recurly
24
24
 
25
25
  # Makes a HEAD request to the API to determine how many total records exist.
26
26
  def count
27
- resource = @client.send(:head, self.next, @options)
27
+ resource = @client.send(:head, self.next, **@options)
28
28
  resource.get_response.total_records
29
29
  end
30
30
 
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @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.
39
39
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute email
42
46
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
43
47
  define_attribute :email, String
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @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.
39
39
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute email
42
46
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
43
47
  define_attribute :email, String
@@ -30,6 +30,10 @@ module Recurly
30
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
31
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
32
32
 
33
+ # @!attribute dunning_campaign_id
34
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
35
+ define_attribute :dunning_campaign_id, String
36
+
33
37
  # @!attribute email
34
38
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
35
39
  define_attribute :email, String
@@ -27,7 +27,7 @@ module Recurly
27
27
  define_attribute :code, String
28
28
 
29
29
  # @!attribute currencies
30
- # @return [Array[AddOnPricing]] * If `item_code`/`item_id` is part of the request and the item has a default currency then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent.
30
+ # @return [Array[AddOnPricing]] * If `item_code`/`item_id` is part of the request and the item has a default currency then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
31
31
  define_attribute :currencies, Array, { :item_type => :AddOnPricing }
32
32
 
33
33
  # @!attribute default_quantity
@@ -39,11 +39,11 @@ module Recurly
39
39
  define_attribute :display_quantity, :Boolean
40
40
 
41
41
  # @!attribute item_code
42
- # @return [String] Unique code to identify an item. Avaliable when the `Credit Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
42
+ # @return [String] Unique code to identify an item. Avaliable when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
43
43
  define_attribute :item_code, String
44
44
 
45
45
  # @!attribute item_id
46
- # @return [String] System-generated unique identifier for an item. Available when the `Credit Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
46
+ # @return [String] System-generated unique identifier for an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
47
47
  define_attribute :item_id, String
48
48
 
49
49
  # @!attribute measured_unit_id
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Unit price
15
19
  define_attribute :unit_amount, Float
@@ -23,7 +23,7 @@ module Recurly
23
23
  define_attribute :code, String
24
24
 
25
25
  # @!attribute currencies
26
- # @return [Array[AddOnPricing]] If the add-on's `tier_type` is `tiered`, `volume` or `stairstep`, then `currencies` must be absent.
26
+ # @return [Array[AddOnPricing]] If the add-on's `tier_type` is `tiered`, `volume` or `stairstep`, then `currencies` must be absent. Must also be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
27
27
  define_attribute :currencies, Array, { :item_type => :AddOnPricing }
28
28
 
29
29
  # @!attribute default_quantity
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :city, String
12
12
 
13
13
  # @!attribute country
14
- # @return [String] Country, 2-letter ISO code.
14
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
15
15
  define_attribute :country, String
16
16
 
17
17
  # @!attribute first_name
@@ -22,6 +22,10 @@ module Recurly
22
22
  # @return [String] Amazon billing agreement ID
23
23
  define_attribute :amazon_billing_agreement_id, String
24
24
 
25
+ # @!attribute backup_payment_method
26
+ # @return [Boolean] The `backup_payment_method` field is used to designate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined. All payment methods, including the billing info marked `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, if a user sets a different payment method as a backup, the existing backup will no longer be marked as such.
27
+ define_attribute :backup_payment_method, :Boolean
28
+
25
29
  # @!attribute company
26
30
  # @return [String] Company name
27
31
  define_attribute :company, String
@@ -75,7 +79,7 @@ module Recurly
75
79
  define_attribute :paypal_billing_agreement_id, String
76
80
 
77
81
  # @!attribute primary_payment_method
78
- # @return [Boolean] The `primary_payment_method` indicator 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` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
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.
79
83
  define_attribute :primary_payment_method, :Boolean
80
84
 
81
85
  # @!attribute routing_number
@@ -107,7 +111,7 @@ module Recurly
107
111
  define_attribute :transaction_type, String
108
112
 
109
113
  # @!attribute type
110
- # @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)
114
+ # @return [String] The payment method type for a non-credit card based billing info. `bacs` and `becs` are the only accepted values.
111
115
  define_attribute :type, String
112
116
 
113
117
  # @!attribute vat_number
@@ -0,0 +1,14 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class BillingInfoVerify < Request
8
+
9
+ # @!attribute gateway_code
10
+ # @return [String] An identifier for a specific payment gateway.
11
+ define_attribute :gateway_code, String
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class DunningCampaignsBulkUpdate < Request
8
+
9
+ # @!attribute plan_codes
10
+ # @return [Array[String]] List of `plan_codes` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_ids` is present.
11
+ define_attribute :plan_codes, Array, { :item_type => String }
12
+
13
+ # @!attribute plan_ids
14
+ # @return [Array[String]] List of `plan_ids` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_codes` is present.
15
+ define_attribute :plan_ids, Array, { :item_type => String }
16
+ end
17
+ end
18
+ end
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO code.
18
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute first_name
@@ -7,7 +7,7 @@ module Recurly
7
7
  class InvoiceCollect < Request
8
8
 
9
9
  # @!attribute billing_info_id
10
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
10
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
11
11
  define_attribute :billing_info_id, String
12
12
 
13
13
  # @!attribute three_d_secure_action_result_token_id
@@ -35,11 +35,11 @@ module Recurly
35
35
  define_attribute :end_date, DateTime
36
36
 
37
37
  # @!attribute item_code
38
- # @return [String] Unique code to identify an item. Avaliable when the Credit Invoices and Subscription Billing Terms features are enabled.
38
+ # @return [String] Unique code to identify an item. Avaliable when the Credit Invoices feature is enabled.
39
39
  define_attribute :item_code, String
40
40
 
41
41
  # @!attribute item_id
42
- # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
42
+ # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
43
43
  define_attribute :item_id, String
44
44
 
45
45
  # @!attribute origin
@@ -70,6 +70,10 @@ module Recurly
70
70
  # @return [Boolean] `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
71
71
  define_attribute :tax_exempt, :Boolean
72
72
 
73
+ # @!attribute tax_inclusive
74
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
75
+ define_attribute :tax_inclusive, :Boolean
76
+
73
77
  # @!attribute type
74
78
  # @return [String] Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required.
75
79
  define_attribute :type, String
@@ -42,6 +42,10 @@ module Recurly
42
42
  # @return [String] Optional description, not displayed.
43
43
  define_attribute :description, String
44
44
 
45
+ # @!attribute dunning_campaign_id
46
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
+ define_attribute :dunning_campaign_id, String
48
+
45
49
  # @!attribute hosted_pages
46
50
  # @return [PlanHostedPages] Hosted pages settings
47
51
  define_attribute :hosted_pages, :PlanHostedPages
@@ -14,6 +14,10 @@ module Recurly
14
14
  # @return [Float] Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
15
15
  define_attribute :setup_fee, Float
16
16
 
17
+ # @!attribute tax_inclusive
18
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
19
+ define_attribute :tax_inclusive, :Boolean
20
+
17
21
  # @!attribute unit_amount
18
22
  # @return [Float] Unit price
19
23
  define_attribute :unit_amount, Float
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @return [String] Optional description, not displayed.
39
39
  define_attribute :description, String
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute hosted_pages
42
46
  # @return [PlanHostedPages] Hosted pages settings
43
47
  define_attribute :hosted_pages, :PlanHostedPages
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Unit price
15
19
  define_attribute :unit_amount, Float
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :account, :AccountPurchase
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO code.
18
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute email
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO code.
18
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute email
@@ -0,0 +1,14 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class SubscriptionChangeBillingInfoCreate < Request
8
+
9
+ # @!attribute three_d_secure_action_result_token_id
10
+ # @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
11
+ define_attribute :three_d_secure_action_result_token_id, String
12
+ end
13
+ end
14
+ end
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [Array[SubscriptionAddOnUpdate]] If this value is omitted your existing add-ons will be removed. If you provide a value for this field it will replace any existing add-ons. So, when adding or modifying an add-on, you need to include the existing subscription add-ons. Unchanged add-ons can be included just using the subscription add-on's ID: `{"id": "abc123"}`. If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the subscription add-on attributes will be set to the current values of the plan add-on unless provided in the request. - If an `id` is passed, any attributes not passed in will pull from the existing subscription add-on - If a `code` is passed, any attributes not passed in will pull from the current values of the plan add-on - Attributes passed in as part of the request will override either of the above scenarios
11
11
  define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOnUpdate }
12
12
 
13
+ # @!attribute billing_info
14
+ # @return [SubscriptionChangeBillingInfoCreate]
15
+ define_attribute :billing_info, :SubscriptionChangeBillingInfoCreate
16
+
13
17
  # @!attribute collection_method
14
18
  # @return [String] Collection method
15
19
  define_attribute :collection_method, String
@@ -50,6 +54,10 @@ module Recurly
50
54
  # @return [SubscriptionChangeShippingCreate] The shipping address can currently only be changed immediately, using SubscriptionUpdate.
51
55
  define_attribute :shipping, :SubscriptionChangeShippingCreate
52
56
 
57
+ # @!attribute tax_inclusive
58
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
59
+ define_attribute :tax_inclusive, :Boolean
60
+
53
61
  # @!attribute timeframe
54
62
  # @return [String] The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
55
63
  define_attribute :timeframe, String
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :auto_renew, :Boolean
20
20
 
21
21
  # @!attribute billing_info_id
22
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
23
23
  define_attribute :billing_info_id, String
24
24
 
25
25
  # @!attribute collection_method
@@ -86,6 +86,10 @@ module Recurly
86
86
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
87
87
  define_attribute :starts_at, DateTime
88
88
 
89
+ # @!attribute tax_inclusive
90
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
91
+ define_attribute :tax_inclusive, :Boolean
92
+
89
93
  # @!attribute terms_and_conditions
90
94
  # @return [String] This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
91
95
  define_attribute :terms_and_conditions, String
@@ -99,7 +103,7 @@ module Recurly
99
103
  define_attribute :transaction_type, String
100
104
 
101
105
  # @!attribute trial_ends_at
102
- # @return [DateTime] If set, overrides the default trial behavior for the subscription. The date must be in the future.
106
+ # @return [DateTime] IIf set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
103
107
  define_attribute :trial_ends_at, DateTime
104
108
 
105
109
  # @!attribute unit_amount
@@ -7,7 +7,7 @@ module Recurly
7
7
  class SubscriptionPause < Request
8
8
 
9
9
  # @!attribute remaining_pause_cycles
10
- # @return [Integer] Number of billing cycles to pause the subscriptions.
10
+ # @return [Integer] Number of billing cycles to pause the subscriptions. A value of 0 will cancel any pending pauses on the subscription.
11
11
  define_attribute :remaining_pause_cycles, Integer
12
12
  end
13
13
  end
@@ -50,16 +50,20 @@ module Recurly
50
50
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
51
51
  define_attribute :starts_at, DateTime
52
52
 
53
+ # @!attribute tax_inclusive
54
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
55
+ define_attribute :tax_inclusive, :Boolean
56
+
53
57
  # @!attribute total_billing_cycles
54
58
  # @return [Integer] The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
55
59
  define_attribute :total_billing_cycles, Integer
56
60
 
57
61
  # @!attribute trial_ends_at
58
- # @return [DateTime] If set, overrides the default trial behavior for the subscription. The date must be in the future.
62
+ # @return [DateTime] If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
59
63
  define_attribute :trial_ends_at, DateTime
60
64
 
61
65
  # @!attribute unit_amount
62
- # @return [Float] Override the unit amount of the subscription plan by setting this value in cents. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
66
+ # @return [Float] Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
63
67
  define_attribute :unit_amount, Float
64
68
  end
65
69
  end
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :auto_renew, :Boolean
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -54,6 +54,10 @@ module Recurly
54
54
  # @return [SubscriptionShippingUpdate] Subscription shipping details
55
55
  define_attribute :shipping, :SubscriptionShippingUpdate
56
56
 
57
+ # @!attribute tax_inclusive
58
+ # @return [Boolean] This field is deprecated. Do not use it anymore to update a subscription's tax inclusivity. Use the POST subscription change route instead.
59
+ define_attribute :tax_inclusive, :Boolean
60
+
57
61
  # @!attribute terms_and_conditions
58
62
  # @return [String] Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
59
63
  define_attribute :terms_and_conditions, String
@@ -42,6 +42,10 @@ module Recurly
42
42
  # @return [DateTime] If present, when the account was last marked inactive.
43
43
  define_attribute :deleted_at, DateTime
44
44
 
45
+ # @!attribute dunning_campaign_id
46
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
+ define_attribute :dunning_campaign_id, String
48
+
45
49
  # @!attribute email
46
50
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
47
51
  define_attribute :email, String
@@ -18,6 +18,10 @@ module Recurly
18
18
  # @return [String]
19
19
  define_attribute :company, String
20
20
 
21
+ # @!attribute dunning_campaign_id
22
+ # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
23
+ define_attribute :dunning_campaign_id, String
24
+
21
25
  # @!attribute email
22
26
  # @return [String] The email address used for communicating with this customer.
23
27
  define_attribute :email, String
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Unit price
15
19
  define_attribute :unit_amount, Float
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :city, String
12
12
 
13
13
  # @!attribute country
14
- # @return [String] Country, 2-letter ISO code.
14
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
15
15
  define_attribute :country, String
16
16
 
17
17
  # @!attribute first_name
@@ -14,6 +14,10 @@ module Recurly
14
14
  # @return [Address]
15
15
  define_attribute :address, :Address
16
16
 
17
+ # @!attribute backup_payment_method
18
+ # @return [Boolean] The `backup_payment_method` field is used to indicate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined.
19
+ define_attribute :backup_payment_method, :Boolean
20
+
17
21
  # @!attribute company
18
22
  # @return [String]
19
23
  define_attribute :company, String
@@ -47,7 +51,7 @@ module Recurly
47
51
  define_attribute :payment_method, :PaymentMethod
48
52
 
49
53
  # @!attribute primary_payment_method
50
- # @return [Boolean] The `primary_payment_method` indicator 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` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
54
+ # @return [Boolean] The `primary_payment_method` field is used to indicate the primary billing info on the account. The first billing info created on an account will always become primary. This payment method will be used
51
55
  define_attribute :primary_payment_method, :Boolean
52
56
 
53
57
  # @!attribute updated_at
@@ -7,7 +7,7 @@ module Recurly
7
7
  class BillingInfoUpdatedBy < Resource
8
8
 
9
9
  # @!attribute country
10
- # @return [String] Country of IP address, if known by Recurly.
10
+ # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code matching the origin IP address, if known by Recurly.
11
11
  define_attribute :country, String
12
12
 
13
13
  # @!attribute ip
@@ -0,0 +1,50 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningCampaign < Resource
8
+
9
+ # @!attribute code
10
+ # @return [String] Campaign code.
11
+ define_attribute :code, String
12
+
13
+ # @!attribute created_at
14
+ # @return [DateTime] When the current campaign was created in Recurly.
15
+ define_attribute :created_at, DateTime
16
+
17
+ # @!attribute default_campaign
18
+ # @return [Boolean] Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign.
19
+ define_attribute :default_campaign, :Boolean
20
+
21
+ # @!attribute deleted_at
22
+ # @return [DateTime] When the current campaign was deleted in Recurly.
23
+ define_attribute :deleted_at, DateTime
24
+
25
+ # @!attribute description
26
+ # @return [String] Campaign description.
27
+ define_attribute :description, String
28
+
29
+ # @!attribute dunning_cycles
30
+ # @return [Array[DunningCycle]] Dunning Cycle settings.
31
+ define_attribute :dunning_cycles, Array, { :item_type => :DunningCycle }
32
+
33
+ # @!attribute id
34
+ # @return [String]
35
+ define_attribute :id, String
36
+
37
+ # @!attribute name
38
+ # @return [String] Campaign name.
39
+ define_attribute :name, String
40
+
41
+ # @!attribute object
42
+ # @return [String] Object type
43
+ define_attribute :object, String
44
+
45
+ # @!attribute updated_at
46
+ # @return [DateTime] When the current campaign was updated in Recurly.
47
+ define_attribute :updated_at, DateTime
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningCampaignsBulkUpdateResponse < Resource
8
+
9
+ # @!attribute object
10
+ # @return [String] Object type
11
+ define_attribute :object, String
12
+
13
+ # @!attribute plans
14
+ # @return [Array[Plan]] An array containing all of the `Plan` resources that have been updated.
15
+ define_attribute :plans, Array, { :item_type => :Plan }
16
+ end
17
+ end
18
+ end