From 8aea780cbd528bcf4b8690021387b136cf2ce86b Mon Sep 17 00:00:00 2001 From: Recurly Integrations Date: Tue, 30 Apr 2024 18:14:02 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- openapi/api.yaml | 128 +++++++++++++++++- src/main/java/com/recurly/v3/Client.java | 47 +++++++ .../recurly/v3/requests/InvoiceCreate.java | 5 - .../recurly/v3/requests/PurchaseCreate.java | 5 - .../v3/requests/SubscriptionChangeCreate.java | 5 - .../v3/requests/SubscriptionCreate.java | 5 - .../v3/requests/SubscriptionUpdate.java | 5 - .../com/recurly/v3/resources/Invoice.java | 5 - .../recurly/v3/resources/Subscription.java | 5 - 9 files changed, 173 insertions(+), 37 deletions(-) diff --git a/openapi/api.yaml b/openapi/api.yaml index ad7a4e4..0c948a9 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 diff --git a/src/main/java/com/recurly/v3/Client.java b/src/main/java/com/recurly/v3/Client.java index 5f82c93..41a9a3c 100644 --- a/src/main/java/com/recurly/v3/Client.java +++ b/src/main/java/com/recurly/v3/Client.java @@ -2625,6 +2625,53 @@ public InvoiceCollection createPendingPurchase(PurchaseCreate body) { return this.makeRequest("POST", path, body, returnType); } + /** + * Authorize a purchase + * + * @see create_authorize_purchase api documentation + * @param body The body of the request. + * @return Returns the authorize invoice + */ + public InvoiceCollection createAuthorizePurchase(PurchaseCreate body) { + final String url = "/purchases/authorize"; + final HashMap urlParams = new HashMap(); + final String path = this.interpolatePath(url, urlParams); + Type returnType = InvoiceCollection.class; + return this.makeRequest("POST", path, body, returnType); + } + + /** + * Capture a purchase + * + * @see create_capture_purchase api documentation + * @param transactionId Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + * @return Returns the captured invoice + */ + public InvoiceCollection createCapturePurchase(String transactionId) { + final String url = "/purchases/{transaction_id}/capture"; + final HashMap urlParams = new HashMap(); + urlParams.put("transaction_id", transactionId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = InvoiceCollection.class; + return this.makeRequest("POST", path, returnType); + } + + /** + * Cancel Purchase + * + * @see cancelPurchase api documentation + * @param transactionId Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`. + * @return Returns the cancelled invoice + */ + public InvoiceCollection cancelpurchase(String transactionId) { + final String url = "/purchases/{transaction_id}/cancel/"; + final HashMap urlParams = new HashMap(); + urlParams.put("transaction_id", transactionId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = InvoiceCollection.class; + return this.makeRequest("POST", path, returnType); + } + /** * List the dates that have an available export to download. * diff --git a/src/main/java/com/recurly/v3/requests/InvoiceCreate.java b/src/main/java/com/recurly/v3/requests/InvoiceCreate.java index 0d28d5a..a90652e 100644 --- a/src/main/java/com/recurly/v3/requests/InvoiceCreate.java +++ b/src/main/java/com/recurly/v3/requests/InvoiceCreate.java @@ -76,8 +76,6 @@ public class InvoiceCreate extends Request { * 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. */ @SerializedName("net_terms_type") @Expose @@ -227,8 +225,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -239,7 +235,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/requests/PurchaseCreate.java b/src/main/java/com/recurly/v3/requests/PurchaseCreate.java index b07bd84..9b6460e 100644 --- a/src/main/java/com/recurly/v3/requests/PurchaseCreate.java +++ b/src/main/java/com/recurly/v3/requests/PurchaseCreate.java @@ -105,8 +105,6 @@ public class PurchaseCreate extends Request { * 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. */ @SerializedName("net_terms_type") @Expose @@ -329,8 +327,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -341,7 +337,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java b/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java index 01e4735..31ed79d 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionChangeCreate.java @@ -81,8 +81,6 @@ public class SubscriptionChangeCreate extends Request { * 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. */ @SerializedName("net_terms_type") @Expose @@ -293,8 +291,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -305,7 +301,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java b/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java index 025ce87..cf0bc3d 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionCreate.java @@ -122,8 +122,6 @@ public class SubscriptionCreate extends Request { * 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. */ @SerializedName("net_terms_type") @Expose @@ -465,8 +463,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -477,7 +473,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java b/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java index 9ee7410..c5efe37 100644 --- a/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java +++ b/src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java @@ -88,8 +88,6 @@ public class SubscriptionUpdate extends Request { * 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. */ @SerializedName("net_terms_type") @Expose @@ -288,8 +286,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -300,7 +296,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/resources/Invoice.java b/src/main/java/com/recurly/v3/resources/Invoice.java index 1d7dab1..870e4de 100644 --- a/src/main/java/com/recurly/v3/resources/Invoice.java +++ b/src/main/java/com/recurly/v3/resources/Invoice.java @@ -164,8 +164,6 @@ public class Invoice extends Resource { * 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. */ @SerializedName("net_terms_type") @Expose @@ -602,8 +600,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -614,7 +610,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType; diff --git a/src/main/java/com/recurly/v3/resources/Subscription.java b/src/main/java/com/recurly/v3/resources/Subscription.java index 7882a84..5eb16b1 100644 --- a/src/main/java/com/recurly/v3/resources/Subscription.java +++ b/src/main/java/com/recurly/v3/resources/Subscription.java @@ -190,8 +190,6 @@ public class Subscription extends Resource { * 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. */ @SerializedName("net_terms_type") @Expose @@ -689,8 +687,6 @@ public void setNetTerms(final Integer netTerms) { * 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. */ public Constants.NetTermsType getNetTermsType() { return this.netTermsType; @@ -701,7 +697,6 @@ public Constants.NetTermsType getNetTermsType() { * (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. */ public void setNetTermsType(final Constants.NetTermsType netTermsType) { this.netTermsType = netTermsType;