Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 89 additions & 40 deletions lib/recurly/client/operations.rb

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions lib/recurly/errors/api_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,67 +21,36 @@ module Errors
}

class ResponseError < Errors::APIError; end

class ServerError < ResponseError; end

class InternalServerError < ServerError; end

class ServiceNotAvailableError < InternalServerError; end

class TaxServiceError < InternalServerError; end

class BadGatewayError < ServerError; end

class ServiceUnavailableError < ServerError; end

class RedirectionError < ResponseError; end

class NotModifiedError < ResponseError; end

class ClientError < Errors::APIError; end

class BadRequestError < ClientError; end

class InvalidContentTypeError < BadRequestError; end

class UnauthorizedError < ClientError; end

class PaymentRequiredError < ClientError; end

class ForbiddenError < ClientError; end

class InvalidApiKeyError < ForbiddenError; end

class InvalidPermissionsError < ForbiddenError; end

class NotFoundError < ClientError; end

class NotAcceptableError < ClientError; end

class UnknownApiVersionError < NotAcceptableError; end

class UnavailableInApiVersionError < NotAcceptableError; end

class InvalidApiVersionError < NotAcceptableError; end

class PreconditionFailedError < ClientError; end

class UnprocessableEntityError < ClientError; end

class ValidationError < UnprocessableEntityError; end

class MissingFeatureError < UnprocessableEntityError; end

class TransactionError < UnprocessableEntityError; end

class SimultaneousRequestError < UnprocessableEntityError; end

class ImmutableSubscriptionError < UnprocessableEntityError; end

class InvalidTokenError < UnprocessableEntityError; end

class TooManyRequestsError < ClientError; end

class RateLimitedError < TooManyRequestsError; end
end
end
2 changes: 1 addition & 1 deletion lib/recurly/requests/add_on_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AddOnCreate < Request
define_attribute :revenue_schedule_type, String

# @!attribute tax_code
# @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 `tax_code` must be absent.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes. If `item_code`/`item_id` is part of the request then `tax_code` must be absent.
define_attribute :tax_code, String

# @!attribute tier_type
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/add_on_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AddOnUpdate < Request
define_attribute :revenue_schedule_type, String

# @!attribute tax_code
# @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.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes. If an `Item` is associated to the `AddOn` then `tax_code` must be absent.
define_attribute :tax_code, String

# @!attribute tiers
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Address < Request
define_attribute :first_name, String

# @!attribute geo_code
# @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
# @return [String] Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled.
define_attribute :geo_code, String

# @!attribute last_name
Expand Down
6 changes: 5 additions & 1 deletion lib/recurly/requests/billing_info_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BillingInfoCreate < Request
define_attribute :gateway_attributes, :GatewayAttributes

# @!attribute gateway_code
# @return [String] An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`.
# @return [String] An identifier for a specific payment gateway.
define_attribute :gateway_code, String

# @!attribute gateway_token
Expand Down Expand Up @@ -106,6 +106,10 @@ class BillingInfoCreate < Request
# @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
define_attribute :sort_code, String

# @!attribute store_billing_info
# @return [Boolean] Whether to store this billing info onto its associated account. Defaults to `true`.
define_attribute :store_billing_info, :Boolean

# @!attribute tax_identifier
# @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.
define_attribute :tax_identifier, String
Expand Down
4 changes: 4 additions & 0 deletions lib/recurly/requests/billing_info_verify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class BillingInfoVerify < Request
# @!attribute gateway_code
# @return [String] An identifier for a specific payment gateway.
define_attribute :gateway_code, String

# @!attribute three_d_secure_action_result_token_id
# @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
define_attribute :three_d_secure_action_result_token_id, String
end
end
end
26 changes: 26 additions & 0 deletions lib/recurly/requests/billing_info_verify_cvv.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Requests
class BillingInfoVerifyCVV < Request

# @!attribute gateway_code
# @return [String] An identifier for a specific payment gateway.
define_attribute :gateway_code, String

# @!attribute three_d_secure_action_result_token_id
# @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
define_attribute :three_d_secure_action_result_token_id, String

# @!attribute token_id
# @return [String] A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token).
define_attribute :token_id, String

# @!attribute verification_value
# @return [String] Unique security code for a credit card.
define_attribute :verification_value, String
end
end
end
18 changes: 18 additions & 0 deletions lib/recurly/requests/credit_application_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Requests
class CreditApplicationPolicy < Request

# @!attribute allowed_origins
# @return [Array[String]] Optional array of credit invoice origin types to allow when mode is `all`. If not specified when mode is `all`, credits from all origins are applied. Only valid when mode is `all`.
define_attribute :allowed_origins, Array, { :item_type => String }

# @!attribute mode
# @return [String]
define_attribute :mode, String
end
end
end
8 changes: 8 additions & 0 deletions lib/recurly/requests/custom_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ class CustomField < Request
# @return [String] Fields must be created in the UI before values can be assigned to them.
define_attribute :name, String

# @!attribute source_record_id
# @return [String] The UUID of the record this custom field was automatically copied from. Only present when the field was copied from another record.
define_attribute :source_record_id, String

# @!attribute source_record_type
# @return [String] The type of record this custom field was automatically copied from. Only present when the field was copied from another record.
define_attribute :source_record_type, String

# @!attribute value
# @return [String] Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
define_attribute :value, String
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/invoice_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class InvoiceAddress < Request
define_attribute :first_name, String

# @!attribute geo_code
# @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
# @return [String] Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled.
define_attribute :geo_code, String

# @!attribute last_name
Expand Down
10 changes: 9 additions & 1 deletion lib/recurly/requests/invoice_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class InvoiceCreate < Request
# @return [String] An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
define_attribute :collection_method, String

# @!attribute credit_application_policy
# @return [CreditApplicationPolicy] Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied. - `all`: All available credit invoices are applied (default) - `none`: No credit invoices are applied automatically
define_attribute :credit_application_policy, :CreditApplicationPolicy

# @!attribute credit_customer_notes
# @return [String] This will default to the Customer Notes text specified on the Invoice Settings for credit invoices. Specify customer notes to add or override Customer Notes on credit invoices.
define_attribute :credit_customer_notes, String
Expand All @@ -23,7 +27,7 @@ class InvoiceCreate < Request
define_attribute :currency, String

# @!attribute net_terms
# @return [Integer] Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
# @return [Integer] Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it's created. If an invoice is due net 30, it will become past due at 31 days exactly.
define_attribute :net_terms, Integer

# @!attribute po_number
Expand All @@ -37,6 +41,10 @@ class InvoiceCreate < Request
# @!attribute vat_reverse_charge_notes
# @return [String] VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
define_attribute :vat_reverse_charge_notes, String

# @!attribute vertex_transaction_type
# @return [String] Used by Vertex for tax calculations. Possible values are sale, rental, lease.
define_attribute :vertex_transaction_type, String
end
end
end
2 changes: 1 addition & 1 deletion lib/recurly/requests/item_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ItemCreate < Request
define_attribute :revenue_schedule_type, String

# @!attribute tax_code
# @return [String] Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes.
define_attribute :tax_code, String

# @!attribute tax_exempt
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/item_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ItemUpdate < Request
define_attribute :revenue_schedule_type, String

# @!attribute tax_code
# @return [String] Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes.
define_attribute :tax_code, String

# @!attribute tax_exempt
Expand Down
6 changes: 5 additions & 1 deletion lib/recurly/requests/line_item_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LineItemCreate < Request
define_attribute :start_date, DateTime

# @!attribute tax_code
# @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`.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes.
define_attribute :tax_code, String

# @!attribute tax_exempt
Expand All @@ -85,6 +85,10 @@ class LineItemCreate < Request
# @!attribute unit_amount
# @return [Float] A positive or negative amount with `type=charge` will result in a positive `unit_amount`. A positive or negative amount with `type=credit` will result in a negative `unit_amount`. If `item_code`/`item_id` is present, `unit_amount` can be passed in, to override the `Item`'s `unit_amount`. If `item_code`/`item_id` is not present then `unit_amount` is required.
define_attribute :unit_amount, Float

# @!attribute vertex_transaction_type
# @return [String] Used by Vertex for tax calculations. Possible values are sale, rental, lease.
define_attribute :vertex_transaction_type, String
end
end
end
2 changes: 1 addition & 1 deletion lib/recurly/requests/plan_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PlanCreate < Request
define_attribute :setup_fee_revenue_schedule_type, String

# @!attribute tax_code
# @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`.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes.
define_attribute :tax_code, String

# @!attribute tax_exempt
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/plan_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PlanUpdate < Request
define_attribute :setup_fee_revenue_schedule_type, String

# @!attribute tax_code
# @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`.
# @return [String] Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of `unknown`, `physical`, or `digital` tax codes.
define_attribute :tax_code, String

# @!attribute tax_exempt
Expand Down
8 changes: 8 additions & 0 deletions lib/recurly/requests/purchase_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class PurchaseCreate < Request
# @return [Array[String]] A list of coupon_codes to be redeemed on the subscription or account during the purchase.
define_attribute :coupon_codes, Array, { :item_type => String }

# @!attribute credit_application_policy_override
# @return [CreditApplicationPolicy] Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied. - `all`: All available credit invoices are applied (default) - `none`: No credit invoices are applied automatically
define_attribute :credit_application_policy_override, :CreditApplicationPolicy

# @!attribute credit_customer_notes
# @return [String] Notes to be put on the credit invoice resulting from credits in the purchase, if any.
define_attribute :credit_customer_notes, String
Expand Down Expand Up @@ -73,6 +77,10 @@ class PurchaseCreate < Request
# @!attribute vat_reverse_charge_notes
# @return [String] VAT reverse charge notes for cross border European tax settlement.
define_attribute :vat_reverse_charge_notes, String

# @!attribute vertex_transaction_type
# @return [String] Used by Vertex for tax calculations. Possible values are sale, rental, lease.
define_attribute :vertex_transaction_type, String
end
end
end
2 changes: 1 addition & 1 deletion lib/recurly/requests/shipping_address_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ShippingAddressCreate < Request
define_attribute :first_name, String

# @!attribute geo_code
# @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
# @return [String] Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled.
define_attribute :geo_code, String

# @!attribute last_name
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/shipping_address_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ShippingAddressUpdate < Request
define_attribute :first_name, String

# @!attribute geo_code
# @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
# @return [String] Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled.
define_attribute :geo_code, String

# @!attribute id
Expand Down
Loading
Loading