Skip to content

Commit

Permalink
Merge pull request #271 from recurly/v3-v2021-02-25-8899612454
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25  (Auth & Capture)
  • Loading branch information
amandamfielding authored Apr 30, 2024
2 parents 31d5646 + 8aea780 commit af3f677
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 37 deletions.
128 changes: 126 additions & 2 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/com/recurly/v3/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -2625,6 +2625,53 @@ public InvoiceCollection createPendingPurchase(PurchaseCreate body) {
return this.makeRequest("POST", path, body, returnType);
}

/**
* Authorize a purchase
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/create_authorize_purchase">create_authorize_purchase api documentation</a>
* @param body The body of the request.
* @return Returns the authorize invoice
*/
public InvoiceCollection createAuthorizePurchase(PurchaseCreate body) {
final String url = "/purchases/authorize";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type returnType = InvoiceCollection.class;
return this.makeRequest("POST", path, body, returnType);
}

/**
* Capture a purchase
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/create_capture_purchase">create_capture_purchase api documentation</a>
* @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<String, String> urlParams = new HashMap<String, String>();
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 <a href="https://developers.recurly.com/api/v2021-02-25#operation/cancelPurchase">cancelPurchase api documentation</a>
* @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<String, String> urlParams = new HashMap<String, String>();
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.
*
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/requests/InvoiceCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/requests/PurchaseCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/requests/SubscriptionCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/resources/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/recurly/v3/resources/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
@SerializedName("net_terms_type")
@Expose
Expand Down Expand Up @@ -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.
*
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public Constants.NetTermsType getNetTermsType() {
return this.netTermsType;
Expand All @@ -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.
* <p>This field is only available when the EOM Net Terms feature is enabled.
*/
public void setNetTermsType(final Constants.NetTermsType netTermsType) {
this.netTermsType = netTermsType;
Expand Down

0 comments on commit af3f677

Please sign in to comment.