diff --git a/openapi/api.yaml b/openapi/api.yaml index 2d66bd9..4a43021 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -2793,6 +2793,97 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/accounts/{account_id}/billing_infos/{billing_info_id}/verify": + post: + tags: + - billing_infos + operationId: verify_billing_infos + summary: Verify a billing information's credit card + parameters: + - "$ref": "#/components/parameters/account_id" + - "$ref": "#/components/parameters/billing_info_id" + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/BillingInfoVerify" + required: false + responses: + '200': + description: Transaction information from verify. + content: + application/json: + schema: + "$ref": "#/components/schemas/Transaction" + '404': + description: Billing information not found, or incorrect site or account + ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid billing information, or error running the verification + transaction. + content: + application/json: + schema: + "$ref": "#/components/schemas/ErrorMayHaveTransaction" + x-code-samples: [] + "/accounts/{account_id}/billing_infos/{billing_info_id}/verify_cvv": + post: + tags: + - billing_infos + operationId: verify_billing_infos_cvv + summary: Verify a billing information's credit card cvv + parameters: + - "$ref": "#/components/parameters/account_id" + - "$ref": "#/components/parameters/billing_info_id" + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/BillingInfoVerifyCVV" + responses: + '200': + description: Transaction information from verify. + content: + application/json: + schema: + "$ref": "#/components/schemas/Transaction" + '404': + description: Billing information not found, or incorrect site or account + ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid billing information, or error running the verification + transaction. + content: + application/json: + schema: + "$ref": "#/components/schemas/ErrorMayHaveTransaction" + '429': + description: Too many CVV verification attempts. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/coupon_redemptions": get: tags: @@ -18896,6 +18987,8 @@ components: amazon_billing_agreement_id: type: string title: Amazon billing agreement ID + description: Only supported on Amazon V1. For Amazon V2, use token_id with + Recurly.js. paypal_billing_agreement_id: type: string title: PayPal billing agreement ID @@ -18999,12 +19092,27 @@ components: type: string description: An identifier for a specific payment gateway. maxLength: 13 + three_d_secure_action_result_token_id: + type: string + description: A token generated by Recurly.js after completing a 3-D Secure + device fingerprinting or authentication challenge. BillingInfoVerifyCVV: type: object properties: verification_value: type: string description: Unique security code for a credit card. + gateway_code: + type: string + description: An identifier for a specific payment gateway. + maxLength: 13 + three_d_secure_action_result_token_id: + type: string + description: A token generated by Recurly.js after completing a 3-D Secure + device fingerprinting or authentication challenge. + token_id: + type: string + description: A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). Coupon: type: object properties: @@ -20315,6 +20423,11 @@ components: title: Subtotal description: The summation of charges and credits, before discounts and taxes. + subtotal_after_discount: + type: number + format: float + title: Subtotal After Discount + description: The summation of charges and credits, after discounts applied. tax: type: number format: float @@ -20958,7 +21071,7 @@ components: type: number format: float title: Total after discounts and taxes - description: "`(quantity * unit_amount) - (discount + tax)`" + description: "`(quantity * unit_amount) - discount + tax`" description: type: string title: Description @@ -21327,12 +21440,12 @@ components: origin: title: Origin description: Origin `external_gift_card` is allowed if the Gift Cards feature - is enabled on your site and `type` is `credit`. Set this value in order - to track gift card credits from external gift cards (like InComm). It - also skips billing information requirements. Origin `prepayment` is only - allowed if `type` is `charge` and `tax_exempt` is left blank or set to - true. This origin creates a charge and opposite credit on the account - to be used for future invoices. + is enabled on your site, `type` is `credit` and `tax_exempt` is `true` + if you are using taxes. Set this value in order to track gift card credits + from external gift cards (like InComm). It also skips billing information + requirements. Origin `prepayment` is only allowed if `type` is `charge` + and `tax_exempt` is left blank or set to true. This origin creates a + charge and opposite credit on the account to be used for future invoices. "$ref": "#/components/schemas/LineItemCreateOriginEnum" custom_fields: "$ref": "#/components/schemas/CustomFields" diff --git a/src/main/java/com/recurly/v3/Client.java b/src/main/java/com/recurly/v3/Client.java index 19234ea..6256700 100644 --- a/src/main/java/com/recurly/v3/Client.java +++ b/src/main/java/com/recurly/v3/Client.java @@ -406,6 +406,62 @@ public void removeABillingInfo(String accountId, String billingInfoId) { this.makeRequest("DELETE", path); } + /** + * Verify a billing information's credit card + * + * @see verify_billing_infos api documentation + * @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. + * @param billingInfoId Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. + * @return Transaction information from verify. + */ + public Transaction verifyBillingInfos(String accountId, String billingInfoId) { + final String url = "/accounts/{account_id}/billing_infos/{billing_info_id}/verify"; + final HashMap urlParams = new HashMap(); + urlParams.put("account_id", accountId); + urlParams.put("billing_info_id", billingInfoId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = Transaction.class; + return this.makeRequest("POST", path, returnType); + } + + /** + * Verify a billing information's credit card + * + * @see verify_billing_infos api documentation + * @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. + * @param billingInfoId Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. + * @param body The body of the request. + * @return Transaction information from verify. + */ + public Transaction verifyBillingInfos(String accountId, String billingInfoId, BillingInfoVerify body) { + final String url = "/accounts/{account_id}/billing_infos/{billing_info_id}/verify"; + final HashMap urlParams = new HashMap(); + urlParams.put("account_id", accountId); + urlParams.put("billing_info_id", billingInfoId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = Transaction.class; + return this.makeRequest("POST", path, body, returnType); + } + + /** + * Verify a billing information's credit card cvv + * + * @see verify_billing_infos_cvv api documentation + * @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. + * @param billingInfoId Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. + * @param body The body of the request. + * @return Transaction information from verify. + */ + public Transaction verifyBillingInfosCvv(String accountId, String billingInfoId, BillingInfoVerifyCVV body) { + final String url = "/accounts/{account_id}/billing_infos/{billing_info_id}/verify_cvv"; + final HashMap urlParams = new HashMap(); + urlParams.put("account_id", accountId); + urlParams.put("billing_info_id", billingInfoId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = Transaction.class; + return this.makeRequest("POST", path, body, returnType); + } + /** * List the coupon redemptions for an account * diff --git a/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java b/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java index 9aa4471..3cc3816 100644 --- a/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java +++ b/src/main/java/com/recurly/v3/requests/BillingInfoCreate.java @@ -28,7 +28,7 @@ public class BillingInfoCreate extends Request { @Expose private Address address; - /** Amazon billing agreement ID */ + /** Only supported on Amazon V1. For Amazon V2, use token_id with Recurly.js. */ @SerializedName("amazon_billing_agreement_id") @Expose private String amazonBillingAgreementId; @@ -286,12 +286,15 @@ public void setAddress(final Address address) { this.address = address; } - /** Amazon billing agreement ID */ + /** Only supported on Amazon V1. For Amazon V2, use token_id with Recurly.js. */ public String getAmazonBillingAgreementId() { return this.amazonBillingAgreementId; } - /** @param amazonBillingAgreementId Amazon billing agreement ID */ + /** + * @param amazonBillingAgreementId Only supported on Amazon V1. For Amazon V2, use token_id with + * Recurly.js. + */ public void setAmazonBillingAgreementId(final String amazonBillingAgreementId) { this.amazonBillingAgreementId = amazonBillingAgreementId; } diff --git a/src/main/java/com/recurly/v3/requests/BillingInfoVerify.java b/src/main/java/com/recurly/v3/requests/BillingInfoVerify.java index 0bf6307..c7fba9d 100644 --- a/src/main/java/com/recurly/v3/requests/BillingInfoVerify.java +++ b/src/main/java/com/recurly/v3/requests/BillingInfoVerify.java @@ -17,6 +17,14 @@ public class BillingInfoVerify extends Request { @Expose private String gatewayCode; + /** + * A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or + * authentication challenge. + */ + @SerializedName("three_d_secure_action_result_token_id") + @Expose + private String threeDSecureActionResultTokenId; + /** An identifier for a specific payment gateway. */ public String getGatewayCode() { return this.gatewayCode; @@ -26,4 +34,20 @@ public String getGatewayCode() { public void setGatewayCode(final String gatewayCode) { this.gatewayCode = gatewayCode; } + + /** + * A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or + * authentication challenge. + */ + public String getThreeDSecureActionResultTokenId() { + return this.threeDSecureActionResultTokenId; + } + + /** + * @param threeDSecureActionResultTokenId A token generated by Recurly.js after completing a 3-D + * Secure device fingerprinting or authentication challenge. + */ + public void setThreeDSecureActionResultTokenId(final String threeDSecureActionResultTokenId) { + this.threeDSecureActionResultTokenId = threeDSecureActionResultTokenId; + } } diff --git a/src/main/java/com/recurly/v3/requests/BillingInfoVerifyCVV.java b/src/main/java/com/recurly/v3/requests/BillingInfoVerifyCVV.java index 180ae97..5893065 100644 --- a/src/main/java/com/recurly/v3/requests/BillingInfoVerifyCVV.java +++ b/src/main/java/com/recurly/v3/requests/BillingInfoVerifyCVV.java @@ -12,11 +12,74 @@ public class BillingInfoVerifyCVV extends Request { + /** An identifier for a specific payment gateway. */ + @SerializedName("gateway_code") + @Expose + private String gatewayCode; + + /** + * A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or + * authentication challenge. + */ + @SerializedName("three_d_secure_action_result_token_id") + @Expose + private String threeDSecureActionResultTokenId; + + /** + * A token [generated by + * Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). + */ + @SerializedName("token_id") + @Expose + private String tokenId; + /** Unique security code for a credit card. */ @SerializedName("verification_value") @Expose private String verificationValue; + /** An identifier for a specific payment gateway. */ + public String getGatewayCode() { + return this.gatewayCode; + } + + /** @param gatewayCode An identifier for a specific payment gateway. */ + public void setGatewayCode(final String gatewayCode) { + this.gatewayCode = gatewayCode; + } + + /** + * A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or + * authentication challenge. + */ + public String getThreeDSecureActionResultTokenId() { + return this.threeDSecureActionResultTokenId; + } + + /** + * @param threeDSecureActionResultTokenId A token generated by Recurly.js after completing a 3-D + * Secure device fingerprinting or authentication challenge. + */ + public void setThreeDSecureActionResultTokenId(final String threeDSecureActionResultTokenId) { + this.threeDSecureActionResultTokenId = threeDSecureActionResultTokenId; + } + + /** + * A token [generated by + * Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). + */ + public String getTokenId() { + return this.tokenId; + } + + /** + * @param tokenId A token [generated by + * Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). + */ + public void setTokenId(final String tokenId) { + this.tokenId = tokenId; + } + /** Unique security code for a credit card. */ public String getVerificationValue() { return this.verificationValue; diff --git a/src/main/java/com/recurly/v3/requests/LineItemCreate.java b/src/main/java/com/recurly/v3/requests/LineItemCreate.java index c686140..98f62cd 100644 --- a/src/main/java/com/recurly/v3/requests/LineItemCreate.java +++ b/src/main/java/com/recurly/v3/requests/LineItemCreate.java @@ -118,11 +118,12 @@ public class LineItemCreate extends Request { private String liabilityGlAccountId; /** - * Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and - * `type` is `credit`. Set this value in order to track gift card credits from external gift cards - * (like InComm). It also skips billing information requirements. Origin `prepayment` is only - * allowed if `type` is `charge` and `tax_exempt` is left blank or set to true. This origin - * creates a charge and opposite credit on the account to be used for future invoices. + * Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site, + * `type` is `credit` and `tax_exempt` is `true` if you are using taxes. Set this value in order + * to track gift card credits from external gift cards (like InComm). It also skips billing + * information requirements. Origin `prepayment` is only allowed if `type` is `charge` and + * `tax_exempt` is left blank or set to true. This origin creates a charge and opposite credit on + * the account to be used for future invoices. */ @SerializedName("origin") @Expose @@ -439,11 +440,12 @@ public void setLiabilityGlAccountId(final String liabilityGlAccountId) { } /** - * Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and - * `type` is `credit`. Set this value in order to track gift card credits from external gift cards - * (like InComm). It also skips billing information requirements. Origin `prepayment` is only - * allowed if `type` is `charge` and `tax_exempt` is left blank or set to true. This origin - * creates a charge and opposite credit on the account to be used for future invoices. + * Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site, + * `type` is `credit` and `tax_exempt` is `true` if you are using taxes. Set this value in order + * to track gift card credits from external gift cards (like InComm). It also skips billing + * information requirements. Origin `prepayment` is only allowed if `type` is `charge` and + * `tax_exempt` is left blank or set to true. This origin creates a charge and opposite credit on + * the account to be used for future invoices. */ public Constants.LineItemCreateOrigin getOrigin() { return this.origin; @@ -451,11 +453,11 @@ public Constants.LineItemCreateOrigin getOrigin() { /** * @param origin Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on - * your site and `type` is `credit`. Set this value in order to track gift card credits from - * external gift cards (like InComm). It also skips billing information requirements. Origin - * `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to - * true. This origin creates a charge and opposite credit on the account to be used for future - * invoices. + * your site, `type` is `credit` and `tax_exempt` is `true` if you are using taxes. Set this + * value in order to track gift card credits from external gift cards (like InComm). It also + * skips billing information requirements. Origin `prepayment` is only allowed if `type` is + * `charge` and `tax_exempt` is left blank or set to true. This origin creates a charge and + * opposite credit on the account to be used for future invoices. */ public void setOrigin(final Constants.LineItemCreateOrigin origin) { this.origin = origin; diff --git a/src/main/java/com/recurly/v3/resources/Invoice.java b/src/main/java/com/recurly/v3/resources/Invoice.java index 830aa82..6dae94d 100644 --- a/src/main/java/com/recurly/v3/resources/Invoice.java +++ b/src/main/java/com/recurly/v3/resources/Invoice.java @@ -239,6 +239,11 @@ public class Invoice extends Resource { @Expose private BigDecimal subtotal; + /** The summation of charges and credits, after discounts applied. */ + @SerializedName("subtotal_after_discount") + @Expose + private BigDecimal subtotalAfterDiscount; + /** The total tax on this invoice. */ @SerializedName("tax") @Expose @@ -771,6 +776,16 @@ public void setSubtotal(final BigDecimal subtotal) { this.subtotal = subtotal; } + /** The summation of charges and credits, after discounts applied. */ + public BigDecimal getSubtotalAfterDiscount() { + return this.subtotalAfterDiscount; + } + + /** @param subtotalAfterDiscount The summation of charges and credits, after discounts applied. */ + public void setSubtotalAfterDiscount(final BigDecimal subtotalAfterDiscount) { + this.subtotalAfterDiscount = subtotalAfterDiscount; + } + /** The total tax on this invoice. */ public BigDecimal getTax() { return this.tax; diff --git a/src/main/java/com/recurly/v3/resources/LineItem.java b/src/main/java/com/recurly/v3/resources/LineItem.java index 2a9f7a2..a5b431a 100644 --- a/src/main/java/com/recurly/v3/resources/LineItem.java +++ b/src/main/java/com/recurly/v3/resources/LineItem.java @@ -40,7 +40,7 @@ public class LineItem extends Resource { @Expose private String addOnId; - /** `(quantity * unit_amount) - (discount + tax)` */ + /** `(quantity * unit_amount) - discount + tax` */ @SerializedName("amount") @Expose private BigDecimal amount; @@ -462,12 +462,12 @@ public void setAddOnId(final String addOnId) { this.addOnId = addOnId; } - /** `(quantity * unit_amount) - (discount + tax)` */ + /** `(quantity * unit_amount) - discount + tax` */ public BigDecimal getAmount() { return this.amount; } - /** @param amount `(quantity * unit_amount) - (discount + tax)` */ + /** @param amount `(quantity * unit_amount) - discount + tax` */ public void setAmount(final BigDecimal amount) { this.amount = amount; }