recurly 3.2.2 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/GETTING_STARTED.md +1 -1
  4. data/README.md +1 -1
  5. data/lib/recurly/client/operations.rb +92 -5
  6. data/lib/recurly/errors/api_errors.rb +2 -0
  7. data/lib/recurly/requests/account_acquisition_updatable.rb +1 -1
  8. data/lib/recurly/requests/account_create.rb +1 -1
  9. data/lib/recurly/requests/account_purchase.rb +1 -1
  10. data/lib/recurly/requests/account_update.rb +1 -1
  11. data/lib/recurly/requests/add_on_create.rb +13 -5
  12. data/lib/recurly/requests/add_on_update.rb +4 -4
  13. data/lib/recurly/requests/billing_info_create.rb +8 -0
  14. data/lib/recurly/requests/item_create.rb +1 -1
  15. data/lib/recurly/requests/item_update.rb +1 -1
  16. data/lib/recurly/requests/line_item_create.rb +4 -0
  17. data/lib/recurly/requests/purchase_create.rb +1 -1
  18. data/lib/recurly/requests/subscription_change_create.rb +1 -1
  19. data/lib/recurly/requests/subscription_create.rb +1 -1
  20. data/lib/recurly/requests/subscription_purchase.rb +1 -1
  21. data/lib/recurly/requests/subscription_update.rb +2 -2
  22. data/lib/recurly/resources/account.rb +25 -1
  23. data/lib/recurly/resources/account_acquisition.rb +2 -2
  24. data/lib/recurly/resources/account_balance.rb +1 -1
  25. data/lib/recurly/resources/add_on.rb +12 -0
  26. data/lib/recurly/resources/add_on_mini.rb +8 -0
  27. data/lib/recurly/resources/coupon.rb +1 -1
  28. data/lib/recurly/resources/coupon_mini.rb +1 -1
  29. data/lib/recurly/resources/credit_payment.rb +3 -3
  30. data/lib/recurly/resources/invoice.rb +2 -2
  31. data/lib/recurly/resources/item.rb +1 -1
  32. data/lib/recurly/resources/item_mini.rb +34 -0
  33. data/lib/recurly/resources/line_item.rb +6 -2
  34. data/lib/recurly/resources/payment_method.rb +12 -0
  35. data/lib/recurly/resources/subscription.rb +5 -5
  36. data/lib/recurly/resources/subscription_add_on.rb +1 -1
  37. data/lib/recurly/resources/subscription_change.rb +2 -2
  38. data/lib/recurly/resources/transaction.rb +3 -3
  39. data/lib/recurly/version.rb +1 -1
  40. data/openapi/api.yaml +2133 -1376
  41. data/recurly.gemspec +1 -1
  42. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1182927b43b3f1815fc6e5fbdc029e655d5310898044087cdaa297e53c3a13ce
4
- data.tar.gz: 39fb2a708a7beba058967282ecd06a7713ed2ad62397ce86a73998fdc2f0542c
3
+ metadata.gz: 99cf91ec895437237664b160b439857ab93cb4912f7e4d694d427ab5982c2ef7
4
+ data.tar.gz: cfcc67cb06f2ba9205f691037b4d499c9673c96f14a9c94f4c6ed9ad05cc4647
5
5
  SHA512:
6
- metadata.gz: 62e800e4c9ca3a1802f24bf46801e86e4bece4b462da4f362a49b8c6f93166ed5364cca83c6999b58fad38b3d5a175d6fc75f12d9d5e381b81410017f9c426e7
7
- data.tar.gz: 4f5df171887b926abd2142d3b79f43beaee6ec4d17cb2481dfc374a4dbab59b4122fc7df3a7216a7f4ca1b9d1f44080054f3aca47f56c2a379da18d7dd20f342
6
+ metadata.gz: 70c0e1df17040b1564bd1eaaf550e0e9990dee25a007d011c8c97c3cd90d218fe90ce8d81abeb00bebcc7e893fdd4bad7c44e544875918ae7cca03a737cb2135
7
+ data.tar.gz: b764eea762df6d3d2e061413d83d885705337cf8587259233f2400d112e0f331076ec5202a04ffeb6846925def2821dc027513865c9fae430e3745f34cffc070
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.2.2
2
+ current_version = 3.3.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
@@ -226,7 +226,7 @@ You can specify up to 10 endpoints through the application. All notifications wi
226
226
  be sent to all configured endpoints for your site.
227
227
 
228
228
  See our [product docs](https://docs.recurly.com/docs/webhooks) to learn more about webhooks
229
- and see our [dev docs](https://dev.recurly.com/page/webhooks) to learn about what payloads
229
+ and see our [dev docs](https://developers.recurly.com/pages/webhooks.html) to learn about what payloads
230
230
  are available.
231
231
 
232
232
  Although our API is now JSON, our webhook payloads are still formatted as XML for the time being.
data/README.md CHANGED
@@ -7,7 +7,7 @@ This repository houses the official ruby client for Recurly's V3 API.
7
7
 
8
8
  ## Reference Documentation
9
9
 
10
- Getting Started Guide and reference tdocumentation can be found on [rubydoc.info](https://www.rubydoc.info/github/recurly/recurly-client-ruby/).
10
+ Getting Started Guide and reference documentation can be found on [rubydoc.info](https://www.rubydoc.info/github/recurly/recurly-client-ruby/).
11
11
 
12
12
  ## Contributing
13
13
 
@@ -262,7 +262,7 @@ module Recurly
262
262
  #
263
263
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
264
264
  # @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+.
265
- # @return [Empty] Acquisition data was succesfully deleted.
265
+ # @return [Resources::Empty] Acquisition data was succesfully deleted.
266
266
  # @example
267
267
  # begin
268
268
  # acquisition = @client.remove_account_acquisition(account_id: account_id)
@@ -380,7 +380,7 @@ module Recurly
380
380
  #
381
381
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
382
382
  # @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+.
383
- # @return [Empty] Billing information deleted
383
+ # @return [Resources::Empty] Billing information deleted
384
384
  # @example
385
385
  # begin
386
386
  # @client.remove_billing_info(account_id: account_id)
@@ -916,7 +916,7 @@ module Recurly
916
916
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
917
917
  # @param shipping_address_id [String] Shipping Address ID.
918
918
  # @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+.
919
- # @return [Empty] Shipping address deleted.
919
+ # @return [Resources::Empty] Shipping address deleted.
920
920
  # @example
921
921
  # begin
922
922
  # @client.remove_shipping_address(
@@ -1397,6 +1397,12 @@ module Recurly
1397
1397
  # @param state [String] Filter by state.
1398
1398
  # @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+.
1399
1399
  # @return [Pager<Resources::Item>] A list of the site's items.
1400
+ # @example
1401
+ # items = @client.list_items(limit: 200)
1402
+ # items.each do |item|
1403
+ # puts "Item: #{item.code}"
1404
+ # end
1405
+ #
1400
1406
  def list_items(**options)
1401
1407
  path = interpolate_path("/items")
1402
1408
  pager(path, **options)
@@ -1409,6 +1415,28 @@ module Recurly
1409
1415
  # @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
1410
1416
  # @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+.
1411
1417
  # @return [Resources::Item] A new item.
1418
+ # @example
1419
+ # begin
1420
+ # item_create = {
1421
+ # code: item_code,
1422
+ # name: "Item Name",
1423
+ # description: "Item Description",
1424
+ # external_sku: "a35JE-44",
1425
+ # accounting_code: "item-code-127",
1426
+ # revenue_schedule_type: "at_range_end",
1427
+ # custom_fields: [{
1428
+ # name: "custom-field-1",
1429
+ # value: "Custom Field 1 value"
1430
+ # }]
1431
+ # }
1432
+ # item = @client.create_item(body: item_create)
1433
+ # puts "Created Item #{item}"
1434
+ # rescue Recurly::Errors::ValidationError => e
1435
+ # # If the request was invalid, you may want to tell your user
1436
+ # # why. You can find the invalid params and reasons in e.recurly_error.params
1437
+ # puts "ValidationError: #{e.recurly_error.params}"
1438
+ # end
1439
+ #
1412
1440
  def create_item(body:, **options)
1413
1441
  path = interpolate_path("/items")
1414
1442
  post(path, body, Requests::ItemCreate, **options)
@@ -1421,6 +1449,16 @@ module Recurly
1421
1449
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1422
1450
  # @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+.
1423
1451
  # @return [Resources::Item] An item.
1452
+ # @example
1453
+ # begin
1454
+ # item = @client.get_item(item_id: item_id)
1455
+ # puts "Got Item #{item}"
1456
+ # rescue Recurly::Errors::NotFoundError
1457
+ # # If the resource was not found, you may want to alert the user or
1458
+ # # just return nil
1459
+ # puts "Resource Not Found"
1460
+ # end
1461
+ #
1424
1462
  def get_item(item_id:, **options)
1425
1463
  path = interpolate_path("/items/{item_id}", item_id: item_id)
1426
1464
  get(path, **options)
@@ -1434,6 +1472,23 @@ module Recurly
1434
1472
  # @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
1435
1473
  # @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+.
1436
1474
  # @return [Resources::Item] The updated item.
1475
+ # @example
1476
+ # begin
1477
+ # item_update = {
1478
+ # name: "New Item Name",
1479
+ # description: "New Item Description"
1480
+ # }
1481
+ # item = @client.update_item(
1482
+ # item_id: item_id,
1483
+ # body: item_update
1484
+ # )
1485
+ # puts "Updated Item #{item}"
1486
+ # rescue Recurly::Errors::ValidationError => e
1487
+ # # If the request was invalid, you may want to tell your user
1488
+ # # why. You can find the invalid params and reasons in e.recurly_error.params
1489
+ # puts "ValidationError: #{e.recurly_error.params}"
1490
+ # end
1491
+ #
1437
1492
  def update_item(item_id:, body:, **options)
1438
1493
  path = interpolate_path("/items/{item_id}", item_id: item_id)
1439
1494
  put(path, body, Requests::ItemUpdate, **options)
@@ -1446,6 +1501,16 @@ module Recurly
1446
1501
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1447
1502
  # @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+.
1448
1503
  # @return [Resources::Item] An item.
1504
+ # @example
1505
+ # begin
1506
+ # item = @client.deactivate_item(item_id: item_id)
1507
+ # puts "Deactivated Item #{item}"
1508
+ # rescue Recurly::Errors::NotFoundError
1509
+ # # If the resource was not found, you may want to alert the user or
1510
+ # # just return nil
1511
+ # puts "Resource Not Found"
1512
+ # end
1513
+ #
1449
1514
  def deactivate_item(item_id:, **options)
1450
1515
  path = interpolate_path("/items/{item_id}", item_id: item_id)
1451
1516
  delete(path, **options)
@@ -1458,6 +1523,16 @@ module Recurly
1458
1523
  # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
1459
1524
  # @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+.
1460
1525
  # @return [Resources::Item] An item.
1526
+ # @example
1527
+ # begin
1528
+ # item = @client.reactivate_item(item_id: item_id)
1529
+ # puts "Reactivated Item #{item}"
1530
+ # rescue Recurly::Errors::NotFoundError
1531
+ # # If the resource was not found, you may want to alert the user or
1532
+ # # just return nil
1533
+ # puts "Resource Not Found"
1534
+ # end
1535
+ #
1461
1536
  def reactivate_item(item_id:, **options)
1462
1537
  path = interpolate_path("/items/{item_id}/reactivate", item_id: item_id)
1463
1538
  put(path, **options)
@@ -1861,7 +1936,7 @@ module Recurly
1861
1936
  #
1862
1937
  # @param line_item_id [String] Line Item ID.
1863
1938
  # @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+.
1864
- # @return [Empty] Line item deleted.
1939
+ # @return [Resources::Empty] Line item deleted.
1865
1940
  # @example
1866
1941
  # begin
1867
1942
  # @client.remove_line_item(
@@ -2483,6 +2558,18 @@ module Recurly
2483
2558
  put(path, **options)
2484
2559
  end
2485
2560
 
2561
+ # Convert trial subscription
2562
+ #
2563
+ # {https://developers.recurly.com/api/v2019-10-10#operation/convert_trial convert_trial api documenation}
2564
+ #
2565
+ # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
2566
+ # @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+.
2567
+ # @return [Resources::Subscription] A subscription.
2568
+ def convert_trial(subscription_id:, **options)
2569
+ path = interpolate_path("/subscriptions/{subscription_id}/convert_trial", subscription_id: subscription_id)
2570
+ put(path, **options)
2571
+ end
2572
+
2486
2573
  # Fetch a subscription's pending change
2487
2574
  #
2488
2575
  # {https://developers.recurly.com/api/v2019-10-10#operation/get_subscription_change get_subscription_change api documenation}
@@ -2543,7 +2630,7 @@ module Recurly
2543
2630
  #
2544
2631
  # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
2545
2632
  # @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+.
2546
- # @return [Empty] Subscription change was deleted.
2633
+ # @return [Resources::Empty] Subscription change was deleted.
2547
2634
  # @example
2548
2635
  # begin
2549
2636
  # @client.remove_subscription_change(
@@ -35,5 +35,7 @@ module Recurly
35
35
  class ValidationError < Errors::APIError; end
36
36
 
37
37
  class MissingFeatureError < Errors::APIError; end
38
+
39
+ class RateLimitedError < Errors::APIError; end
38
40
  end
39
41
  end
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :channel, String
16
16
 
17
17
  # @!attribute cost
18
- # @return [AccountAcquisitionCost]
18
+ # @return [AccountAcquisitionCost] Account balance
19
19
  define_attribute :cost, :AccountAcquisitionCost
20
20
 
21
21
  # @!attribute subchannel
@@ -35,7 +35,7 @@ module Recurly
35
35
  define_attribute :company, String
36
36
 
37
37
  # @!attribute custom_fields
38
- # @return [Array[CustomField]]
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
41
  # @!attribute email
@@ -35,7 +35,7 @@ module Recurly
35
35
  define_attribute :company, String
36
36
 
37
37
  # @!attribute custom_fields
38
- # @return [Array[CustomField]]
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
41
  # @!attribute email
@@ -27,7 +27,7 @@ module Recurly
27
27
  define_attribute :company, String
28
28
 
29
29
  # @!attribute custom_fields
30
- # @return [Array[CustomField]]
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
33
  # @!attribute email
@@ -7,15 +7,15 @@ module Recurly
7
7
  class AddOnCreate < Request
8
8
 
9
9
  # @!attribute accounting_code
10
- # @return [String] Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
10
+ # @return [String] Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If `item_code`/`item_id` is part of the request then `code` must be absent.
11
11
  define_attribute :accounting_code, String
12
12
 
13
13
  # @!attribute code
14
- # @return [String] The unique identifier for the add-on within its plan.
14
+ # @return [String] The unique identifier for the add-on within its plan. If `item_code`/`item_id` is part of the request then `code` must be absent. If `item_code`/`item_id` is not present `code` is required.
15
15
  define_attribute :code, String
16
16
 
17
17
  # @!attribute currencies
18
- # @return [Array[AddOnPricing]] Add-on pricing
18
+ # @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.
19
19
  define_attribute :currencies, Array, { :item_type => :AddOnPricing }
20
20
 
21
21
  # @!attribute default_quantity
@@ -26,8 +26,16 @@ module Recurly
26
26
  # @return [Boolean] Determines if the quantity field is displayed on the hosted pages for the add-on.
27
27
  define_attribute :display_quantity, :Boolean
28
28
 
29
+ # @!attribute item_code
30
+ # @return [String] Unique code to identify an item, when the `Catalog: Item Add-Ons` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
31
+ define_attribute :item_code, String
32
+
33
+ # @!attribute item_id
34
+ # @return [String] Available when the `Catalog: Item Add-Ons` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
35
+ define_attribute :item_id, String
36
+
29
37
  # @!attribute name
30
- # @return [String] Describes your add-on and will appear in subscribers' invoices.
38
+ # @return [String] Describes your add-on and will appear in subscribers' invoices. If `item_code`/`item_id` is part of the request then `code` must be absent. If `item_code`/`item_id` is not present `code` is required.
31
39
  define_attribute :name, String
32
40
 
33
41
  # @!attribute plan_id
@@ -35,7 +43,7 @@ module Recurly
35
43
  define_attribute :plan_id, String
36
44
 
37
45
  # @!attribute tax_code
38
- # @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
46
+ # @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If `item_code`/`item_id` is part of the request then `code` must be absent.
39
47
  define_attribute :tax_code, String
40
48
  end
41
49
  end
@@ -7,11 +7,11 @@ module Recurly
7
7
  class AddOnUpdate < Request
8
8
 
9
9
  # @!attribute accounting_code
10
- # @return [String] Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
10
+ # @return [String] Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If an `Item` is associated to the `AddOn` then `accounting code` must be absent.
11
11
  define_attribute :accounting_code, String
12
12
 
13
13
  # @!attribute code
14
- # @return [String] The unique identifier for the add-on within its plan.
14
+ # @return [String] The unique identifier for the add-on within its plan. If an `Item` is associated to the `AddOn` then `code` must be absent.
15
15
  define_attribute :code, String
16
16
 
17
17
  # @!attribute currencies
@@ -31,11 +31,11 @@ module Recurly
31
31
  define_attribute :id, String
32
32
 
33
33
  # @!attribute name
34
- # @return [String] Describes your add-on and will appear in subscribers' invoices.
34
+ # @return [String] Describes your add-on and will appear in subscribers' invoices. If an `Item` is associated to the `AddOn` then `name` must be absent.
35
35
  define_attribute :name, String
36
36
 
37
37
  # @!attribute tax_code
38
- # @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
38
+ # @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If an `Item` is associated to the `AddOn` then `tax code` must be absent.
39
39
  define_attribute :tax_code, String
40
40
  end
41
41
  end
@@ -30,6 +30,14 @@ module Recurly
30
30
  # @return [String] Fraud Session ID
31
31
  define_attribute :fraud_session_id, String
32
32
 
33
+ # @!attribute gateway_code
34
+ # @return [String] An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`.
35
+ define_attribute :gateway_code, String
36
+
37
+ # @!attribute gateway_token
38
+ # @return [String] A token used in place of a credit card in order to perform transactions. Must be used in conjunction with `gateway_code`.
39
+ define_attribute :gateway_token, String
40
+
33
41
  # @!attribute ip_address
34
42
  # @return [String] *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information.
35
43
  define_attribute :ip_address, String
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :currencies, Array, { :item_type => :Pricing }
20
20
 
21
21
  # @!attribute custom_fields
22
- # @return [Array[CustomField]]
22
+ # @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.
23
23
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
24
24
 
25
25
  # @!attribute description
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :currencies, Array, { :item_type => :Pricing }
20
20
 
21
21
  # @!attribute custom_fields
22
- # @return [Array[CustomField]]
22
+ # @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.
23
23
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
24
24
 
25
25
  # @!attribute description
@@ -34,6 +34,10 @@ module Recurly
34
34
  # @return [String] Available when the Catalog feature is enabled.
35
35
  define_attribute :item_id, String
36
36
 
37
+ # @!attribute origin
38
+ # @return [String] Only allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Can only have a value of `external_gift_card`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements.
39
+ define_attribute :origin, String
40
+
37
41
  # @!attribute product_code
38
42
  # @return [String] Optional field to track a product code or SKU for the line item. This can be used to later reporting on product purchases. For Vertex tax calculations, this field will be used as the Vertex `product` field. If `item_code`/`item_id` is part of the request then `product_code` must be absent.
39
43
  define_attribute :product_code, String
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :account, :AccountPurchase
12
12
 
13
13
  # @!attribute collection_method
14
- # @return [String] Collection method
14
+ # @return [String] Must be set to manual in order to preview a purchase for an Account that does not have payment information associated with the Billing Info.
15
15
  define_attribute :collection_method, String
16
16
 
17
17
  # @!attribute coupon_codes
@@ -39,7 +39,7 @@ module Recurly
39
39
  define_attribute :quantity, Integer
40
40
 
41
41
  # @!attribute shipping
42
- # @return [SubscriptionChangeShippingCreate]
42
+ # @return [SubscriptionChangeShippingCreate] The shipping address can currently only be changed immediately, using SubscriptionUpdate.
43
43
  define_attribute :shipping, :SubscriptionChangeShippingCreate
44
44
 
45
45
  # @!attribute timeframe
@@ -35,7 +35,7 @@ module Recurly
35
35
  define_attribute :currency, String
36
36
 
37
37
  # @!attribute custom_fields
38
- # @return [Array[CustomField]]
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
41
  # @!attribute customer_notes
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :auto_renew, :Boolean
16
16
 
17
17
  # @!attribute custom_fields
18
- # @return [Array[CustomField]]
18
+ # @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.
19
19
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
20
20
 
21
21
  # @!attribute next_bill_date
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :collection_method, String
16
16
 
17
17
  # @!attribute custom_fields
18
- # @return [Array[CustomField]]
18
+ # @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.
19
19
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
20
20
 
21
21
  # @!attribute customer_notes
@@ -43,7 +43,7 @@ module Recurly
43
43
  define_attribute :renewal_billing_cycles, Integer
44
44
 
45
45
  # @!attribute shipping
46
- # @return [SubscriptionShippingUpdate]
46
+ # @return [SubscriptionShippingUpdate] Subscription shipping details
47
47
  define_attribute :shipping, :SubscriptionShippingUpdate
48
48
 
49
49
  # @!attribute terms_and_conditions
@@ -35,7 +35,7 @@ module Recurly
35
35
  define_attribute :created_at, DateTime
36
36
 
37
37
  # @!attribute custom_fields
38
- # @return [Array[CustomField]]
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
41
  # @!attribute deleted_at
@@ -54,6 +54,30 @@ module Recurly
54
54
  # @return [String]
55
55
  define_attribute :first_name, String
56
56
 
57
+ # @!attribute has_active_subscription
58
+ # @return [Boolean] Indicates if the account has an active subscription.
59
+ define_attribute :has_active_subscription, :Boolean
60
+
61
+ # @!attribute has_canceled_subscription
62
+ # @return [Boolean] Indicates if the account has a canceled subscription.
63
+ define_attribute :has_canceled_subscription, :Boolean
64
+
65
+ # @!attribute has_future_subscription
66
+ # @return [Boolean] Indicates if the account has a future subscription.
67
+ define_attribute :has_future_subscription, :Boolean
68
+
69
+ # @!attribute has_live_subscription
70
+ # @return [Boolean] Indicates if the account has a subscription that is either active, canceled, future, or paused.
71
+ define_attribute :has_live_subscription, :Boolean
72
+
73
+ # @!attribute has_past_due_invoice
74
+ # @return [Boolean] Indicates if the account has a past due invoice.
75
+ define_attribute :has_past_due_invoice, :Boolean
76
+
77
+ # @!attribute has_paused_subscription
78
+ # @return [Boolean] Indicates if the account has a paused subscription.
79
+ define_attribute :has_paused_subscription, :Boolean
80
+
57
81
  # @!attribute hosted_login_token
58
82
  # @return [String] The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: `https://{subdomain}.recurly.com/account/{hosted_login_token}`.
59
83
  define_attribute :hosted_login_token, String