From e8b2f1b78c75bd4f1191625a32d55446c052e752 Mon Sep 17 00:00:00 2001 From: Recurly Integrations Date: Tue, 30 Apr 2024 18:13:21 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- Recurly/Client.cs | 102 ++++++++++++++ Recurly/IClient.cs | 60 ++++++++ Recurly/Resources/Invoice.cs | 2 - Recurly/Resources/InvoiceCreate.cs | 2 - Recurly/Resources/PurchaseCreate.cs | 2 - Recurly/Resources/Subscription.cs | 2 - Recurly/Resources/SubscriptionChangeCreate.cs | 2 - Recurly/Resources/SubscriptionCreate.cs | 2 - Recurly/Resources/SubscriptionUpdate.cs | 2 - openapi/api.yaml | 128 +++++++++++++++++- 10 files changed, 288 insertions(+), 16 deletions(-) diff --git a/Recurly/Client.cs b/Recurly/Client.cs index 3b736ba9..9676e286 100644 --- a/Recurly/Client.cs +++ b/Recurly/Client.cs @@ -4526,6 +4526,108 @@ public InvoiceCollection CreatePendingPurchase(PurchaseCreate body, RequestOptio + /// + /// Authorize a purchase create_authorize_purchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the authorize invoice + /// + /// Thrown when the request is invalid. + public InvoiceCollection CreateAuthorizePurchase(PurchaseCreate body, RequestOptions options = null) + { + var urlParams = new Dictionary { }; + var url = this.InterpolatePath("/purchases/authorize", urlParams); + return MakeRequest(Method.POST, url, body, null, options); + } + + + + /// + /// Authorize a purchase create_authorize_purchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the authorize invoice + /// + /// Thrown when the request is invalid. + public Task CreateAuthorizePurchaseAsync(PurchaseCreate body, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null) + { + var urlParams = new Dictionary { }; + var url = this.InterpolatePath("/purchases/authorize", urlParams); + return MakeRequestAsync(Method.POST, url, body, null, options, cancellationToken); + } + + + + /// + /// Capture a purchase create_capture_purchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the captured invoice + /// + /// Thrown when the request is invalid. + public InvoiceCollection CreateCapturePurchase(string transactionId, RequestOptions options = null) + { + var urlParams = new Dictionary { { "transaction_id", transactionId } }; + var url = this.InterpolatePath("/purchases/{transaction_id}/capture", urlParams); + return MakeRequest(Method.POST, url, null, null, options); + } + + + + /// + /// Capture a purchase create_capture_purchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the captured invoice + /// + /// Thrown when the request is invalid. + public Task CreateCapturePurchaseAsync(string transactionId, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null) + { + var urlParams = new Dictionary { { "transaction_id", transactionId } }; + var url = this.InterpolatePath("/purchases/{transaction_id}/capture", urlParams); + return MakeRequestAsync(Method.POST, url, null, null, options, cancellationToken); + } + + + + /// + /// Cancel Purchase cancelPurchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the cancelled invoice + /// + /// Thrown when the request is invalid. + public InvoiceCollection Cancelpurchase(string transactionId, RequestOptions options = null) + { + var urlParams = new Dictionary { { "transaction_id", transactionId } }; + var url = this.InterpolatePath("/purchases/{transaction_id}/cancel/", urlParams); + return MakeRequest(Method.POST, url, null, null, options); + } + + + + /// + /// Cancel Purchase cancelPurchase api documentation + /// + /// Optional Parameters for the request + /// + /// Returns the cancelled invoice + /// + /// Thrown when the request is invalid. + public Task CancelpurchaseAsync(string transactionId, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null) + { + var urlParams = new Dictionary { { "transaction_id", transactionId } }; + var url = this.InterpolatePath("/purchases/{transaction_id}/cancel/", urlParams); + return MakeRequestAsync(Method.POST, url, null, null, options, cancellationToken); + } + + + /// /// List the dates that have an available export to download. get_export_dates api documentation /// diff --git a/Recurly/IClient.cs b/Recurly/IClient.cs index 86457ea1..5d458774 100644 --- a/Recurly/IClient.cs +++ b/Recurly/IClient.cs @@ -2942,6 +2942,66 @@ public interface IClient /// Thrown when the request is invalid. Task CreatePendingPurchaseAsync(PurchaseCreate body, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null); + /// + /// Authorize a purchase create_authorize_purchase api documentation + /// + /// The body of the request. + /// + /// Returns the authorize invoice + /// + /// Thrown when the request is invalid. + InvoiceCollection CreateAuthorizePurchase(PurchaseCreate body, RequestOptions options = null); + + /// + /// Authorize a purchase create_authorize_purchase api documentation + /// + /// The body of the request. + /// + /// Returns the authorize invoice + /// + /// Thrown when the request is invalid. + Task CreateAuthorizePurchaseAsync(PurchaseCreate body, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null); + + /// + /// Capture a purchase create_capture_purchase api documentation + /// + /// Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + /// + /// Returns the captured invoice + /// + /// Thrown when the request is invalid. + InvoiceCollection CreateCapturePurchase(string transactionId, RequestOptions options = null); + + /// + /// Capture a purchase create_capture_purchase api documentation + /// + /// Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + /// + /// Returns the captured invoice + /// + /// Thrown when the request is invalid. + Task CreateCapturePurchaseAsync(string transactionId, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null); + + /// + /// Cancel Purchase cancelPurchase api documentation + /// + /// Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + /// + /// Returns the cancelled invoice + /// + /// Thrown when the request is invalid. + InvoiceCollection Cancelpurchase(string transactionId, RequestOptions options = null); + + /// + /// Cancel Purchase cancelPurchase api documentation + /// + /// Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + /// + /// Returns the cancelled invoice + /// + /// Thrown when the request is invalid. + Task CancelpurchaseAsync(string transactionId, CancellationToken cancellationToken = default(CancellationToken), RequestOptions options = null); + /// /// List the dates that have an available export to download. get_export_dates api documentation /// diff --git a/Recurly/Resources/Invoice.cs b/Recurly/Resources/Invoice.cs index 34c56081..f7fa1f4a 100644 --- a/Recurly/Resources/Invoice.cs +++ b/Recurly/Resources/Invoice.cs @@ -116,8 +116,6 @@ public class Invoice : Resource /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/InvoiceCreate.cs b/Recurly/Resources/InvoiceCreate.cs index 7f03f209..1847218b 100644 --- a/Recurly/Resources/InvoiceCreate.cs +++ b/Recurly/Resources/InvoiceCreate.cs @@ -56,8 +56,6 @@ public class InvoiceCreate : Request /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/PurchaseCreate.cs b/Recurly/Resources/PurchaseCreate.cs index 8bf4989c..39c08ed5 100644 --- a/Recurly/Resources/PurchaseCreate.cs +++ b/Recurly/Resources/PurchaseCreate.cs @@ -80,8 +80,6 @@ public class PurchaseCreate : Request /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/Subscription.cs b/Recurly/Resources/Subscription.cs index 67faec9b..0de302db 100644 --- a/Recurly/Resources/Subscription.cs +++ b/Recurly/Resources/Subscription.cs @@ -140,8 +140,6 @@ public class Subscription : Resource /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/SubscriptionChangeCreate.cs b/Recurly/Resources/SubscriptionChangeCreate.cs index 698b891d..e70762db 100644 --- a/Recurly/Resources/SubscriptionChangeCreate.cs +++ b/Recurly/Resources/SubscriptionChangeCreate.cs @@ -69,8 +69,6 @@ public class SubscriptionChangeCreate : Request /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/SubscriptionCreate.cs b/Recurly/Resources/SubscriptionCreate.cs index eda510d1..2288f872 100644 --- a/Recurly/Resources/SubscriptionCreate.cs +++ b/Recurly/Resources/SubscriptionCreate.cs @@ -88,8 +88,6 @@ public class SubscriptionCreate : Request /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/Recurly/Resources/SubscriptionUpdate.cs b/Recurly/Resources/SubscriptionUpdate.cs index 55d1cf77..33f0e479 100644 --- a/Recurly/Resources/SubscriptionUpdate.cs +++ b/Recurly/Resources/SubscriptionUpdate.cs @@ -64,8 +64,6 @@ public class SubscriptionUpdate : Request /// 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. /// [JsonProperty("net_terms_type")] [JsonConverter(typeof(RecurlyStringEnumConverter))] diff --git a/openapi/api.yaml b/openapi/api.yaml index ad7a4e4d..0c948a94 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