recurly 3.12.0 → 3.17.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: 6fbbc51d9581d1be4fbafd9fab7349da3899ec1e8f5671d877a50c009f7fbbd4
4
- data.tar.gz: 0a11dc64ecf1af2c558a51f8726d73899092438e41cac6e59d62a5c18b2bfa84
3
+ metadata.gz: f97d96e89214fafeee901c7b806c8738f480078f69e5467b70d749b24d1bcd0e
4
+ data.tar.gz: 1e3049990bf828fa4bd2623713b73a4b52f10061e2efae38917dd9350b0ad436
5
5
  SHA512:
6
- metadata.gz: 73c0913d4674dcf603b1c8a5430a38bea1d9c5cb467ff2e901be0ff6aec290dbc1a68d245f1b6f3d6075c42f306f3cccb331f4dd43d8036a59ee62914dc364ff
7
- data.tar.gz: d9d9ba2b0b3368edd0663f0e02d4ab1aeab803363ee928293e4c573131ae2093400178b52500f212074c02987ed6c3338da26aa7ff8a75393566b10b4a5f593d
6
+ metadata.gz: 0b93da2f0d336bd4a5029a8a9018fd8e70087417062f31c5e40d7968408a2ab284e9245523e90892fb9bc7e15846b57a6e531a1be9d0298c7e8e3b9fe1aee72c
7
+ data.tar.gz: 8350be352036521d91c1155f0ae23d3c2c73c0e31e188f51188b413b00cc744abb535b2ef7869859cda177e7928fd487d9f7c16aa4c866f2fac77fc734c4dcd7
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.12.0
2
+ current_version = 3.17.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
@@ -1,8 +1,74 @@
1
1
  # Changelog
2
2
 
3
- ## [3.12.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
3
+ ## [3.17.0](https://github.com/recurly/recurly-client-ruby/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.11.0...HEAD)
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.16.0...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Latest Changes for 2019-10-10 [\#657](https://github.com/recurly/recurly-client-ruby/pull/657) ([douglasmiller](https://github.com/douglasmiller))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Release 3.17.0 [\#658](https://github.com/recurly/recurly-client-ruby/pull/658) ([douglasmiller](https://github.com/douglasmiller))
14
+
15
+ ## [3.16.0](https://github.com/recurly/recurly-client-ruby/tree/3.16.0) (2020-11-24)
16
+
17
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.15.0...3.16.0)
18
+
19
+ **Implemented enhancements:**
20
+
21
+ - Latest Changes for 2019-10-10 \(tax\_identifier / tax\_identifier\_type\) [\#654](https://github.com/recurly/recurly-client-ruby/pull/654) ([douglasmiller](https://github.com/douglasmiller))
22
+ - Latest Changes for 2019-10-10 [\#651](https://github.com/recurly/recurly-client-ruby/pull/651) ([douglasmiller](https://github.com/douglasmiller))
23
+
24
+ **Fixed bugs:**
25
+
26
+ - Refund API V2 Error Details [\#652](https://github.com/recurly/recurly-client-ruby/issues/652)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Release 3.16.0 [\#656](https://github.com/recurly/recurly-client-ruby/pull/656) ([douglasmiller](https://github.com/douglasmiller))
31
+
32
+ ## [3.15.0](https://github.com/recurly/recurly-client-ruby/tree/3.15.0) (2020-11-06)
33
+
34
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.14.0...3.15.0)
35
+
36
+ **Implemented enhancements:**
37
+
38
+ - Latest Changes for 2019-10-10 \(Wallet, Item Coupons\) [\#645](https://github.com/recurly/recurly-client-ruby/pull/645) ([douglasmiller](https://github.com/douglasmiller))
39
+
40
+ **Merged pull requests:**
41
+
42
+ - Release 3.15.0 [\#647](https://github.com/recurly/recurly-client-ruby/pull/647) ([douglasmiller](https://github.com/douglasmiller))
43
+
44
+ ## [3.14.0](https://github.com/recurly/recurly-client-ruby/tree/3.14.0) (2020-10-20)
45
+
46
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.13.0...3.14.0)
47
+
48
+ **Implemented enhancements:**
49
+
50
+ - Mon Oct 19 20:38:03 UTC 2020 Upgrade API version v2019-10-10 [\#642](https://github.com/recurly/recurly-client-ruby/pull/642) ([douglasmiller](https://github.com/douglasmiller))
51
+
52
+ **Merged pull requests:**
53
+
54
+ - Release 3.14.0 [\#643](https://github.com/recurly/recurly-client-ruby/pull/643) ([douglasmiller](https://github.com/douglasmiller))
55
+ - Fixes uninitialized constant `Recurly::Errors::ServiceNotAvailableError` [\#641](https://github.com/recurly/recurly-client-ruby/pull/641) ([ruyrocha](https://github.com/ruyrocha))
56
+
57
+ ## [3.13.0](https://github.com/recurly/recurly-client-ruby/tree/3.13.0) (2020-09-22)
58
+
59
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.12.0...3.13.0)
60
+
61
+ **Implemented enhancements:**
62
+
63
+ - Latest Changes for 2019-10-10 \(Automated Exports, additional resource data attributes\) [\#638](https://github.com/recurly/recurly-client-ruby/pull/638) ([douglasmiller](https://github.com/douglasmiller))
64
+
65
+ **Merged pull requests:**
66
+
67
+ - Release 3.13.0 [\#639](https://github.com/recurly/recurly-client-ruby/pull/639) ([douglasmiller](https://github.com/douglasmiller))
68
+
69
+ ## [3.12.0](https://github.com/recurly/recurly-client-ruby/tree/3.12.0) (2020-08-31)
70
+
71
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.11.0...3.12.0)
6
72
 
7
73
  **Implemented enhancements:**
8
74
 
@@ -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.12'
8
+ gem 'recurly', '~> 3.17'
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.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Recurly
2
2
 
3
3
  [![Rubygems](https://img.shields.io/static/v1?label=rubygems&message=recurly&color=purple)](https://rubygems.org/gems/recurly)
4
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
4
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
5
5
 
6
6
  This repository houses the official ruby client for Recurly's V3 API.
7
7
 
@@ -253,8 +253,13 @@ module Recurly
253
253
  def raise_api_error!(http_response, response)
254
254
  if response.content_type.include?(JSON_CONTENT_TYPE)
255
255
  error = JSONParser.parse(self, response.body)
256
- error_class = Errors::APIError.error_class(error.type)
257
- raise error_class.new(response, error)
256
+ begin
257
+ error_class = Errors::APIError.error_class(error.type)
258
+ raise error_class.new(response, error)
259
+ rescue NameError
260
+ error_class = Errors::APIError.from_response(http_response)
261
+ raise error_class.new(response, error)
262
+ end
258
263
  end
259
264
 
260
265
  error_class = Errors::APIError.from_response(http_response)
@@ -444,6 +444,103 @@ module Recurly
444
444
  delete(path, **options)
445
445
  end
446
446
 
447
+ # Get the list of billing information associated with an account
448
+ #
449
+ # {https://developers.recurly.com/api/v2019-10-10#operation/list_billing_infos list_billing_infos api documenation}
450
+ #
451
+ # @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+.
452
+ # @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
453
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
454
+ #
455
+ # *Important notes:*
456
+ #
457
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
458
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
459
+ # * Invalid or unknown IDs will be ignored, so you should check that the
460
+ # results correspond to your request.
461
+ # * Records are returned in an arbitrary order. Since results are all
462
+ # returned at once you can sort the records yourself.
463
+ #
464
+ # @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
465
+ # order. In descending order updated records will move behind the cursor and could
466
+ # prevent some records from being returned.
467
+ #
468
+ # @param begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
469
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
470
+ #
471
+ # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
472
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
473
+ #
474
+ # @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+.
475
+ #
476
+ # @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
477
+ #
478
+ def list_billing_infos(account_id:, **options)
479
+ path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id)
480
+ pager(path, **options)
481
+ end
482
+
483
+ # Set an account's billing information when the wallet feature is enabled
484
+ #
485
+ # {https://developers.recurly.com/api/v2019-10-10#operation/create_billing_info create_billing_info api documenation}
486
+ #
487
+ # @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+.
488
+ # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
489
+ # @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+.
490
+ #
491
+ # @return [Resources::BillingInfo] Updated billing information.
492
+ #
493
+ def create_billing_info(account_id:, body:, **options)
494
+ path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id)
495
+ post(path, body, Requests::BillingInfoCreate, **options)
496
+ end
497
+
498
+ # Fetch a billing info
499
+ #
500
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_a_billing_info get_a_billing_info api documenation}
501
+ #
502
+ # @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+.
503
+ # @param billing_info_id [String] Billing Info ID.
504
+ # @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+.
505
+ #
506
+ # @return [Resources::BillingInfo] A billing info.
507
+ #
508
+ def get_a_billing_info(account_id:, billing_info_id:, **options)
509
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
510
+ get(path, **options)
511
+ end
512
+
513
+ # Update an account's billing information
514
+ #
515
+ # {https://developers.recurly.com/api/v2019-10-10#operation/update_a_billing_info update_a_billing_info api documenation}
516
+ #
517
+ # @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+.
518
+ # @param billing_info_id [String] Billing Info ID.
519
+ # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
520
+ # @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+.
521
+ #
522
+ # @return [Resources::BillingInfo] Updated billing information.
523
+ #
524
+ def update_a_billing_info(account_id:, billing_info_id:, body:, **options)
525
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
526
+ put(path, body, Requests::BillingInfoCreate, **options)
527
+ end
528
+
529
+ # Remove an account's billing information
530
+ #
531
+ # {https://developers.recurly.com/api/v2019-10-10#operation/remove_a_billing_info remove_a_billing_info api documenation}
532
+ #
533
+ # @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+.
534
+ # @param billing_info_id [String] Billing Info ID.
535
+ # @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+.
536
+ #
537
+ # @return [Resources::Empty] Billing information deleted
538
+ #
539
+ def remove_a_billing_info(account_id:, billing_info_id:, **options)
540
+ path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id)
541
+ delete(path, **options)
542
+ end
543
+
447
544
  # Show the coupon redemptions for an account
448
545
  #
449
546
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
@@ -471,6 +568,7 @@ module Recurly
471
568
  # @param end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
472
569
  # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
473
570
  #
571
+ # @param state [String] Filter by state.
474
572
  # @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+.
475
573
  #
476
574
  # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
@@ -1364,6 +1462,32 @@ module Recurly
1364
1462
  delete(path, **options)
1365
1463
  end
1366
1464
 
1465
+ # Restore an inactive coupon
1466
+ #
1467
+ # {https://developers.recurly.com/api/v2019-10-10#operation/restore_coupon restore_coupon api documenation}
1468
+ #
1469
+ # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
1470
+ # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
1471
+ # @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+.
1472
+ #
1473
+ # @return [Resources::Coupon] The restored coupon.
1474
+ # @example
1475
+ # begin
1476
+ # coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
1477
+ # name: "New Coupon Name"
1478
+ # })
1479
+ # puts "Restored coupon #{coupon}"
1480
+ # rescue Recurly::Errors::NotFoundError
1481
+ # # If the resource was not found, you may want to alert the user or
1482
+ # # just return nil
1483
+ # puts "Resource Not Found"
1484
+ # end
1485
+ #
1486
+ def restore_coupon(coupon_id:, body:, **options)
1487
+ path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
1488
+ put(path, body, Requests::CouponUpdate, **options)
1489
+ end
1490
+
1367
1491
  # List unique coupon codes associated with a bulk coupon
1368
1492
  #
1369
1493
  # {https://developers.recurly.com/api/v2019-10-10#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
@@ -2929,6 +3053,7 @@ module Recurly
2929
3053
  #
2930
3054
  # You may also terminate a subscription with no refund and then manually refund specific invoices.
2931
3055
  #
3056
+ # @param charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
2932
3057
  # @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+.
2933
3058
  #
2934
3059
  # @return [Resources::Subscription] An expired subscription.
@@ -3597,5 +3722,54 @@ module Recurly
3597
3722
  path = interpolate_path("/purchases/preview")
3598
3723
  post(path, body, Requests::PurchaseCreate, **options)
3599
3724
  end
3725
+
3726
+ # List the dates that have an available export to download.
3727
+ #
3728
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_dates get_export_dates api documenation}
3729
+ #
3730
+ # @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+.
3731
+ #
3732
+ # @return [Resources::ExportDates] Returns a list of dates.
3733
+ # @example
3734
+ # begin
3735
+ # export_dates = @client.get_export_dates()
3736
+ # export_dates.dates.each do |date|
3737
+ # puts "Exports are available for: #{date}"
3738
+ # end
3739
+ # rescue Recurly::Errors::NotFoundError
3740
+ # # If the resource was not found, you may want to alert the user or
3741
+ # # just return nil
3742
+ # puts "Resource Not Found"
3743
+ # end
3744
+ #
3745
+ def get_export_dates(**options)
3746
+ path = interpolate_path("/export_dates")
3747
+ get(path, **options)
3748
+ end
3749
+
3750
+ # List of the export files that are available to download.
3751
+ #
3752
+ # {https://developers.recurly.com/api/v2019-10-10#operation/get_export_files get_export_files api documenation}
3753
+ #
3754
+ # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
3755
+ # @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+.
3756
+ #
3757
+ # @return [Resources::ExportFiles] Returns a list of export files to download.
3758
+ # @example
3759
+ # begin
3760
+ # export_files = @client.get_export_files(export_date: export_date)
3761
+ # export_files.files.each do |file|
3762
+ # puts "Export file download URL: #{file.href}"
3763
+ # end
3764
+ # rescue Recurly::Errors::NotFoundError
3765
+ # # If the resource was not found, you may want to alert the user or
3766
+ # # just return nil
3767
+ # puts "Resource Not Found"
3768
+ # end
3769
+ #
3770
+ def get_export_files(export_date:, **options)
3771
+ path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
3772
+ get(path, **options)
3773
+ end
3600
3774
  end
3601
3775
  end
@@ -26,6 +26,8 @@ module Recurly
26
26
 
27
27
  class InternalServerError < ServerError; end
28
28
 
29
+ class ServiceNotAvailableError < InternalServerError; end
30
+
29
31
  class BadGatewayError < ServerError; end
30
32
 
31
33
  class ServiceUnavailableError < ServerError; end
@@ -75,7 +75,7 @@ module Recurly
75
75
  define_attribute :tax_code, String
76
76
 
77
77
  # @!attribute tier_type
78
- # @return [String] The pricing model for the add-on. For more information, [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based).
78
+ # @return [String] The pricing model for the add-on. For more information, [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
79
79
  define_attribute :tier_type, String
80
80
 
81
81
  # @!attribute tiers
@@ -87,7 +87,7 @@ module Recurly
87
87
  define_attribute :usage_percentage, Float
88
88
 
89
89
  # @!attribute usage_type
90
- # @return [String] Type of usage, required if `add_on_type` is `usage`.
90
+ # @return [String] Type of usage, required if `add_on_type` is `usage`. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
91
91
  define_attribute :usage_type, String
92
92
  end
93
93
  end
@@ -74,6 +74,10 @@ module Recurly
74
74
  # @return [String] PayPal billing agreement ID
75
75
  define_attribute :paypal_billing_agreement_id, String
76
76
 
77
+ # @!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.
79
+ define_attribute :primary_payment_method, :Boolean
80
+
77
81
  # @!attribute routing_number
78
82
  # @return [String] The bank's rounting number. (ACH only)
79
83
  define_attribute :routing_number, String
@@ -82,6 +86,14 @@ module Recurly
82
86
  # @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
83
87
  define_attribute :sort_code, String
84
88
 
89
+ # @!attribute tax_identifier
90
+ # @return [String] Tax identifier is required if adding a billing info that is a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents.
91
+ define_attribute :tax_identifier, String
92
+
93
+ # @!attribute tax_identifier_type
94
+ # @return [String] this field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil.
95
+ define_attribute :tax_identifier_type, String
96
+
85
97
  # @!attribute three_d_secure_action_result_token_id
86
98
  # @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
87
99
  define_attribute :three_d_secure_action_result_token_id, String
@@ -6,6 +6,10 @@ module Recurly
6
6
  module Requests
7
7
  class CouponCreate < Request
8
8
 
9
+ # @!attribute applies_to_all_items
10
+ # @return [Boolean] To apply coupon to Items in your Catalog, include a list of `item_codes` in the request that the coupon will apply to. Or set value to true to apply to all Items in your Catalog. The following values are not permitted when `applies_to_all_items` is included: `free_trial_amount` and `free_trial_unit`.
11
+ define_attribute :applies_to_all_items, :Boolean
12
+
9
13
  # @!attribute applies_to_all_plans
10
14
  # @return [Boolean] The coupon is valid for all plans if true. If false then `plans` and `plans_names` will list the applicable plans.
11
15
  define_attribute :applies_to_all_plans, :Boolean
@@ -54,6 +58,10 @@ module Recurly
54
58
  # @return [String] Description of the coupon on the invoice.
55
59
  define_attribute :invoice_description, String
56
60
 
61
+ # @!attribute item_codes
62
+ # @return [Array[String]] List of item codes to which this coupon applies. Sending `item_codes` is only permitted when `applies_to_all_items` is set to false. The following values are not permitted when `item_codes` is included: `free_trial_amount` and `free_trial_unit`.
63
+ define_attribute :item_codes, Array, { :item_type => String }
64
+
57
65
  # @!attribute max_redemptions
58
66
  # @return [Integer] A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
59
67
  define_attribute :max_redemptions, Integer
@@ -6,6 +6,10 @@ module Recurly
6
6
  module Requests
7
7
  class InvoiceCollect < Request
8
8
 
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.
11
+ define_attribute :billing_info_id, String
12
+
9
13
  # @!attribute three_d_secure_action_result_token_id
10
14
  # @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
11
15
  define_attribute :three_d_secure_action_result_token_id, String
@@ -43,7 +43,7 @@ module Recurly
43
43
  define_attribute :item_id, String
44
44
 
45
45
  # @!attribute origin
46
- # @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.
46
+ # @return [String] Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements. Origin `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to true. This origin creates a charge and opposite credit on the account to be used for future invoices.
47
47
  define_attribute :origin, String
48
48
 
49
49
  # @!attribute product_code
@@ -10,10 +10,6 @@ module Recurly
10
10
  # @return [String] Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
11
11
  define_attribute :accounting_code, String
12
12
 
13
- # @!attribute add_ons
14
- # @return [Array[AddOnCreate]] Add Ons
15
- define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
16
-
17
13
  # @!attribute allow_any_item_on_subscriptions
18
14
  # @return [Boolean] Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used.
19
15
  define_attribute :allow_any_item_on_subscriptions, :Boolean