Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Features #93

Merged
merged 1 commit into from
May 29, 2020
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
7,122 changes: 4,366 additions & 2,756 deletions openapi/api.yaml

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/main/java/com/recurly/v3/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,23 @@ public Invoice voidInvoice(String invoiceId) {
return this.makeRequest("PUT", path, returnType);
}

/**
* Record an external payment for a manual invoices.
*
* @see <a href="https://developers.recurly.com/api/v2019-10-10#operation/record_external_transaction">record_external_transaction api documentation</a>
* @param invoiceId Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
* @param body The body of the request.
* @return The recorded transaction.
*/
public Transaction recordExternalTransaction(String invoiceId, ExternalTransaction body) {
final String url = "/invoices/{invoice_id}/transactions";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("invoice_id", invoiceId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = Transaction.class;
return this.makeRequest("POST", path, body, returnType);
}

/**
* List an invoice's line items
*
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/recurly/v3/QueryParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public void setSort(final String sort) {
this.add("sort", sort);
}

public void setState(final String state) {
this.add("state", state);
}

public void setBeginTime(final DateTime beginTime) {
this.add("begin_time", beginTime);
}
Expand Down Expand Up @@ -70,10 +74,6 @@ public void setOriginal(final String original) {
this.add("original", original);
}

public void setState(final String state) {
this.add("state", state);
}

public void setSuccess(final String success) {
this.add("success", success);
}
Expand Down
31 changes: 18 additions & 13 deletions src/main/java/com/recurly/v3/requests/AddOnCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@ public class AddOnCreate extends Request {
private Boolean displayQuantity;

/**
* Unique code to identify an item. Avaliable when the `Catalog: Item Add-Ons` feature is enabled.
* If `item_id` and `item_code` are both present, `item_id` will be used.
* Unique code to identify an item. Avaliable when the `Credit Invoices` and `Subscription Billing
* Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be
* used.
*/
@SerializedName("item_code")
@Expose
private String itemCode;

/**
* System-generated unique identifier for an item. Available when the `Catalog: Item Add-Ons`
* feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
* System-generated unique identifier for an item. Available when the `Credit Invoices` and
* `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both
* present, `item_id` will be used.
*/
@SerializedName("item_id")
@Expose
Expand Down Expand Up @@ -200,33 +202,36 @@ public void setDisplayQuantity(final Boolean displayQuantity) {
}

/**
* Unique code to identify an item. Avaliable when the `Catalog: Item Add-Ons` feature is enabled.
* If `item_id` and `item_code` are both present, `item_id` will be used.
* Unique code to identify an item. Avaliable when the `Credit Invoices` and `Subscription Billing
* Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be
* used.
*/
public String getItemCode() {
return this.itemCode;
}

/**
* @param itemCode Unique code to identify an item. Avaliable when the `Catalog: Item Add-Ons`
* feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
* @param itemCode Unique code to identify an item. Avaliable when the `Credit Invoices` and
* `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both
* present, `item_id` will be used.
*/
public void setItemCode(final String itemCode) {
this.itemCode = itemCode;
}

/**
* System-generated unique identifier for an item. Available when the `Catalog: Item Add-Ons`
* feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
* System-generated unique identifier for an item. Available when the `Credit Invoices` and
* `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both
* present, `item_id` will be used.
*/
public String getItemId() {
return this.itemId;
}

/**
* @param itemId System-generated unique identifier for an item. Available when the `Catalog: Item
* Add-Ons` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will
* be used.
* @param itemId System-generated unique identifier for an item. Available when the `Credit
* Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` and
* `item_code` are both present, `item_id` will be used.
*/
public void setItemId(final String itemId) {
this.itemId = itemId;
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/com/recurly/v3/requests/BillingInfoCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public class BillingInfoCreate extends Request {
@Expose
private String threeDSecureActionResultTokenId;

/** A token [generated by Recurly.js](https://docs.recurly.com/js/#getting-a-token). */
/**
* A token [generated by
* Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token).
*/
@SerializedName("token_id")
@Expose
private String tokenId;
Expand Down Expand Up @@ -358,13 +361,17 @@ public void setThreeDSecureActionResultTokenId(final String threeDSecureActionRe
this.threeDSecureActionResultTokenId = threeDSecureActionResultTokenId;
}

/** A token [generated by Recurly.js](https://docs.recurly.com/js/#getting-a-token). */
/**
* A token [generated by
* Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token).
*/
public String getTokenId() {
return this.tokenId;
}

/**
* @param tokenId A token [generated by Recurly.js](https://docs.recurly.com/js/#getting-a-token).
* @param tokenId A token [generated by
* Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token).
*/
public void setTokenId(final String tokenId) {
this.tokenId = tokenId;
Expand Down
78 changes: 78 additions & 0 deletions src/main/java/com/recurly/v3/requests/ExternalTransaction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* 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.
*/
package com.recurly.v3.requests;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.recurly.v3.Request;
import com.recurly.v3.resources.*;
import org.joda.time.DateTime;

public class ExternalTransaction extends Request {

/** The total amount of the transcaction. Cannot excceed the invoice total. */
@SerializedName("amount")
@Expose
private Float amount;

/** Datetime that the external payment was collected. Defaults to current datetime. */
@SerializedName("collected_at")
@Expose
private DateTime collectedAt;

/** Used as the transaction's description. */
@SerializedName("description")
@Expose
private String description;

/** Payment method used for the external transaction. */
@SerializedName("payment_method")
@Expose
private String paymentMethod;

/** The total amount of the transcaction. Cannot excceed the invoice total. */
public Float getAmount() {
return this.amount;
}

/** @param amount The total amount of the transcaction. Cannot excceed the invoice total. */
public void setAmount(final Float amount) {
this.amount = amount;
}

/** Datetime that the external payment was collected. Defaults to current datetime. */
public DateTime getCollectedAt() {
return this.collectedAt;
}

/**
* @param collectedAt Datetime that the external payment was collected. Defaults to current
* datetime.
*/
public void setCollectedAt(final DateTime collectedAt) {
this.collectedAt = collectedAt;
}

/** Used as the transaction's description. */
public String getDescription() {
return this.description;
}

/** @param description Used as the transaction's description. */
public void setDescription(final String description) {
this.description = description;
}

/** Payment method used for the external transaction. */
public String getPaymentMethod() {
return this.paymentMethod;
}

/** @param paymentMethod Payment method used for the external transaction. */
public void setPaymentMethod(final String paymentMethod) {
this.paymentMethod = paymentMethod;
}
}
31 changes: 25 additions & 6 deletions src/main/java/com/recurly/v3/requests/SubscriptionAddOnUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@

public class SubscriptionAddOnUpdate extends Request {

/** Add-on code */
/**
* If a code is provided without an id, the subscription add-on attributes will be set to the
* current value for those attributes on the plan add-on unless provided in the request.
*/
@SerializedName("code")
@Expose
private String code;

/** Set this to include or modify an existing subscription add-on. */
/**
* When an id is provided, the existing subscription add-on attributes will persist unless
* overridden in the request.
*/
@SerializedName("id")
@Expose
private String id;
Expand All @@ -43,22 +49,35 @@ public class SubscriptionAddOnUpdate extends Request {
@Expose
private Float unitAmount;

/** Add-on code */
/**
* If a code is provided without an id, the subscription add-on attributes will be set to the
* current value for those attributes on the plan add-on unless provided in the request.
*/
public String getCode() {
return this.code;
}

/** @param code Add-on code */
/**
* @param code If a code is provided without an id, the subscription add-on attributes will be set
* to the current value for those attributes on the plan add-on unless provided in the
* request.
*/
public void setCode(final String code) {
this.code = code;
}

/** Set this to include or modify an existing subscription add-on. */
/**
* When an id is provided, the existing subscription add-on attributes will persist unless
* overridden in the request.
*/
public String getId() {
return this.id;
}

/** @param id Set this to include or modify an existing subscription add-on. */
/**
* @param id When an id is provided, the existing subscription add-on attributes will persist
* unless overridden in the request.
*/
public void setId(final String id) {
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ public class SubscriptionChangeCreate extends Request {
* If you provide a value for this field it will replace any existing add-ons. So, when adding or
* modifying an add-on, you need to include the existing subscription add-ons. Unchanged add-ons
* can be included just using the subscription add-on's ID: `{"id": "abc123"}`.
*
* <p>If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the
* subscription add-on attributes will be set to the current values of the plan add-on unless
* provided in the request.
*
* <p>- If an `id` is passed, any attributes not passed in will pull from the existing
* subscription add-on - If a `code` is passed, any attributes not passed in will pull from the
* current values of the plan add-on - Attributes passed in as part of the request will override
* either of the above scenarios
*/
@SerializedName("add_ons")
@Expose
Expand Down Expand Up @@ -113,6 +122,15 @@ public class SubscriptionChangeCreate extends Request {
* If you provide a value for this field it will replace any existing add-ons. So, when adding or
* modifying an add-on, you need to include the existing subscription add-ons. Unchanged add-ons
* can be included just using the subscription add-on's ID: `{"id": "abc123"}`.
*
* <p>If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the
* subscription add-on attributes will be set to the current values of the plan add-on unless
* provided in the request.
*
* <p>- If an `id` is passed, any attributes not passed in will pull from the existing
* subscription add-on - If a `code` is passed, any attributes not passed in will pull from the
* current values of the plan add-on - Attributes passed in as part of the request will override
* either of the above scenarios
*/
public List<SubscriptionAddOnUpdate> getAddOns() {
return this.addOns;
Expand All @@ -123,6 +141,13 @@ public List<SubscriptionAddOnUpdate> getAddOns() {
* when adding or modifying an add-on, you need to include the existing subscription add-ons.
* Unchanged add-ons can be included just using the subscription add-on's ID: `{"id":
* "abc123"}`.
* <p>If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`,
* the subscription add-on attributes will be set to the current values of the plan add-on
* unless provided in the request.
* <p>- If an `id` is passed, any attributes not passed in will pull from the existing
* subscription add-on - If a `code` is passed, any attributes not passed in will pull from
* the current values of the plan add-on - Attributes passed in as part of the request will
* override either of the above scenarios
*/
public void setAddOns(final List<SubscriptionAddOnUpdate> addOns) {
this.addOns = addOns;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/recurly/v3/resources/LineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public class LineItem extends Resource {

/**
* For plan-related line items this will be the plan's code, for add-on related line items it will
* be the add-on's code. For item-related line itmes it will be the item's `external_sku`.
* be the add-on's code. For item-related line items it will be the item's `external_sku`.
*/
@SerializedName("product_code")
@Expose
Expand Down Expand Up @@ -638,15 +638,15 @@ public void setPreviousLineItemId(final String previousLineItemId) {

/**
* For plan-related line items this will be the plan's code, for add-on related line items it will
* be the add-on's code. For item-related line itmes it will be the item's `external_sku`.
* be the add-on's code. For item-related line items it will be the item's `external_sku`.
*/
public String getProductCode() {
return this.productCode;
}

/**
* @param productCode For plan-related line items this will be the plan's code, for add-on related
* line items it will be the add-on's code. For item-related line itmes it will be the item's
* line items it will be the add-on's code. For item-related line items it will be the item's
* `external_sku`.
*/
public void setProductCode(final String productCode) {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/recurly/v3/resources/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public class PaymentMethod extends Resource {
@Expose
private String lastTwo;

/** The name associated with the bank account. */
@SerializedName("name_on_account")
@Expose
private String nameOnAccount;

@SerializedName("object")
@Expose
private String object;
Expand Down Expand Up @@ -183,6 +188,16 @@ public void setLastTwo(final String lastTwo) {
this.lastTwo = lastTwo;
}

/** The name associated with the bank account. */
public String getNameOnAccount() {
return this.nameOnAccount;
}

/** @param nameOnAccount The name associated with the bank account. */
public void setNameOnAccount(final String nameOnAccount) {
this.nameOnAccount = nameOnAccount;
}

public String getObject() {
return this.object;
}
Expand Down
Loading