From 6d60dd6f985f207509dd68098c9588298df26f55 Mon Sep 17 00:00:00 2001 From: Recurly Integrations Date: Tue, 30 Apr 2024 18:13:44 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly/client/operations.rb | 42 ++++++ lib/recurly/requests/invoice_create.rb | 2 +- lib/recurly/requests/purchase_create.rb | 2 +- .../requests/subscription_change_create.rb | 2 +- lib/recurly/requests/subscription_create.rb | 2 +- lib/recurly/requests/subscription_update.rb | 2 +- lib/recurly/resources/invoice.rb | 2 +- lib/recurly/resources/subscription.rb | 2 +- openapi/api.yaml | 128 +++++++++++++++++- 9 files changed, 175 insertions(+), 9 deletions(-) diff --git a/lib/recurly/client/operations.rb b/lib/recurly/client/operations.rb index 0448dba60..b7a096082 100644 --- a/lib/recurly/client/operations.rb +++ b/lib/recurly/client/operations.rb @@ -4277,6 +4277,48 @@ def create_pending_purchase(body:, **options) post(path, body, Requests::PurchaseCreate, **options) end + # Authorize a purchase + # + # {https://developers.recurly.com/api/v2021-02-25#operation/create_authorize_purchase create_authorize_purchase api documentation} + # + # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate} + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::InvoiceCollection] Returns the authorize invoice + # + def create_authorize_purchase(body:, **options) + path = "/purchases/authorize" + post(path, body, Requests::PurchaseCreate, **options) + end + + # Capture a purchase + # + # {https://developers.recurly.com/api/v2021-02-25#operation/create_capture_purchase create_capture_purchase api documentation} + # + # @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::InvoiceCollection] Returns the captured invoice + # + def create_capture_purchase(transaction_id:, **options) + path = interpolate_path("/purchases/{transaction_id}/capture", transaction_id: transaction_id) + post(path, **options) + end + + # Cancel Purchase + # + # {https://developers.recurly.com/api/v2021-02-25#operation/cancelPurchase cancelPurchase api documentation} + # + # @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. + # @param params [Hash] Optional query string parameters: + # + # @return [Resources::InvoiceCollection] Returns the cancelled invoice + # + def cancelPurchase(transaction_id:, **options) + path = interpolate_path("/purchases/{transaction_id}/cancel/", transaction_id: transaction_id) + post(path, **options) + end + # List the dates that have an available export to download. # # {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documentation} diff --git a/lib/recurly/requests/invoice_create.rb b/lib/recurly/requests/invoice_create.rb index 6ca8f0824..78f0e3f6e 100644 --- a/lib/recurly/requests/invoice_create.rb +++ b/lib/recurly/requests/invoice_create.rb @@ -27,7 +27,7 @@ class InvoiceCreate < Request define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute po_number diff --git a/lib/recurly/requests/purchase_create.rb b/lib/recurly/requests/purchase_create.rb index 8a7c07e37..8f00e5925 100644 --- a/lib/recurly/requests/purchase_create.rb +++ b/lib/recurly/requests/purchase_create.rb @@ -51,7 +51,7 @@ class PurchaseCreate < Request define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute po_number diff --git a/lib/recurly/requests/subscription_change_create.rb b/lib/recurly/requests/subscription_change_create.rb index 031a17c38..bfd5a2f6d 100644 --- a/lib/recurly/requests/subscription_change_create.rb +++ b/lib/recurly/requests/subscription_change_create.rb @@ -31,7 +31,7 @@ class SubscriptionChangeCreate < Request define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute plan_code diff --git a/lib/recurly/requests/subscription_create.rb b/lib/recurly/requests/subscription_create.rb index c56570a33..73e3f9a00 100644 --- a/lib/recurly/requests/subscription_create.rb +++ b/lib/recurly/requests/subscription_create.rb @@ -59,7 +59,7 @@ class SubscriptionCreate < Request define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute next_bill_date diff --git a/lib/recurly/requests/subscription_update.rb b/lib/recurly/requests/subscription_update.rb index a59f83a91..37d5d46e6 100644 --- a/lib/recurly/requests/subscription_update.rb +++ b/lib/recurly/requests/subscription_update.rb @@ -35,7 +35,7 @@ class SubscriptionUpdate < Request define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute next_bill_date diff --git a/lib/recurly/resources/invoice.rb b/lib/recurly/resources/invoice.rb index 404ceec9d..ea05221f6 100644 --- a/lib/recurly/resources/invoice.rb +++ b/lib/recurly/resources/invoice.rb @@ -87,7 +87,7 @@ class Invoice < Resource define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute number diff --git a/lib/recurly/resources/subscription.rb b/lib/recurly/resources/subscription.rb index d87cd37b3..86bb41fc2 100644 --- a/lib/recurly/resources/subscription.rb +++ b/lib/recurly/resources/subscription.rb @@ -111,7 +111,7 @@ class Subscription < Resource define_attribute :net_terms, Integer # @!attribute net_terms_type - # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled. + # @return [String] Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. define_attribute :net_terms_type, String # @!attribute object diff --git a/openapi/api.yaml b/openapi/api.yaml index ad7a4e4d7..0c948a941 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -15470,6 +15470,132 @@ paths: validation: %v\", e)\n\t\treturn nil, err\n\t}\n\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Created ChargeInvoice with UUID: %s.\\n\", collection.ChargeInvoice.Uuid)\n" + "/purchases/authorize": + post: + tags: + - purchase + operationId: create_authorize_purchase + summary: Authorize a purchase + description: |- + A purchase is a hybrid checkout containing at least one or more subscriptions or one-time charges (adjustments) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. A purchase is only a request data type and is not persistent in Recurly and an invoice collection will be the returned type. + + The authorize endpoint will create a pending purchase that can be activated at a later time once payment has been completed on an external source. + + For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/PurchaseCreate" + required: true + responses: + '200': + description: Returns the authorize invoice + content: + application/json: + schema: + "$ref": "#/components/schemas/InvoiceCollection" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: authorize purchase cannot be completed for the specified reason. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/purchases/{transaction_id}/capture": + post: + tags: + - purchase + parameters: + - "$ref": "#/components/parameters/transaction_id" + operationId: create_capture_purchase + summary: Capture a purchase + description: |- + A purchase is a hybrid checkout containing at least one or more + subscriptions or one-time charges (adjustments) and supports both coupon + and gift card redemptions. All items purchased will be on one invoice + and paid for with one transaction. A purchase is only a request data + type and is not persistent in Recurly and an invoice collection will be + the returned type. + + + Capture an open Authorization request + responses: + '200': + description: Returns the captured invoice + content: + application/json: + schema: + "$ref": "#/components/schemas/InvoiceCollection" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Capture purchase cannot be completed for the specified reason. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/purchases/{transaction_id}/cancel/": + parameters: + - "$ref": "#/components/parameters/transaction_id" + post: + summary: Cancel Purchase + description: | + A purchase is a hybrid checkout containing at least one or more subscriptions or one-time charges (adjustments) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. A purchase is only a request data type and is not persistent in Recurly and an invoice collection will be the returned type. + + Cancel an open Authorization request + tags: + - purchase + operationId: cancelPurchase + responses: + '200': + description: Returns the cancelled invoice + content: + application/json: + schema: + "$ref": "#/components/schemas/InvoiceCollection" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Cancel purchase cannot be completed for the specified reason. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/export_dates": get: tags: @@ -25178,8 +25304,6 @@ components: Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. - - This field is only available when the EOM Net Terms feature is enabled. enum: - net - eom