├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ └── maven.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── SECURITY.md ├── dist ├── chargebee-java-3.32.0-javadoc.jar ├── chargebee-java-3.32.0-sources.jar └── chargebee-java-3.32.0.jar ├── images └── docs.png ├── pom.xml └── src └── main └── java └── com └── chargebee ├── APIException.java ├── ApiResponse.java ├── BatchConstants.java ├── BatchEntry.java ├── BatchResult.java ├── Environment.java ├── IdempotencyConstants.java ├── ListResult.java ├── RequestInterceptor.java ├── RequestWrap.java ├── Result.java ├── Snippets.java ├── exceptions ├── BatchAPIException.java ├── InvalidRequestException.java ├── OperationFailedException.java └── PaymentException.java ├── filters ├── BooleanFilter.java ├── DateFilter.java ├── EnumFilter.java ├── NumberFilter.java ├── StringFilter.java ├── TimestampFilter.java └── enums │ └── SortOrder.java ├── gdata ├── Escaper.java ├── PercentEscaper.java └── UnicodeEscaper.java ├── internal ├── .DS_Store ├── BatchRequest.java ├── ClazzUtil.java ├── CompositeArrayParameter.java ├── CompositeParameter.java ├── HttpUtil.java ├── ListRequest.java ├── Parameter.java ├── Params.java ├── ParamsV2.java ├── PrimitiveArrayParameter.java ├── PrimitiveParameter.java ├── Request.java ├── RequestBase.java ├── Resource.java ├── ResultBase.java └── StringJoiner.java └── models ├── .DS_Store ├── Addon.java ├── Address.java ├── AdvanceInvoiceSchedule.java ├── AttachedItem.java ├── Attribute.java ├── BusinessEntity.java ├── BusinessEntityTransfer.java ├── Card.java ├── Comment.java ├── Configuration.java ├── Contact.java ├── ContractTerm.java ├── Coupon.java ├── CouponCode.java ├── CouponSet.java ├── CreditNote.java ├── CreditNoteEstimate.java ├── CsvTaxRule.java ├── Currency.java ├── Customer.java ├── CustomerEntitlement.java ├── DifferentialPrice.java ├── Discount.java ├── Download.java ├── Entitlement.java ├── EntitlementOverride.java ├── Estimate.java ├── Event.java ├── Export.java ├── Feature.java ├── GatewayErrorDetail.java ├── Gift.java ├── Hierarchy.java ├── HostedPage.java ├── ImpactedItem.java ├── ImpactedItemPrice.java ├── ImpactedSubscription.java ├── InAppSubscription.java ├── Invoice.java ├── InvoiceEstimate.java ├── Item.java ├── ItemEntitlement.java ├── ItemFamily.java ├── ItemPrice.java ├── Metadata.java ├── OmnichannelSubscription.java ├── OmnichannelSubscriptionItem.java ├── OmnichannelSubscriptionItemScheduledChange.java ├── OmnichannelTransaction.java ├── Order.java ├── PaymentIntent.java ├── PaymentReferenceNumber.java ├── PaymentSchedule.java ├── PaymentScheduleEstimate.java ├── PaymentScheduleScheme.java ├── PaymentSource.java ├── PaymentVoucher.java ├── Plan.java ├── PortalSession.java ├── PriceVariant.java ├── PricingPageSession.java ├── PromotionalCredit.java ├── Purchase.java ├── Quote.java ├── QuoteLineGroup.java ├── QuotedCharge.java ├── QuotedSubscription.java ├── Ramp.java ├── RecordedPurchase.java ├── ResourceMigration.java ├── Rule.java ├── SiteMigrationDetail.java ├── Subscription.java ├── SubscriptionEntitlement.java ├── SubscriptionEstimate.java ├── TaxWithheld.java ├── ThirdPartyPaymentMethod.java ├── TimeMachine.java ├── Token.java ├── Transaction.java ├── UnbilledCharge.java ├── Usage.java ├── UsageEvent.java ├── UsageFile.java ├── VirtualBankAccount.java └── enums ├── AccountHolderType.java ├── AccountReceivablesHandling.java ├── AccountType.java ├── Action.java ├── ApiVersion.java ├── ApplyOn.java ├── AutoCollection.java ├── AvalaraSaleType.java ├── BillingAlignmentMode.java ├── BillingDateMode.java ├── BillingDayOfWeekMode.java ├── CancelOption.java ├── ChangeOption.java ├── Channel.java ├── ChargeModel.java ├── ChargeOn.java ├── ChargeOnEvent.java ├── ChargeOnOption.java ├── ChargesHandling.java ├── ContractTermCancelOption.java ├── CreditOptionForCurrentTermCharges.java ├── CreditType.java ├── CustomerType.java ├── DedupeOption.java ├── DirectDebitScheme.java ├── DispositionType.java ├── DunningType.java ├── DurationType.java ├── EcheckType.java ├── EinvoicingMethod.java ├── EndScheduleOn.java ├── EntityCode.java ├── EntityType.java ├── EventName.java ├── EventType.java ├── ExportType.java ├── FreePeriodUnit.java ├── FriendOfferType.java ├── Gateway.java ├── HierarchyOperationType.java ├── InvoiceDunningHandling.java ├── ItemType.java ├── Layout.java ├── NotifyReferralSystem.java ├── OfflinePaymentMethod.java ├── OnEvent.java ├── Operation.java ├── OperationType.java ├── PauseOption.java ├── PaymentInitiator.java ├── PaymentMethod.java ├── PaymentMethodType.java ├── PaymentVoucherType.java ├── PeriodUnit.java ├── PriceType.java ├── PricingModel.java ├── PricingType.java ├── ProductCatalogVersion.java ├── ProrationType.java ├── ReferralSystem.java ├── ReferrerRewardType.java ├── RefundableCreditsHandling.java ├── ReportBy.java ├── ResumeOption.java ├── Role.java ├── ScheduleType.java ├── Source.java ├── Status.java ├── Tax1JurisType.java ├── Tax2JurisType.java ├── Tax3JurisType.java ├── Tax4JurisType.java ├── TaxExemptReason.java ├── TaxJurisType.java ├── TaxOverrideReason.java ├── Taxability.java ├── TaxjarExemptionCategory.java ├── TrialEndAction.java ├── Type.java ├── UnbilledChargesHandling.java ├── UnbilledChargesOption.java ├── UnpaidInvoicesHandling.java ├── UsageAccumulationResetFrequency.java ├── ValidationStatus.java └── VoucherType.java /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | indent_style = space 9 | indent_size = 4 10 | end_of_line = lf 11 | charset = utf-8 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report a bug for this repository. 3 | labels: 4 | - Bug 5 | 6 | body: 7 | - type: textarea 8 | id: what-happened 9 | attributes: 10 | label: Description of the Bug 11 | description: Please provide a clear and concise description of the bug. 12 | placeholder: Describe what you're experiencing. 13 | validations: 14 | required: true 15 | 16 | - type: textarea 17 | id: repro-steps 18 | attributes: 19 | label: Steps to reproduce 20 | description: Clear and concise instructions to reproduce the bug are essential for quick resolution. 21 | placeholder: | 22 | 1. Fetch '...' 23 | 2. Update the '....' 24 | 3. Encounter the error 25 | validations: 26 | required: true 27 | 28 | - type: textarea 29 | id: expected-behavior 30 | attributes: 31 | label: Expected Behavior 32 | description: Describe what you expected to happen. 33 | validations: 34 | required: true 35 | 36 | - type: textarea 37 | id: code-snippets 38 | attributes: 39 | label: Code Snippets (if applicable) 40 | description: If relevant, provide code snippets to clarify the issue. 41 | render: Java 42 | validations: 43 | required: false 44 | 45 | - type: input 46 | id: os 47 | attributes: 48 | label: Operating System 49 | placeholder: macOS 50 | validations: 51 | required: true 52 | 53 | - type: input 54 | id: language-version 55 | attributes: 56 | label: Language version 57 | placeholder: Java 1.8 58 | validations: 59 | required: true 60 | 61 | - type: input 62 | id: lib-version 63 | attributes: 64 | label: Library version 65 | placeholder: v3.10.0 66 | validations: 67 | required: true 68 | 69 | - type: textarea 70 | id: additional-context 71 | attributes: 72 | label: Additional context 73 | description: Provide any other relevant information about the problem. 74 | validations: 75 | required: false 76 | 77 | - type: markdown 78 | attributes: 79 | value: | 80 | Thank you for taking the time to submit this bug report! 81 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Chargebee support 4 | url: https://support.chargebee.com/ 5 | about: | 6 | Github issues are not an official support channel for Chargebee. If you have an urgent request we suggest you contact us through an official channel: support@chargebee.com or https://support.chargebee.com/ -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Request a New Feature for the project. 3 | labels: 4 | - Feature Request 5 | 6 | body: 7 | - type: textarea 8 | id: problem 9 | attributes: 10 | label: What problem does your feature request address? 11 | description: Please provide a clear and concise description of the problem you'd like to solve. For example, "I'm frequently frustrated when..." 12 | 13 | - type: textarea 14 | id: solution 15 | attributes: 16 | label: Describe the desired solution 17 | description: Please provide a clear and concise description of the solution you would like to see implemented. 18 | 19 | - type: textarea 20 | id: alternatives 21 | attributes: 22 | label: Alternatives considered 23 | description: Describe any alternative solutions or features you may have thought about in relation to this problem. 24 | 25 | - type: textarea 26 | id: context 27 | attributes: 28 | label: Additional context 29 | description: Feel free to include any other relevant information or context regarding your feature request. 30 | 31 | - type: markdown 32 | attributes: 33 | value: | 34 | Thank you for taking the time to submit your feature request! 35 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | Please provide a brief overview of the changes introduced by this pull request. 4 | 5 | ### Related Issues 6 | 7 | Closes #IssueNumber 8 | 9 | 10 | ### Additional Information 11 | 12 | Include any additional information that might be helpful in reviewing the changes introduced by this pull request. 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: maven 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | open-pull-requests-limit: 4 8 | 9 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | name: Maven 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | name: Test with Java ${{ matrix.jdk }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | jdk: ['8', '11', '17'] 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Set up JDK ${{ matrix.jdk }} 17 | uses: actions/setup-java@v2 18 | with: 19 | distribution: 'zulu' 20 | java-version: ${{ matrix.jdk }} 21 | cache: 'maven' 22 | - name: Maven Package 23 | run: mvn -B package --file pom.xml 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .DS_Store 3 | 4 | # Ignore all VS Code (Java Plugin) files 5 | .classpath 6 | .project 7 | .settings/ 8 | .vscode/ 9 | 10 | # Ignore Intellij IDE specific files 11 | .idea/ 12 | *.iml 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011-2024 ChargeBee, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | At Chargebee, we take data integrity and security very seriously. Due to the nature of the product and service we provide, we are committed to working with individuals to stay updated on the latest security techniques and fix any security weakness in our application or infrastructure reported to us responsibly by external parties. 4 | 5 | https://www.chargebee.com/security/responsible-disclosure-policy/ 6 | 7 | ## Reporting a vulnerability 8 | Reach out to us at security@chargebee.com. Please do not open GitHub issues or pull requests as this makes the problem immediately visible to everyone, including malicious actors. Chargebee's security team will triage your report and respond according to its impact. 9 | -------------------------------------------------------------------------------- /dist/chargebee-java-3.32.0-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/dist/chargebee-java-3.32.0-javadoc.jar -------------------------------------------------------------------------------- /dist/chargebee-java-3.32.0-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/dist/chargebee-java-3.32.0-sources.jar -------------------------------------------------------------------------------- /dist/chargebee-java-3.32.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/dist/chargebee-java-3.32.0.jar -------------------------------------------------------------------------------- /images/docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/images/docs.png -------------------------------------------------------------------------------- /src/main/java/com/chargebee/APIException.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | import org.json.*; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public class APIException extends RuntimeException { 9 | 10 | public final JSONObject jsonObj; 11 | 12 | public final int httpStatusCode; 13 | public final String type; 14 | public final String param; 15 | public final String apiErrorCode; 16 | public final String errorCauseId; 17 | public final Map> headers; 18 | 19 | 20 | 21 | /** 22 | * Use {@link #httpStatusCode} instead. 23 | * @deprecated 24 | */ 25 | @Deprecated 26 | public final int httpCode; 27 | 28 | /** 29 | * Use {@link #apiErrorCode} instead. 30 | * @deprecated 31 | */ 32 | @Deprecated 33 | public final String code; 34 | /** 35 | * Use {@link #getMessage()} instead. 36 | * @deprecated 37 | */ 38 | @Deprecated 39 | public final String message; 40 | 41 | 42 | public APIException(int httpStatusCode, String message, JSONObject jsonObj) { 43 | super(message); 44 | this.jsonObj = jsonObj; 45 | this.httpStatusCode = httpStatusCode; 46 | try { 47 | this.apiErrorCode = jsonObj.getString("api_error_code"); 48 | this.code = jsonObj.getString("error_code"); 49 | this.message = jsonObj.getString("error_msg"); 50 | } catch (JSONException ex) { 51 | throw new RuntimeException("Error when parsing the error response. Probably not ChargeBee' error response.", ex); 52 | } 53 | this.headers = null; 54 | this.type = jsonObj.optString("type"); 55 | this.param = jsonObj.optString("param"); 56 | this.errorCauseId = jsonObj.optString("error_cause_id"); 57 | this.httpCode = httpStatusCode; 58 | } 59 | public APIException(int httpStatusCode, String message, JSONObject jsonObj, Map> headers) { 60 | super(message); 61 | this.jsonObj = jsonObj; 62 | this.httpStatusCode = httpStatusCode; 63 | try { 64 | this.apiErrorCode = jsonObj.getString("api_error_code"); 65 | this.code = jsonObj.getString("error_code"); 66 | this.message = jsonObj.getString("error_msg"); 67 | } catch (JSONException ex) { 68 | throw new RuntimeException("Error when parsing the error response. Probably not ChargeBee' error response.", ex); 69 | } 70 | this.headers = headers; 71 | this.type = jsonObj.optString("type"); 72 | this.param = jsonObj.optString("param"); 73 | this.errorCauseId = jsonObj.optString("error_cause_id"); 74 | this.httpCode = httpStatusCode; 75 | } 76 | 77 | 78 | public boolean isParamErr() { 79 | return param != null; 80 | } 81 | 82 | @Override 83 | public String toString() { 84 | try { 85 | return jsonObj.toString(2); 86 | } catch (JSONException ex) { 87 | throw new RuntimeException(ex); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/ApiResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 ChargeBee Inc 3 | * All Rights Reserved. 4 | */ 5 | package com.chargebee; 6 | 7 | import org.json.JSONObject; 8 | 9 | /** 10 | * 11 | * @author cb-ajit 12 | */ 13 | public interface ApiResponse { 14 | 15 | public int httpCode(); 16 | 17 | public JSONObject jsonResponse(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/BatchConstants.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | public interface BatchConstants { 4 | 5 | String CORRELATION_ID = "correlation_id"; 6 | String RESULT_CONTENT_KEY = "content"; 7 | String RESULTS_KEY = "results"; 8 | String REQUESTS_KEY = "requests"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/BatchEntry.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | import com.chargebee.internal.Params; 4 | import com.chargebee.internal.Request; 5 | import org.json.JSONObject; 6 | 7 | import java.util.Iterator; 8 | import java.util.Map; 9 | 10 | import static com.chargebee.BatchConstants.CORRELATION_ID; 11 | 12 | 13 | public class BatchEntry { 14 | 15 | String correlationId; 16 | 17 | public void setParameters(JSONObject parameters) { 18 | this.parameters = parameters; 19 | } 20 | 21 | JSONObject parameters; 22 | 23 | public Request getRequestObject() { 24 | return requestObject; 25 | } 26 | 27 | Request requestObject; 28 | 29 | public BatchEntry(Request requestObject, String correlationId) { 30 | this(requestObject); 31 | this.correlationId = correlationId; 32 | } 33 | 34 | public BatchEntry(Request requestObject) { 35 | this.requestObject = requestObject; 36 | this.parameters = jsonParams(requestObject.params()); 37 | } 38 | 39 | private JSONObject jsonParams(Params params) { 40 | JSONObject paramJson = new JSONObject(); 41 | Iterator paramIterator = params.entries().iterator(); 42 | while (paramIterator.hasNext()) { 43 | Map.Entry paramMap = (Map.Entry) paramIterator.next(); 44 | paramJson.put(paramMap.getKey().toString(), paramMap.getValue()); 45 | } 46 | return paramJson; 47 | } 48 | 49 | public JSONObject getJSON() { 50 | JSONObject jsonObject = new JSONObject(); 51 | jsonObject.put("parameters", this.parameters); 52 | if(this.correlationId != null ) { 53 | jsonObject.put(CORRELATION_ID, this.correlationId); 54 | } 55 | return jsonObject; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/BatchResult.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONObject; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import static com.chargebee.BatchConstants.*; 11 | 12 | public class BatchResult extends Result { 13 | List results = new ArrayList<>(); 14 | 15 | public BatchResult(int httpCode, JSONObject jsonObj) { 16 | super(httpCode, jsonObj); 17 | } 18 | public List getResults() { 19 | return results; 20 | } 21 | 22 | public BatchResult(int httpCode, JSONObject jsonObj, Map> responseHeaders) { 23 | super(httpCode, jsonObj, responseHeaders); 24 | } 25 | 26 | public BatchResult get() { 27 | JSONArray resultArray = this.jsonResponse().optJSONArray(RESULTS_KEY); 28 | for (int i = 0; i < resultArray.length(); i++) { 29 | JSONObject currentJson = resultArray.getJSONObject(i); 30 | results.add(new BatchResponse(currentJson.optString(CORRELATION_ID), new Result(this.httpCode, currentJson.optJSONObject(RESULT_CONTENT_KEY), this.responseHeaders))); 31 | } 32 | return this; 33 | } 34 | 35 | public class BatchResponse { 36 | String correlationId; 37 | Result content; 38 | 39 | public String getCorrelationId() { 40 | return correlationId; 41 | } 42 | 43 | public void setCorrelationId(String correlationId) { 44 | this.correlationId = correlationId; 45 | } 46 | 47 | public Result getContent() { 48 | return content; 49 | } 50 | 51 | public void setContent(Result content) { 52 | this.content = content; 53 | } 54 | 55 | public BatchResponse(String correlationId, Result data) { 56 | this.correlationId = correlationId; 57 | this.content = data; 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/Environment.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | public class Environment { 4 | 5 | /** 6 | * You can generate API keys from the ChargeBee web interface. 7 | */ 8 | public final String apiKey; 9 | 10 | /** 11 | * Your chargebee subdomain. Could be your sandbox or production. 12 | */ 13 | public final String siteName; 14 | 15 | /** 16 | * Timeout value, in milliseconds, to be used when trying to conect to the 17 | * chargebee api server. If the timeout expires before the connection can be 18 | * established, a java.net.SocketTimeoutException is raised. A timeout of 19 | * zero is interpreted as an infinite timeout. 20 | */ 21 | public int connectTimeout = Integer.getInteger("com.chargebee.api.http.timeout.connect", 30000); 22 | 23 | /** 24 | * Timeout value, in milliseconds, to be used when reading response from the 25 | * chargebee api server. If the timeout expires before there is data available 26 | * for read, a java.net.SocketTimeoutException is raised. A timeout of zero 27 | * is interpreted as an infinite timeout. 28 | */ 29 | public int readTimeout = Integer.getInteger("com.chargebee.api.http.timeout.read", 80000); 30 | 31 | public static final String CHARSET = "UTF-8"; 32 | 33 | public static final String API_VERSION = "v2"; 34 | 35 | public static final String LIBRARY_VERSION = "3.32.0"; 36 | 37 | private final String apiBaseUrl; 38 | 39 | private static Environment defaultEnv; // singleton 40 | 41 | private RequestInterceptor reqInterceptor; 42 | 43 | public Environment(String siteName, String apiKey) { 44 | this(siteName, apiKey, null); 45 | } 46 | 47 | public Environment(String siteName, String apiKey, RequestInterceptor reqInterceptor) { 48 | this.apiKey = apiKey; 49 | this.siteName = siteName; 50 | this.reqInterceptor = reqInterceptor; 51 | String domainSuffix = System.getProperty("com.chargebee.api.domain.suffix", "chargebee.com"); 52 | String proto = System.getProperty("com.chargebee.api.protocol", "https"); 53 | this.apiBaseUrl = proto + "://" + siteName + "." + domainSuffix + "/api/" + API_VERSION; 54 | } 55 | 56 | public static void configure(String siteName, String apikey) { 57 | Environment.defaultEnv = new Environment(siteName, apikey); 58 | } 59 | 60 | public static void reqInterceptor(RequestInterceptor reqInterceptor) { 61 | defaultConfig().reqInterceptor = reqInterceptor; 62 | } 63 | 64 | public RequestInterceptor reqInterceptor() { 65 | return reqInterceptor; 66 | } 67 | 68 | public static Environment defaultConfig() { 69 | if(defaultEnv == null) { 70 | throw new RuntimeException("The default environment has not been configured"); 71 | } 72 | return defaultEnv; 73 | } 74 | 75 | public String apiBaseUrl() { 76 | return this.apiBaseUrl; 77 | } 78 | 79 | public String apiBaseUrlWithSubDomain(String subDomain) { 80 | String domainSuffix = System.getProperty("com.chargebee.api.domain.suffix", "chargebee.com"); 81 | String proto = System.getProperty("com.chargebee.api.protocol", "https"); 82 | return proto + "://" + siteName + "." + subDomain + "." + domainSuffix + "/api/" + API_VERSION; 83 | } 84 | 85 | public static void updateConnectTimeoutInMillis(int connectTimeout) { 86 | Environment.defaultEnv.connectTimeout = connectTimeout; 87 | } 88 | 89 | public static void updateReadTimeoutInMillis(int readTimeout) { 90 | Environment.defaultEnv.readTimeout = readTimeout; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/IdempotencyConstants.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | public interface IdempotencyConstants { 4 | String IDEMPOTENCY_HEADER = "chargebee-idempotency-key"; 5 | 6 | String IDEMPOTENCY_REPLAY_HEADER = "chargebee-idempotency-replayed"; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/ListResult.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | import com.chargebee.internal.ResultBase; 4 | import java.util.*; 5 | import org.json.*; 6 | 7 | /** 8 | * To represent list output of ChargeBee APIs (like getting list of subscriptions !!) 9 | */ 10 | public class ListResult extends ArrayList implements ApiResponse { 11 | 12 | /** 13 | * represents each entry in this result-list 14 | */ 15 | public static class Entry extends ResultBase { 16 | 17 | public Entry(JSONObject entryJson) { 18 | super(entryJson); 19 | } 20 | } 21 | 22 | public final int httpCode; 23 | 24 | public Map> responseHeaders; 25 | 26 | private JSONObject respJson; // the entire json-response 27 | 28 | public ListResult(int httpCode, JSONObject respJson) { 29 | this(httpCode, respJson, null); 30 | } 31 | 32 | public ListResult(int httpCode, JSONObject respJson,Map> responseHeaders) { 33 | this.httpCode = httpCode; 34 | this.respJson = respJson; 35 | this.responseHeaders = responseHeaders; 36 | initEntries(); 37 | } 38 | 39 | public int httpCode() { 40 | return httpCode; 41 | } 42 | 43 | public Map> getResponseHeaders() { 44 | return this.responseHeaders; 45 | } 46 | 47 | public JSONObject jsonResponse() { 48 | return respJson; 49 | } 50 | 51 | private void initEntries() { 52 | try { 53 | JSONArray arr = respJson.getJSONArray("list"); 54 | for (int i = 0; i < arr.length(); i++) { 55 | add(new Entry(arr.getJSONObject(i))); 56 | } 57 | } catch(JSONException exp) { 58 | throw new RuntimeException(exp.getMessage()); 59 | } 60 | } 61 | 62 | public String nextOffset() { 63 | String cursor = respJson.optString("next_offset"); 64 | return (cursor == null || cursor.isEmpty()) ? null : cursor; 65 | } 66 | 67 | @Override 68 | public String toString() { 69 | try { 70 | return respJson.toString(2); 71 | } catch (JSONException ex) { 72 | throw new RuntimeException(ex); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/RequestInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 ChargeBee Inc 3 | * All Rights Reserved. 4 | */ 5 | package com.chargebee; 6 | 7 | import com.chargebee.internal.RequestBase; 8 | 9 | /** 10 | * 11 | * @author cb-ajit 12 | */ 13 | public interface RequestInterceptor { 14 | 15 | public ApiResponse handleRequest(RequestWrap requestWrap) throws Exception; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/RequestWrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 ChargeBee Inc 3 | * All Rights Reserved. 4 | */ 5 | package com.chargebee; 6 | 7 | import com.chargebee.internal.RequestBase; 8 | import java.util.concurrent.Callable; 9 | 10 | /** 11 | * 12 | * @author cb-ajit 13 | * @param 14 | */ 15 | public abstract class RequestWrap implements Callable { 16 | 17 | public final Environment env; 18 | public final T request; 19 | 20 | public RequestWrap(Environment env, T request) { 21 | this.env = env; 22 | this.request = request; 23 | } 24 | 25 | public abstract ApiResponse call() throws Exception; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/Result.java: -------------------------------------------------------------------------------- 1 | package com.chargebee; 2 | 3 | import com.chargebee.internal.ResultBase; 4 | import org.json.JSONObject; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | import java.util.Optional; 9 | 10 | import static com.chargebee.IdempotencyConstants.IDEMPOTENCY_REPLAY_HEADER; 11 | 12 | public class Result extends ResultBase implements ApiResponse { 13 | 14 | public final int httpCode; 15 | public Map> responseHeaders; 16 | 17 | public Result(int httpCode, JSONObject jsonObj) { 18 | super(jsonObj); 19 | this.httpCode = httpCode; 20 | } 21 | 22 | public Result(int httpCode, JSONObject jsonObj, Map> responseHeaders) { 23 | this(httpCode,jsonObj); 24 | this.responseHeaders = responseHeaders; 25 | } 26 | 27 | public int httpCode() { 28 | return httpCode; 29 | } 30 | 31 | public Map> getResponseHeaders() { 32 | return responseHeaders; 33 | } 34 | 35 | public boolean isIdempotencyReplayed() { 36 | Map> headers = responseHeaders; 37 | Optional replayedHeader = headers.entrySet().stream() 38 | .filter(entry -> IDEMPOTENCY_REPLAY_HEADER.equalsIgnoreCase(entry.getKey())) 39 | .findFirst() 40 | .flatMap(entry -> entry.getValue().stream().findFirst()); 41 | 42 | return replayedHeader.isPresent(); 43 | } 44 | 45 | public JSONObject jsonResponse() { 46 | return jsonObj(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/Snippets.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package com.chargebee; 6 | 7 | import com.chargebee.models.*; 8 | 9 | /** 10 | * 11 | * @author rr 12 | */ 13 | public class Snippets { 14 | 15 | public static void main(String[] args) throws Exception { 16 | Environment.configure("fd_pre_production-test", "nXCFiuuDju8YnhL7G1BjJrF61cdY3xe2S"); 17 | Result result = Subscription.retrieve("26618").request(); 18 | Subscription subscription = result.subscription(); 19 | Customer customer = result.customer(); 20 | Card card = result.card(); 21 | System.out.println(subscription); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/exceptions/BatchAPIException.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.exceptions; 2 | 3 | import com.chargebee.APIException; 4 | import org.json.JSONObject; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import static com.chargebee.BatchConstants.CORRELATION_ID; 9 | 10 | public class BatchAPIException extends APIException { 11 | String correlationId; 12 | 13 | public BatchAPIException(int httpStatusCode, String message, JSONObject jsonObj) { 14 | super(httpStatusCode, message, jsonObj); 15 | this.correlationId = jsonObj.optString(CORRELATION_ID); 16 | } 17 | public BatchAPIException(int httpStatusCode, String message, JSONObject jsonObj, Map> responseHeaders) { 18 | super(httpStatusCode, message, jsonObj, responseHeaders); 19 | this.correlationId = jsonObj.optString(CORRELATION_ID); 20 | } 21 | public String getCorrelationId() { 22 | return correlationId; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/exceptions/InvalidRequestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 chargebee.com 3 | * All Rights Reserved. 4 | */ 5 | 6 | package com.chargebee.exceptions; 7 | 8 | import com.chargebee.APIException; 9 | import org.json.*; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | 14 | public class InvalidRequestException extends APIException{ 15 | 16 | public InvalidRequestException(int httpStatusCode, String message, JSONObject jsonObj) { 17 | super(httpStatusCode, message, jsonObj); 18 | } 19 | public InvalidRequestException(int httpStatusCode, String message, JSONObject jsonObj, Map> responseHeaders) { 20 | super(httpStatusCode, message, jsonObj, responseHeaders); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/exceptions/OperationFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 chargebee.com 3 | * All Rights Reserved. 4 | */ 5 | 6 | package com.chargebee.exceptions; 7 | 8 | import com.chargebee.APIException; 9 | import org.json.*; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | 14 | public class OperationFailedException extends APIException{ 15 | 16 | public OperationFailedException(int httpStatusCode, String message, JSONObject jsonObj) { 17 | super(httpStatusCode, message, jsonObj); 18 | } 19 | public OperationFailedException(int httpStatusCode, String message, JSONObject jsonObj, Map> responseHeaders) { 20 | super(httpStatusCode, message, jsonObj, responseHeaders); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/exceptions/PaymentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 chargebee.com 3 | * All Rights Reserved. 4 | */ 5 | 6 | package com.chargebee.exceptions; 7 | 8 | import com.chargebee.APIException; 9 | import org.json.*; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | 14 | public class PaymentException extends APIException{ 15 | 16 | public PaymentException(int httpStatusCode, String message, JSONObject jsonObj) { 17 | super(httpStatusCode, message, jsonObj); 18 | } 19 | public PaymentException(int httpStatusCode, String message, JSONObject jsonObj, Map> responseHeaders) { 20 | super(httpStatusCode, message, jsonObj, responseHeaders); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/BooleanFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import com.chargebee.internal.RequestBase; 4 | 5 | /** 6 | * 7 | * @author sangeetha 8 | * @param 9 | */ 10 | public class BooleanFilter { 11 | 12 | private U req; 13 | private String paramName; 14 | private boolean supportsPresenceOperator; 15 | 16 | public BooleanFilter(String paramName, U req) { 17 | this.paramName = paramName; 18 | this.req = req; 19 | } 20 | 21 | public U is(Boolean value) { 22 | req.params().addOpt(paramName + "[is]", value); 23 | return req; 24 | } 25 | 26 | public BooleanFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 27 | this.supportsPresenceOperator = supportsPresenceOperator; 28 | return this; 29 | } 30 | 31 | public U isPresent(boolean value) { 32 | if (!supportsPresenceOperator) { 33 | throw new UnsupportedOperationException("operator '[is_present]' is not supported for this filter-parameter"); 34 | } 35 | req.params().addOpt(paramName + "[is_present]", value); 36 | return req; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/DateFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import static com.chargebee.internal.Params.toValStr; 4 | import com.chargebee.internal.RequestBase; 5 | import java.util.Arrays; 6 | import java.util.Date; 7 | import java.util.List; 8 | import org.json.JSONArray; 9 | 10 | /** 11 | * 12 | * @author sangeetha 13 | * @param 14 | * @param 15 | */ 16 | public class DateFilter { 17 | 18 | private U req; 19 | private String paramName; 20 | private boolean supportsPresenceOperator; 21 | 22 | public DateFilter(String paramName, U req) { 23 | this.paramName = paramName; 24 | this.req = req; 25 | } 26 | 27 | public DateFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 28 | this.supportsPresenceOperator = supportsPresenceOperator; 29 | return this; 30 | } 31 | 32 | public U on(T value) { 33 | req.params().addOpt(paramName + "[on]", value); 34 | return req; 35 | } 36 | 37 | public U before(T value) { 38 | req.params().addOpt(paramName + "[before]", value); 39 | return req; 40 | } 41 | 42 | public U after(T value) { 43 | req.params().addOpt(paramName + "[after]", value); 44 | return req; 45 | } 46 | 47 | public U between(T value1, T value2) { 48 | JSONArray jArr = serialize(Arrays.asList(value1, value2)); 49 | req.params().addOpt(paramName + "[between]", jArr); 50 | return req; 51 | } 52 | 53 | public U isPresent(boolean value) { 54 | if (!supportsPresenceOperator) { 55 | throw new UnsupportedOperationException("operator '[is_present]' is not supported for this filter-parameter"); 56 | } 57 | req.params().addOpt(paramName + "[is_present]", value); 58 | return req; 59 | } 60 | 61 | private JSONArray serialize(List list){ 62 | JSONArray jArr = new JSONArray(); 63 | for(T dateTime : list){ 64 | jArr.put(toValStr(dateTime)); 65 | } 66 | return jArr; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/EnumFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import com.chargebee.internal.Params; 4 | import com.chargebee.internal.RequestBase; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import org.json.JSONArray; 8 | 9 | /** 10 | * 11 | * @author sangeetha 12 | * @param The enum type 13 | * @param 14 | */ 15 | public class EnumFilter { 16 | 17 | private U req; 18 | private String paramName; 19 | private boolean supportsPresenceOperator; 20 | private boolean supportsMultiOperators = true; 21 | 22 | public EnumFilter(String paramName, U req) { 23 | this.paramName = paramName; 24 | this.req = req; 25 | } 26 | 27 | public EnumFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 28 | this.supportsPresenceOperator = supportsPresenceOperator; 29 | return this; 30 | } 31 | 32 | public EnumFilter supportsMultiOperators(boolean supportsMultiOperators) { 33 | this.supportsMultiOperators = supportsMultiOperators; 34 | return this; 35 | } 36 | 37 | public U is(T value) { 38 | req.params().addOpt(paramName + "[is]", value); 39 | return req; 40 | } 41 | 42 | public U isNot(T value) { 43 | req.params().addOpt(paramName + "[is_not]", value); 44 | return req; 45 | } 46 | 47 | public U in(T... value) { 48 | if (!supportsMultiOperators) { 49 | throw new UnsupportedOperationException("operator '[in]' is not supported for this filter-parameter"); 50 | } 51 | JSONArray jArr = serialize(Arrays.asList(value)); 52 | req.params().addOpt(paramName + "[in]", jArr); 53 | return req; 54 | } 55 | 56 | public U notIn(T... value) { 57 | if (!supportsMultiOperators) { 58 | throw new UnsupportedOperationException("operator '[not_in]' is not supported for this filter-parameter"); 59 | } 60 | JSONArray jArr = serialize(Arrays.asList(value)); 61 | req.params().addOpt(paramName + "[not_in]", jArr); 62 | return req; 63 | } 64 | 65 | public U isPresent(boolean value) { 66 | if (!supportsPresenceOperator) { 67 | throw new UnsupportedOperationException("operator '[is_present]' is not supported for this filter-parameter"); 68 | } 69 | req.params().addOpt(paramName + "[is_present]", value); 70 | return req; 71 | } 72 | 73 | private JSONArray serialize(List list) { 74 | JSONArray jArr = new JSONArray(); 75 | for (T val : list) { 76 | jArr.put(Params.toValStr(val)); 77 | } 78 | return jArr; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/NumberFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import com.chargebee.internal.RequestBase; 4 | import java.util.Arrays; 5 | import org.json.JSONArray; 6 | 7 | /** 8 | * 9 | * @author sangeetha 10 | * @param 11 | * @param 12 | */ 13 | public class NumberFilter { 14 | 15 | private U req; 16 | private String paramName; 17 | private boolean supportsPresenceOperator; 18 | 19 | public NumberFilter(String paramName, U req) { 20 | this.paramName = paramName; 21 | this.req = req; 22 | } 23 | 24 | public NumberFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 25 | this.supportsPresenceOperator = supportsPresenceOperator; 26 | return this; 27 | } 28 | 29 | public U gt(T value) { 30 | req.params().addOpt(paramName+"[gt]" , value); 31 | return req; 32 | } 33 | 34 | public U lt(T value) { 35 | req.params().addOpt(paramName+"[lt]" , value); 36 | return req; 37 | } 38 | 39 | public U gte(T value) { 40 | req.params().addOpt(paramName+"[gte]" , value); 41 | return req; 42 | } 43 | 44 | public U lte(T value) { 45 | req.params().addOpt(paramName+"[lte]" , value); 46 | return req; 47 | } 48 | 49 | public U between(T val1, T val2){ 50 | JSONArray jArr = new JSONArray(Arrays.asList(val1,val2)); 51 | req.params().addOpt(paramName + "[between]", jArr); 52 | return req; 53 | } 54 | 55 | public U is(T value) { 56 | req.params().addOpt(paramName+"[is]" , value); 57 | return req; 58 | } 59 | 60 | public U isNot(T value) { 61 | req.params().addOpt(paramName+"[is_not]" , value); 62 | return req; 63 | } 64 | 65 | public U isPresent(boolean value) { 66 | if(!supportsPresenceOperator) { 67 | throw new UnsupportedOperationException("operator '[is_present]' is not supported for this filter-parameter"); 68 | } 69 | 70 | req.params().addOpt(paramName + "[is_present]", value); 71 | return req; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/StringFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import com.chargebee.internal.Request; 4 | import com.chargebee.internal.RequestBase; 5 | import java.util.Arrays; 6 | import org.json.JSONArray; 7 | 8 | /** 9 | * 10 | * @author sangeetha 11 | * @param 12 | */ 13 | public class StringFilter{ 14 | 15 | private U req; 16 | private String paramName; 17 | private boolean supportsMultiOperators; 18 | private boolean supportsPresenceOperator; 19 | 20 | public StringFilter(String paramName, U req) { 21 | this.paramName = paramName; 22 | this.req = req; 23 | this.supportsPresenceOperator = true; 24 | } 25 | 26 | public StringFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 27 | this.supportsPresenceOperator = supportsPresenceOperator; 28 | return this; 29 | } 30 | 31 | public StringFilter supportsMultiOperators(boolean supportsMultiOperators) { 32 | this.supportsMultiOperators = supportsMultiOperators; 33 | return this; 34 | } 35 | 36 | public U is(String value) { 37 | req.params().addOpt(paramName + "[is]", value); 38 | return req; 39 | } 40 | 41 | public U isNot(String value) { 42 | req.params().addOpt(paramName + "[is_not]", value); 43 | return req; 44 | } 45 | 46 | public U startsWith(String value) { 47 | req.params().addOpt(paramName + "[starts_with]", value); 48 | return req; 49 | } 50 | 51 | public U isPresent(boolean value) { 52 | if (!supportsPresenceOperator) { 53 | throw new UnsupportedOperationException("operator '[is_present]' is not supported for this filter-parameter"); 54 | } 55 | req.params().addOpt(paramName + "[is_present]", value); 56 | return req; 57 | } 58 | 59 | public U in(String... value) { 60 | if (!supportsMultiOperators) { 61 | throw new UnsupportedOperationException("operator '[in]' is not supported for this filter-parameter"); 62 | } 63 | JSONArray jArr = new JSONArray(Arrays.asList(value)); 64 | req.params().addOpt(paramName + "[in]", jArr); 65 | return req; 66 | } 67 | 68 | public U notIn(String... value) { 69 | if (!supportsMultiOperators) { 70 | throw new UnsupportedOperationException("operator '[not_in]' is not supported for this filter-parameter"); 71 | } 72 | JSONArray jArr = new JSONArray(Arrays.asList(value)); 73 | req.params().addOpt(paramName + "[not_in]", jArr); 74 | return req; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/TimestampFilter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters; 2 | 3 | import com.chargebee.internal.RequestBase; 4 | import java.sql.Timestamp; 5 | 6 | /** 7 | * 8 | * @author sangeetha 9 | * @param 10 | */ 11 | public class TimestampFilter extends DateFilter { 12 | 13 | public TimestampFilter(String paramName, U req) { 14 | super(paramName, req); 15 | } 16 | 17 | @Override 18 | public TimestampFilter supportsPresenceOperator(boolean supportsPresenceOperator) { 19 | super.supportsPresenceOperator(supportsPresenceOperator); 20 | return this; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/filters/enums/SortOrder.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.filters.enums; 2 | 3 | /** 4 | * 5 | * @author sangeetha 6 | */ 7 | public enum SortOrder { 8 | ASC, 9 | DESC, 10 | _UNKNOWN 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/gdata/Escaper.java: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2008 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | package com.chargebee.gdata; 18 | 19 | /** 20 | * An object that converts literal text into a format safe for inclusion in a 21 | * particular context (such as an XML document). Typically (but not always), the 22 | * inverse process of "unescaping" the text is performed automatically by the 23 | * relevant parser. 24 | * 25 | *

For example, an XML escaper would convert the literal string {@code 26 | * "Foo"} into {@code "Foo<Bar>"} to prevent {@code ""} from 27 | * being confused with an XML tag. When the resulting XML document is parsed, 28 | * the parser API will return this text as the original literal string {@code 29 | * "Foo"}. 30 | * 31 | *

An {@code Escaper} instance is required to be stateless, and safe when 32 | * used concurrently by multiple threads. 33 | * 34 | *

Several popular escapers are defined as constants in the class @see 35 | * com.google.common.escape.CharEscaper. To create your own escapers, use @see 36 | * com.google.common.escape.CharEscaperBuilder, or extend @see 37 | * com.google.common.escape.CharEscaper or {@code UnicodeEscaper}. 38 | * 39 | * 40 | */ 41 | public interface Escaper { 42 | /** 43 | * Returns the escaped form of a given literal string. 44 | * 45 | *

Note that this method may treat input characters differently depending on 46 | * the specific escaper implementation. 47 | *

    48 | *
  • {@link UnicodeEscaper} handles 49 | * UTF-16 correctly, 50 | * including surrogate character pairs. If the input is badly formed the 51 | * escaper should throw {@link IllegalArgumentException}. 52 | *
  • @see com.google.common.escape.CharEscaper handles Java characters independently and does not 53 | * verify the input for well formed characters. A CharEscaper should not be 54 | * used in situations where input is not guaranteed to be restricted to the 55 | * Basic Multilingual Plane (BMP). 56 | *
57 | * 58 | * @param string the literal string to be escaped 59 | * @return the escaped form of {@code string} 60 | * @throws NullPointerException if {@code string} is null 61 | * @throws IllegalArgumentException if {@code string} contains badly formed 62 | * UTF-16 or cannot be escaped for any other reason 63 | */ 64 | public String escape(String string); 65 | 66 | /** 67 | * Returns an {@code Appendable} instance which automatically escapes all 68 | * text appended to it before passing the resulting text to an underlying 69 | * {@code Appendable}. 70 | * 71 | *

Note that this method may treat input characters differently depending on 72 | * the specific escaper implementation. 73 | *

    74 | *
  • {@link UnicodeEscaper} handles 75 | * UTF-16 correctly, 76 | * including surrogate character pairs. If the input is badly formed the 77 | * escaper should throw {@link IllegalArgumentException}. 78 | *
  • @see com.google.common.escape.CharEscaper handles Java characters independently and does not 79 | * verify the input for well formed characters. A CharEscaper should not be 80 | * used in situations where input is not guaranteed to be restricted to the 81 | * Basic Multilingual Plane (BMP). 82 | *
83 | * 84 | * @param out the underlying {@code Appendable} to append escaped output to 85 | * @return an {@code Appendable} which passes text to {@code out} after 86 | * escaping it. 87 | */ 88 | public Appendable escape(Appendable out); 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/src/main/java/com/chargebee/internal/.DS_Store -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/BatchRequest.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | 4 | import com.chargebee.BatchEntry; 5 | import com.chargebee.BatchResult; 6 | import com.chargebee.Environment; 7 | import com.chargebee.Result; 8 | import org.json.JSONArray; 9 | import org.json.JSONObject; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import static com.chargebee.BatchConstants.REQUESTS_KEY; 15 | 16 | 17 | public class BatchRequest extends Request> { 18 | 19 | List entries = new ArrayList(); 20 | 21 | JSONObject jsonPayload = new JSONObject(); 22 | 23 | String pathParamName = null; 24 | 25 | public BatchRequest(HttpUtil.Method httpMeth, String uri) { 26 | super(httpMeth, uri); 27 | this.uri = "/batch" + uri; 28 | this.headers.put(HttpUtil.CONTENT_TYPE_HEADER_NAME, "application/json;charset=" + Environment.CHARSET); 29 | } 30 | 31 | public BatchRequest(HttpUtil.Method httpMeth, String uri, String pathParamName) { 32 | this(httpMeth, uri); 33 | this.pathParamName = pathParamName; 34 | } 35 | 36 | public BatchRequest addEntry(T requestObject) { 37 | entries.add(new BatchEntry(requestObject)); 38 | return this; 39 | } 40 | 41 | public BatchRequest addEntry(T requestObject, String correlationId) { 42 | entries.add(new BatchEntry(requestObject, correlationId)); 43 | return this; 44 | } 45 | 46 | public BatchRequest addEntries(List> requestObjects) { 47 | entries.addAll(requestObjects); 48 | return this; 49 | } 50 | 51 | @Override 52 | public BatchResult request() throws Exception { 53 | Result result = super.request(); 54 | return new BatchResult(result.httpCode, result.jsonObj(), result.responseHeaders).get(); 55 | } 56 | 57 | 58 | @Override 59 | public BatchResult request(Environment environment) throws Exception { 60 | Result result = super.request(environment); 61 | return new BatchResult(result.httpCode, result.jsonObj(), result.responseHeaders).get(); 62 | } 63 | 64 | public String buildRequest() { 65 | JSONArray batchRequestArray = new JSONArray(); 66 | for (Object batchEntry : this.entries) { 67 | JSONObject batchRequest = new JSONObject(); 68 | List parameterList = ((BatchEntry) batchEntry).getRequestObject().paramsV2().getParameters(); 69 | for (Parameter p : parameterList) { 70 | batchRequest = p.toJSONBody(batchRequest); 71 | } 72 | 73 | if (pathParamName != null) { 74 | batchRequest.put(pathParamName, ((BatchEntry) batchEntry).getRequestObject().pathParam()); 75 | } 76 | 77 | ((BatchEntry) batchEntry).setParameters(batchRequest); 78 | batchRequestArray.put(((BatchEntry) batchEntry).getJSON()); 79 | } 80 | jsonPayload.put(REQUESTS_KEY, batchRequestArray); 81 | return jsonPayload.toString(); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/ClazzUtil.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONObject; 4 | 5 | 6 | /** 7 | * 8 | * @author kps 9 | */ 10 | public class ClazzUtil { 11 | 12 | public static String getObjType(Class claz){ 13 | return toUnderScores(claz.getSimpleName()); 14 | } 15 | 16 | public static Class getClaz(String objType){ 17 | String pkg = "com.chargebee.models."; 18 | try { 19 | return Class.forName(pkg + toCamelCase(objType)); 20 | } catch (ClassNotFoundException ex) { 21 | throw new RuntimeException("Unknown obj type " + objType,ex); 22 | } 23 | } 24 | 25 | public static String toCamelCase(String name) { 26 | return toCamelCase(name.split("_")); 27 | } 28 | 29 | public static String toCamelCase(String[] parts) { 30 | StringBuilder buff = new StringBuilder(); 31 | for (String part : parts) { 32 | if (part.isEmpty()) { 33 | continue; 34 | } 35 | buff.append(Character.toUpperCase(part.charAt(0))); 36 | buff.append(part.substring(1)); 37 | } 38 | return buff.toString(); 39 | } 40 | 41 | public static String toUnderScores(String camelCaseName) { 42 | StringBuilder buf = new StringBuilder(camelCaseName.length() + 5); 43 | buf.append(Character.toLowerCase(camelCaseName.charAt(0))); 44 | for (int i = 1; i < camelCaseName.length(); i++) { 45 | char c = camelCaseName.charAt(i); 46 | if (Character.isUpperCase(c)) { 47 | buf.append('_'); 48 | c = Character.toLowerCase(c); 49 | } 50 | buf.append(c); 51 | } 52 | return buf.toString(); 53 | } 54 | 55 | public static T createInstance(Class claz, JSONObject _jobj) { 56 | try { 57 | return claz.getDeclaredConstructor(JSONObject.class).newInstance(_jobj); 58 | } catch(Exception exp) { 59 | throw new RuntimeException(exp); 60 | } 61 | } 62 | 63 | 64 | public static T createNumberInstance(Class claz, String val) { 65 | try { 66 | return claz.getConstructor(String.class).newInstance(val); 67 | } catch(Exception exp) { 68 | throw new RuntimeException(exp); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/CompositeArrayParameter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONObject; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public class CompositeArrayParameter extends CompositeParameter { 10 | Integer index; 11 | 12 | public CompositeArrayParameter(String name, String nestedParameterName, Integer index) { 13 | super(name, nestedParameterName); 14 | this.index = index; 15 | } 16 | 17 | @Override 18 | Map toFormURLEncoded(Map paramsMap) { 19 | return new HashMap() {{ 20 | put(name + "[" + nestedParameterName + "][" + index + "]", value); 21 | }}; 22 | } 23 | 24 | @Override 25 | JSONObject toJSONBody(JSONObject paramsJSON) { 26 | JSONArray existingArray = paramsJSON.opt(name) != null ? paramsJSON.optJSONArray(name) : new JSONArray(); 27 | if (index > 0 && existingArray.opt(index - 1) == null) { 28 | throw new RuntimeException("Please add items to the array with ordered array indices"); 29 | } 30 | JSONObject existingArrayItem = existingArray.optJSONObject(index) != null ? existingArray.optJSONObject(index) : new JSONObject(); 31 | existingArrayItem.put(nestedParameterName, value); 32 | existingArray.put(index, existingArrayItem); 33 | paramsJSON.put(name, existingArray); 34 | return paramsJSON; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/CompositeParameter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONObject; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class CompositeParameter extends Parameter { 9 | String nestedParameterName; 10 | 11 | public CompositeParameter(String name, String nestedParameterName) { 12 | this.name = name; 13 | this.nestedParameterName = nestedParameterName; 14 | } 15 | 16 | @Override 17 | Map toFormURLEncoded(Map paramsMap) { 18 | return new HashMap() {{ 19 | put(name + "[" + nestedParameterName + "]", value); 20 | }}; 21 | } 22 | 23 | @Override 24 | JSONObject toJSONBody(JSONObject paramsJSON) { 25 | return paramsJSON.put(name, new JSONObject().put(nestedParameterName, value)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/ListRequest.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import com.chargebee.RequestWrap; 4 | import com.chargebee.Environment; 5 | import com.chargebee.ListResult; 6 | import com.chargebee.filters.*; 7 | import java.io.IOException; 8 | import java.util.Date; 9 | 10 | public class ListRequest extends RequestBase{ 11 | 12 | 13 | public ListRequest(String uri) { 14 | this.uri = uri; 15 | } 16 | 17 | public ListRequest(String uri, String subDomain) { 18 | this.uri = uri; 19 | this.subDomain = subDomain; 20 | } 21 | 22 | public U limit(int limit) { 23 | params.addOpt("limit", limit); 24 | return (U)this; 25 | } 26 | 27 | public U offset(String offset) { 28 | params.addOpt("offset", offset); 29 | return (U)this; 30 | } 31 | 32 | public StringFilter stringFilterParam(String paramName){ 33 | return new StringFilter(paramName, (U)this).supportsPresenceOperator(true).supportsMultiOperators(true); 34 | } 35 | 36 | public BooleanFilter booleanFilterParam(String paramName){ 37 | return new BooleanFilter(paramName, (U)this).supportsPresenceOperator(true); 38 | } 39 | 40 | public NumberFilter longFilterParam(String paramName) { 41 | return new NumberFilter(paramName, (U) this).supportsPresenceOperator(true); 42 | } 43 | 44 | public TimestampFilter timestampFilterParam(String paramName){ 45 | return new TimestampFilter(paramName, (U)this).supportsPresenceOperator(true); 46 | } 47 | 48 | public DateFilter dateFilterParam(String paramName){ 49 | return new DateFilter(paramName, (U)this).supportsPresenceOperator(true); 50 | } 51 | 52 | public final ListResult request() throws Exception { 53 | return request(Environment.defaultConfig()); 54 | } 55 | 56 | public final ListResult request(Environment env) throws IOException, Exception { 57 | RequestWrap c = new RequestWrap(env, this) { 58 | 59 | @Override 60 | public ListResult call() throws Exception { 61 | return _request(env, request); 62 | } 63 | }; 64 | return (ListResult) (env.reqInterceptor() != null ? env.reqInterceptor().handleRequest(c) : c.call()); 65 | 66 | } 67 | 68 | private static ListResult _request(Environment env, ListRequest req) throws IOException { 69 | if (env == null) { 70 | throw new RuntimeException("Environment cannot be null"); 71 | } 72 | String baseUrl; 73 | if(req.subDomain != null) { 74 | baseUrl = env.apiBaseUrlWithSubDomain(req.subDomain); 75 | } else { 76 | baseUrl = env.apiBaseUrl(); 77 | } 78 | String url = new StringBuilder(baseUrl).append(req.uri).toString(); 79 | return HttpUtil.getList(url, req.params(), req.headers, env); 80 | } 81 | 82 | @Override 83 | public Params params() { 84 | return params; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/Parameter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONObject; 4 | 5 | import java.util.Map; 6 | 7 | public abstract class Parameter { 8 | 9 | String name; 10 | 11 | Object value; 12 | 13 | public void setValue(Object value) { 14 | this.value = value; 15 | } 16 | 17 | abstract Map toFormURLEncoded(Map paramsMap); 18 | 19 | abstract JSONObject toJSONBody(JSONObject requestJSON); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/Params.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import java.sql.Timestamp; 4 | import java.text.SimpleDateFormat; 5 | import java.util.*; 6 | import org.json.JSONArray; 7 | import org.json.JSONException; 8 | import org.json.JSONObject; 9 | import java.math.BigDecimal; 10 | 11 | public class Params { 12 | 13 | private Map m = new HashMap(); 14 | 15 | public void add(String paramName, Object value) { 16 | if(value == null) { 17 | throw new RuntimeException("The param {" + paramName + "} cannot be null"); 18 | } 19 | m.put(paramName, toValStr(value)); 20 | } 21 | 22 | public void addOpt(String paramName, Object value) { 23 | m.put(paramName, value != null ? toValStr(value) : ""); 24 | } 25 | 26 | public int size() { 27 | return m.size(); 28 | } 29 | 30 | public boolean isEmpty() { 31 | return m.isEmpty(); 32 | } 33 | 34 | public Set keys() { 35 | return m.keySet(); 36 | } 37 | 38 | public Set> entries() { 39 | return m.entrySet(); 40 | } 41 | 42 | public static Object toValStr(Object value) { 43 | Class c = value.getClass(); 44 | if(c == String.class || c == Integer.class || c == Long.class || c == Boolean.class || c == Double.class || c == BigDecimal.class) { 45 | return value.toString(); 46 | } else if (c == Date.class) { 47 | return new SimpleDateFormat("yyyy-MM-dd").format((Date)value); 48 | } 49 | else if(c.isEnum()) { 50 | return value.toString().toLowerCase(); 51 | } else if(c == Timestamp.class) { 52 | return String.valueOf(asUnixTimestamp((Timestamp)value)); 53 | } else if(value instanceof List){ 54 | List origList = ((List)value); 55 | List l = new ArrayList(origList.size()); 56 | for (Object item : origList) { 57 | l.add((String)toValStr(item)); 58 | } 59 | return l; 60 | } else if(value instanceof Object[]){ 61 | Object[] origList = ((Object[])value); 62 | List l = new ArrayList(origList.length); 63 | for (Object item : origList) { 64 | l.add((String)toValStr(item)); 65 | } 66 | return l; 67 | } else if(value instanceof JSONObject) { 68 | return value.toString(); 69 | } else if(value instanceof JSONArray) { 70 | return value.toString(); 71 | } else if(value instanceof Map){ 72 | return value.toString(); 73 | }else { 74 | throw new RuntimeException("Type [" + c.getName() + "] not handled"); 75 | } 76 | } 77 | 78 | public static Long asUnixTimestamp(Timestamp ts) { 79 | return ts.getTime() / 1000; 80 | } 81 | 82 | @Override 83 | public String toString() { 84 | return m.toString(); 85 | } 86 | 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/ParamsV2.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class ParamsV2 { 7 | 8 | private List parameters = new ArrayList(); 9 | 10 | public List getParameters() { 11 | return parameters; 12 | } 13 | 14 | public void add(Parameter p, Object value) { 15 | if(value == null) { 16 | throw new RuntimeException("The param {" + p.name + "} cannot be null"); 17 | } 18 | p.setValue(Params.toValStr(value)); 19 | parameters.add(p); 20 | } 21 | 22 | public void addOpt(Parameter p, Object value) { 23 | p.setValue(value == null ? "" : Params.toValStr(value)); 24 | parameters.add(p); 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/PrimitiveArrayParameter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONObject; 5 | 6 | import java.util.Map; 7 | 8 | public class PrimitiveArrayParameter extends Parameter { 9 | Integer index; 10 | public PrimitiveArrayParameter(String name, Integer index) { 11 | this.name = name; 12 | this.index = index; 13 | } 14 | @Override 15 | Map toFormURLEncoded(Map paramsMap) { 16 | paramsMap.put(name + "[" + index + "]", value); 17 | return paramsMap; 18 | } 19 | 20 | @Override 21 | JSONObject toJSONBody(JSONObject paramsJSON) { 22 | JSONArray existingArray = paramsJSON.opt(name) != null ? paramsJSON.optJSONArray(name) : new JSONArray(); 23 | existingArray.put(index, value); 24 | paramsJSON.put(name, existingArray); 25 | return paramsJSON; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/PrimitiveParameter.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import org.json.JSONObject; 4 | 5 | import java.util.Map; 6 | 7 | public class PrimitiveParameter extends Parameter { 8 | 9 | public PrimitiveParameter(String name) { 10 | this.name = name; 11 | } 12 | 13 | @Override 14 | Map toFormURLEncoded(Map paramsMap) { 15 | paramsMap.put(name, value); 16 | return paramsMap; 17 | } 18 | 19 | @Override 20 | JSONObject toJSONBody(JSONObject paramsJSON) { 21 | paramsJSON.put(name, value); 22 | return paramsJSON; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/Request.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.HttpUtil.Method; 5 | 6 | import java.io.*; 7 | 8 | public class Request extends RequestBase{ 9 | 10 | private final HttpUtil.Method httpMeth; 11 | private String pathParam = null; 12 | public Request(Method httpMeth, String uri) { 13 | this.uri = uri; 14 | this.httpMeth = httpMeth; 15 | } 16 | 17 | public Request(Method httpMeth, String uri, String pathParam) { 18 | this(httpMeth, uri); 19 | this.pathParam = pathParam; 20 | this.isJsonRequest = false; 21 | } 22 | 23 | public Request(Method httpMeth, String uri, String pathParam, String subDomain) { 24 | this(httpMeth, uri); 25 | this.pathParam = pathParam; 26 | this.subDomain = subDomain; 27 | this.isJsonRequest = false; 28 | } 29 | 30 | public Request(Method httpMethod, String uri, String pathParam, String subDomain, boolean isContentTypeJson){ 31 | this(httpMethod, uri); 32 | this.pathParam = pathParam; 33 | this.subDomain = subDomain; 34 | this.isJsonRequest = isContentTypeJson; 35 | } 36 | 37 | public U param(String paramName, Object value){ 38 | params.add(paramName, value); 39 | return (U)this; 40 | } 41 | 42 | public Result request() throws Exception { 43 | return request(Environment.defaultConfig()); 44 | } 45 | 46 | public Result request(Environment env) throws Exception { 47 | RequestWrap c = new RequestWrap(env, this) { 48 | 49 | @Override 50 | public Result call() throws Exception { 51 | return _request(env, request); 52 | } 53 | }; 54 | return (Result) (env.reqInterceptor() != null ? env.reqInterceptor().handleRequest(c) : c.call()); 55 | } 56 | 57 | private static Result _request(Environment env, Request req) throws IOException { 58 | if (env == null) { 59 | throw new RuntimeException("Environment cannot be null"); 60 | } 61 | String baseUrl; 62 | if(req.subDomain != null) { 63 | baseUrl = env.apiBaseUrlWithSubDomain(req.subDomain); 64 | } else { 65 | baseUrl = env.apiBaseUrl(); 66 | } 67 | String url = new StringBuilder(baseUrl).append(req.uri).toString(); 68 | switch (req.httpMeth) { 69 | case GET: 70 | return HttpUtil.get(url, req.params(), req.headers, env); 71 | case POST: 72 | if(req instanceof BatchRequest) { 73 | return HttpUtil.post(url, ((BatchRequest) req).buildRequest(), req.headers, env); 74 | } else if(req.isJsonRequest){ 75 | req.headers.put(HttpUtil.CONTENT_TYPE_HEADER_NAME, "application/json;charset=" + Environment.CHARSET); 76 | return HttpUtil.post(url, req.params.toString(), req.headers, env); 77 | }else { 78 | return HttpUtil.post(url, req.params(), req.headers, env); 79 | } 80 | default: 81 | throw new RuntimeException("Not handled type [" + req.httpMeth + "]"); 82 | } 83 | } 84 | 85 | @Override 86 | public Params params() { 87 | return params; 88 | } 89 | 90 | public HttpUtil.Method httpMeth() { 91 | return httpMeth; 92 | } 93 | 94 | public String pathParam() { 95 | return pathParam; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/RequestBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 chargebee.com 3 | * All Rights Reserved. 4 | */ 5 | 6 | package com.chargebee.internal; 7 | 8 | 9 | import java.util.*; 10 | 11 | import static com.chargebee.IdempotencyConstants.IDEMPOTENCY_HEADER; 12 | 13 | public class RequestBase { 14 | 15 | protected String uri; 16 | protected Params params = new Params(); 17 | protected ParamsV2 paramsV2 = new ParamsV2(); 18 | protected Map headers = new HashMap(); 19 | protected String subDomain; 20 | protected boolean isJsonRequest; 21 | 22 | public U setIdempotencyKey(String idempotencyKey){ 23 | headers.put(IDEMPOTENCY_HEADER, idempotencyKey); 24 | return (U)this; 25 | } 26 | 27 | public Params params() { 28 | return params; 29 | } 30 | 31 | public ParamsV2 paramsV2() { 32 | return paramsV2; 33 | } 34 | 35 | public U header(String headerName,String headerValue){ 36 | headers.put(headerName, headerValue); 37 | return (U)this; 38 | } 39 | 40 | public String uri() { 41 | return uri; 42 | } 43 | 44 | public Map headers() { 45 | return headers; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/internal/StringJoiner.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.internal; 2 | 3 | /** 4 | * Util class to create concatenated string !! 5 | */ 6 | public class StringJoiner { 7 | 8 | private StringBuilder buff = new StringBuilder(); 9 | private String delim; 10 | 11 | public StringJoiner(String delim) { 12 | this.delim = delim; 13 | } 14 | 15 | public boolean isEmpty() { 16 | return buff.length() == 0; 17 | } 18 | 19 | public StringJoiner add(String element) { 20 | if(buff.length() != 0) { // not the first-time 21 | buff.append(delim); 22 | } 23 | if(element == null || element.isEmpty()) { // empty 24 | throw new IllegalArgumentException("Cannot add null/empty element"); 25 | } 26 | buff.append(element); 27 | return this; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return buff.toString(); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chargebee/chargebee-java/c2dcdfcdac042f0709cd4c93ebb477f0c0d49a90/src/main/java/com/chargebee/models/.DS_Store -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/AdvanceInvoiceSchedule.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class AdvanceInvoiceSchedule extends Resource { 15 | 16 | public enum ScheduleType { 17 | FIXED_INTERVALS, 18 | SPECIFIC_DATES, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | public static class FixedIntervalSchedule extends Resource { 24 | public enum EndScheduleOn { 25 | AFTER_NUMBER_OF_INTERVALS,SPECIFIC_DATE,SUBSCRIPTION_END, 26 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 27 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 28 | } 29 | 30 | public FixedIntervalSchedule(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | public EndScheduleOn endScheduleOn() { 35 | return optEnum("end_schedule_on", EndScheduleOn.class); 36 | } 37 | 38 | public Integer numberOfOccurrences() { 39 | return optInteger("number_of_occurrences"); 40 | } 41 | 42 | public Integer daysBeforeRenewal() { 43 | return optInteger("days_before_renewal"); 44 | } 45 | 46 | public Timestamp endDate() { 47 | return optTimestamp("end_date"); 48 | } 49 | 50 | public Timestamp createdAt() { 51 | return reqTimestamp("created_at"); 52 | } 53 | 54 | public Integer termsToCharge() { 55 | return optInteger("terms_to_charge"); 56 | } 57 | 58 | } 59 | 60 | public static class SpecificDatesSchedule extends Resource { 61 | public SpecificDatesSchedule(JSONObject jsonObj) { 62 | super(jsonObj); 63 | } 64 | 65 | public Integer termsToCharge() { 66 | return optInteger("terms_to_charge"); 67 | } 68 | 69 | public Timestamp date() { 70 | return optTimestamp("date"); 71 | } 72 | 73 | public Timestamp createdAt() { 74 | return reqTimestamp("created_at"); 75 | } 76 | 77 | } 78 | 79 | //Constructors 80 | //============ 81 | 82 | public AdvanceInvoiceSchedule(String jsonStr) { 83 | super(jsonStr); 84 | } 85 | 86 | public AdvanceInvoiceSchedule(JSONObject jsonObj) { 87 | super(jsonObj); 88 | } 89 | 90 | // Fields 91 | //======= 92 | 93 | public String id() { 94 | return reqString("id"); 95 | } 96 | 97 | public ScheduleType scheduleType() { 98 | return optEnum("schedule_type", ScheduleType.class); 99 | } 100 | 101 | public AdvanceInvoiceSchedule.FixedIntervalSchedule fixedIntervalSchedule() { 102 | return optSubResource("fixed_interval_schedule", AdvanceInvoiceSchedule.FixedIntervalSchedule.class); 103 | } 104 | 105 | public AdvanceInvoiceSchedule.SpecificDatesSchedule specificDatesSchedule() { 106 | return optSubResource("specific_dates_schedule", AdvanceInvoiceSchedule.SpecificDatesSchedule.class); 107 | } 108 | 109 | // Operations 110 | //=========== 111 | 112 | 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Attribute.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Attribute extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Attribute(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Attribute(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String name() { 31 | return reqString("name"); 32 | } 33 | 34 | public String value() { 35 | return reqString("value"); 36 | } 37 | 38 | // Operations 39 | //=========== 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/BusinessEntityTransfer.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class BusinessEntityTransfer extends Resource { 15 | 16 | public enum ResourceType { 17 | CUSTOMER, 18 | SUBSCRIPTION, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | public enum ReasonCode { 24 | CORRECTION, 25 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 26 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 27 | } 28 | 29 | //Constructors 30 | //============ 31 | 32 | public BusinessEntityTransfer(String jsonStr) { 33 | super(jsonStr); 34 | } 35 | 36 | public BusinessEntityTransfer(JSONObject jsonObj) { 37 | super(jsonObj); 38 | } 39 | 40 | // Fields 41 | //======= 42 | 43 | public String id() { 44 | return reqString("id"); 45 | } 46 | 47 | public ResourceType resourceType() { 48 | return reqEnum("resource_type", ResourceType.class); 49 | } 50 | 51 | public String resourceId() { 52 | return reqString("resource_id"); 53 | } 54 | 55 | public String activeResourceId() { 56 | return reqString("active_resource_id"); 57 | } 58 | 59 | public String destinationBusinessEntityId() { 60 | return reqString("destination_business_entity_id"); 61 | } 62 | 63 | public String sourceBusinessEntityId() { 64 | return reqString("source_business_entity_id"); 65 | } 66 | 67 | public ReasonCode reasonCode() { 68 | return reqEnum("reason_code", ReasonCode.class); 69 | } 70 | 71 | public Timestamp createdAt() { 72 | return reqTimestamp("created_at"); 73 | } 74 | 75 | // Operations 76 | //=========== 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Comment.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Comment extends Resource { 15 | 16 | public enum Type { 17 | USER, 18 | SYSTEM, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | //Constructors 24 | //============ 25 | 26 | public Comment(String jsonStr) { 27 | super(jsonStr); 28 | } 29 | 30 | public Comment(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | // Fields 35 | //======= 36 | 37 | public String id() { 38 | return reqString("id"); 39 | } 40 | 41 | public EntityType entityType() { 42 | return reqEnum("entity_type", EntityType.class); 43 | } 44 | 45 | public String addedBy() { 46 | return optString("added_by"); 47 | } 48 | 49 | public String notes() { 50 | return reqString("notes"); 51 | } 52 | 53 | public Timestamp createdAt() { 54 | return reqTimestamp("created_at"); 55 | } 56 | 57 | public Type type() { 58 | return reqEnum("type", Type.class); 59 | } 60 | 61 | public String entityId() { 62 | return reqString("entity_id"); 63 | } 64 | 65 | // Operations 66 | //=========== 67 | 68 | public static CreateRequest create() { 69 | String uri = uri("comments"); 70 | return new CreateRequest(Method.POST, uri); 71 | } 72 | 73 | public static Request retrieve(String id) { 74 | String uri = uri("comments", nullCheck(id)); 75 | return new Request(Method.GET, uri); 76 | } 77 | 78 | public static CommentListRequest list() { 79 | String uri = uri("comments"); 80 | return new CommentListRequest(uri); 81 | } 82 | 83 | public static Request delete(String id) { 84 | String uri = uri("comments", nullCheck(id), "delete"); 85 | return new Request(Method.POST, uri); 86 | } 87 | 88 | 89 | // Operation Request Classes 90 | //========================== 91 | 92 | public static class CreateRequest extends Request { 93 | 94 | private CreateRequest(Method httpMeth, String uri) { 95 | super(httpMeth, uri); 96 | } 97 | 98 | public CreateRequest entityType(com.chargebee.models.enums.EntityType entityType) { 99 | params.add("entity_type", entityType); 100 | return this; 101 | } 102 | 103 | 104 | public CreateRequest entityId(String entityId) { 105 | params.add("entity_id", entityId); 106 | return this; 107 | } 108 | 109 | 110 | public CreateRequest notes(String notes) { 111 | params.add("notes", notes); 112 | return this; 113 | } 114 | 115 | 116 | public CreateRequest addedBy(String addedBy) { 117 | params.addOpt("added_by", addedBy); 118 | return this; 119 | } 120 | 121 | 122 | @Override 123 | public Params params() { 124 | return params; 125 | } 126 | } 127 | 128 | public static class CommentListRequest extends ListRequest { 129 | 130 | private CommentListRequest(String uri) { 131 | super(uri); 132 | } 133 | 134 | public CommentListRequest entityType(com.chargebee.models.enums.EntityType entityType) { 135 | params.addOpt("entity_type", entityType); 136 | return this; 137 | } 138 | 139 | 140 | public CommentListRequest entityId(String entityId) { 141 | params.addOpt("entity_id", entityId); 142 | return this; 143 | } 144 | 145 | 146 | public TimestampFilter createdAt() { 147 | return new TimestampFilter("created_at",this); 148 | } 149 | 150 | 151 | public CommentListRequest sortByCreatedAt(SortOrder order) { 152 | params.addOpt("sort_by["+order.name().toLowerCase()+"]","created_at"); 153 | return this; 154 | } 155 | 156 | 157 | @Override 158 | public Params params() { 159 | return params; 160 | } 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Configuration.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Configuration extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Configuration(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Configuration(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String domain() { 31 | return optString("domain"); 32 | } 33 | 34 | public ProductCatalogVersion productCatalogVersion() { 35 | return optEnum("product_catalog_version", ProductCatalogVersion.class); 36 | } 37 | 38 | // Operations 39 | //=========== 40 | 41 | public static Request list() { 42 | String uri = uri("configurations"); 43 | return new Request(Method.GET, uri); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Contact.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Contact extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Contact(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Contact(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String id() { 31 | return reqString("id"); 32 | } 33 | 34 | public String firstName() { 35 | return optString("first_name"); 36 | } 37 | 38 | public String lastName() { 39 | return optString("last_name"); 40 | } 41 | 42 | public String email() { 43 | return reqString("email"); 44 | } 45 | 46 | public String phone() { 47 | return optString("phone"); 48 | } 49 | 50 | public String label() { 51 | return optString("label"); 52 | } 53 | 54 | public Boolean enabled() { 55 | return reqBoolean("enabled"); 56 | } 57 | 58 | public Boolean sendAccountEmail() { 59 | return reqBoolean("send_account_email"); 60 | } 61 | 62 | public Boolean sendBillingEmail() { 63 | return reqBoolean("send_billing_email"); 64 | } 65 | 66 | // Operations 67 | //=========== 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ContractTerm.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ContractTerm extends Resource { 15 | 16 | public enum Status { 17 | ACTIVE, 18 | COMPLETED, 19 | CANCELLED, 20 | TERMINATED, 21 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 22 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 23 | } 24 | 25 | public enum ActionAtTermEnd { 26 | RENEW, 27 | EVERGREEN, 28 | CANCEL, 29 | RENEW_ONCE, 30 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 31 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 32 | } 33 | 34 | //Constructors 35 | //============ 36 | 37 | public ContractTerm(String jsonStr) { 38 | super(jsonStr); 39 | } 40 | 41 | public ContractTerm(JSONObject jsonObj) { 42 | super(jsonObj); 43 | } 44 | 45 | // Fields 46 | //======= 47 | 48 | public String id() { 49 | return reqString("id"); 50 | } 51 | 52 | public Status status() { 53 | return reqEnum("status", Status.class); 54 | } 55 | 56 | public Timestamp contractStart() { 57 | return reqTimestamp("contract_start"); 58 | } 59 | 60 | public Timestamp contractEnd() { 61 | return reqTimestamp("contract_end"); 62 | } 63 | 64 | public Integer billingCycle() { 65 | return reqInteger("billing_cycle"); 66 | } 67 | 68 | public ActionAtTermEnd actionAtTermEnd() { 69 | return reqEnum("action_at_term_end", ActionAtTermEnd.class); 70 | } 71 | 72 | public Long totalContractValue() { 73 | return reqLong("total_contract_value"); 74 | } 75 | 76 | public Long totalContractValueBeforeTax() { 77 | return reqLong("total_contract_value_before_tax"); 78 | } 79 | 80 | public Integer cancellationCutoffPeriod() { 81 | return optInteger("cancellation_cutoff_period"); 82 | } 83 | 84 | public Timestamp createdAt() { 85 | return reqTimestamp("created_at"); 86 | } 87 | 88 | public String subscriptionId() { 89 | return reqString("subscription_id"); 90 | } 91 | 92 | public Integer remainingBillingCycles() { 93 | return optInteger("remaining_billing_cycles"); 94 | } 95 | 96 | // Operations 97 | //=========== 98 | 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/CouponCode.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class CouponCode extends Resource { 15 | 16 | public enum Status { 17 | NOT_REDEEMED, 18 | REDEEMED, 19 | ARCHIVED, 20 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 21 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 22 | } 23 | 24 | //Constructors 25 | //============ 26 | 27 | public CouponCode(String jsonStr) { 28 | super(jsonStr); 29 | } 30 | 31 | public CouponCode(JSONObject jsonObj) { 32 | super(jsonObj); 33 | } 34 | 35 | // Fields 36 | //======= 37 | 38 | public String code() { 39 | return reqString("code"); 40 | } 41 | 42 | public Status status() { 43 | return reqEnum("status", Status.class); 44 | } 45 | 46 | public String couponId() { 47 | return reqString("coupon_id"); 48 | } 49 | 50 | public String couponSetId() { 51 | return reqString("coupon_set_id"); 52 | } 53 | 54 | public String couponSetName() { 55 | return reqString("coupon_set_name"); 56 | } 57 | 58 | // Operations 59 | //=========== 60 | 61 | @Deprecated 62 | public static CreateRequest create() { 63 | String uri = uri("coupon_codes"); 64 | return new CreateRequest(Method.POST, uri); 65 | } 66 | 67 | public static Request retrieve(String id) { 68 | String uri = uri("coupon_codes", nullCheck(id)); 69 | return new Request(Method.GET, uri); 70 | } 71 | 72 | public static CouponCodeListRequest list() { 73 | String uri = uri("coupon_codes"); 74 | return new CouponCodeListRequest(uri); 75 | } 76 | 77 | public static Request archive(String id) { 78 | String uri = uri("coupon_codes", nullCheck(id), "archive"); 79 | return new Request(Method.POST, uri); 80 | } 81 | 82 | 83 | // Operation Request Classes 84 | //========================== 85 | 86 | public static class CreateRequest extends Request { 87 | 88 | private CreateRequest(Method httpMeth, String uri) { 89 | super(httpMeth, uri); 90 | } 91 | 92 | public CreateRequest couponId(String couponId) { 93 | params.add("coupon_id", couponId); 94 | return this; 95 | } 96 | 97 | 98 | public CreateRequest couponSetName(String couponSetName) { 99 | params.add("coupon_set_name", couponSetName); 100 | return this; 101 | } 102 | 103 | 104 | public CreateRequest code(String code) { 105 | params.add("code", code); 106 | return this; 107 | } 108 | 109 | 110 | @Override 111 | public Params params() { 112 | return params; 113 | } 114 | } 115 | 116 | public static class CouponCodeListRequest extends ListRequest { 117 | 118 | private CouponCodeListRequest(String uri) { 119 | super(uri); 120 | } 121 | 122 | public StringFilter code() { 123 | return new StringFilter("code",this).supportsMultiOperators(true); 124 | } 125 | 126 | 127 | public StringFilter couponId() { 128 | return new StringFilter("coupon_id",this).supportsMultiOperators(true); 129 | } 130 | 131 | 132 | public StringFilter couponSetName() { 133 | return new StringFilter("coupon_set_name",this); 134 | } 135 | 136 | 137 | public EnumFilter status() { 138 | return new EnumFilter("status",this); 139 | } 140 | 141 | 142 | @Override 143 | public Params params() { 144 | return params; 145 | } 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Currency.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Currency extends Resource { 15 | 16 | public enum ForexType { 17 | MANUAL, 18 | AUTO, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | //Constructors 24 | //============ 25 | 26 | public Currency(String jsonStr) { 27 | super(jsonStr); 28 | } 29 | 30 | public Currency(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | // Fields 35 | //======= 36 | 37 | public String id() { 38 | return optString("id"); 39 | } 40 | 41 | public Boolean enabled() { 42 | return reqBoolean("enabled"); 43 | } 44 | 45 | public ForexType forexType() { 46 | return optEnum("forex_type", ForexType.class); 47 | } 48 | 49 | public String currencyCode() { 50 | return optString("currency_code"); 51 | } 52 | 53 | public Boolean isBaseCurrency() { 54 | return optBoolean("is_base_currency"); 55 | } 56 | 57 | public String manualExchangeRate() { 58 | return optString("manual_exchange_rate"); 59 | } 60 | 61 | // Operations 62 | //=========== 63 | 64 | public static Request list() { 65 | String uri = uri("currencies", "list"); 66 | return new Request(Method.GET, uri); 67 | } 68 | 69 | public static Request retrieve(String id) { 70 | String uri = uri("currencies", nullCheck(id)); 71 | return new Request(Method.GET, uri); 72 | } 73 | 74 | public static CreateRequest create() { 75 | String uri = uri("currencies"); 76 | return new CreateRequest(Method.POST, uri); 77 | } 78 | 79 | public static UpdateRequest update(String id) { 80 | String uri = uri("currencies", nullCheck(id)); 81 | return new UpdateRequest(Method.POST, uri); 82 | } 83 | 84 | public static AddScheduleRequest addSchedule(String id) { 85 | String uri = uri("currencies", nullCheck(id), "add_schedule"); 86 | return new AddScheduleRequest(Method.POST, uri); 87 | } 88 | 89 | public static Request removeSchedule(String id) { 90 | String uri = uri("currencies", nullCheck(id), "remove_schedule"); 91 | return new Request(Method.POST, uri); 92 | } 93 | 94 | 95 | // Operation Request Classes 96 | //========================== 97 | 98 | public static class CreateRequest extends Request { 99 | 100 | private CreateRequest(Method httpMeth, String uri) { 101 | super(httpMeth, uri); 102 | } 103 | 104 | public CreateRequest currencyCode(String currencyCode) { 105 | params.add("currency_code", currencyCode); 106 | return this; 107 | } 108 | 109 | 110 | public CreateRequest forexType(Currency.ForexType forexType) { 111 | params.add("forex_type", forexType); 112 | return this; 113 | } 114 | 115 | 116 | public CreateRequest manualExchangeRate(String manualExchangeRate) { 117 | params.addOpt("manual_exchange_rate", manualExchangeRate); 118 | return this; 119 | } 120 | 121 | 122 | @Override 123 | public Params params() { 124 | return params; 125 | } 126 | } 127 | 128 | public static class UpdateRequest extends Request { 129 | 130 | private UpdateRequest(Method httpMeth, String uri) { 131 | super(httpMeth, uri); 132 | } 133 | 134 | public UpdateRequest forexType(Currency.ForexType forexType) { 135 | params.add("forex_type", forexType); 136 | return this; 137 | } 138 | 139 | 140 | public UpdateRequest manualExchangeRate(String manualExchangeRate) { 141 | params.addOpt("manual_exchange_rate", manualExchangeRate); 142 | return this; 143 | } 144 | 145 | 146 | @Override 147 | public Params params() { 148 | return params; 149 | } 150 | } 151 | 152 | public static class AddScheduleRequest extends Request { 153 | 154 | private AddScheduleRequest(Method httpMeth, String uri) { 155 | super(httpMeth, uri); 156 | } 157 | 158 | public AddScheduleRequest manualExchangeRate(String manualExchangeRate) { 159 | params.add("manual_exchange_rate", manualExchangeRate); 160 | return this; 161 | } 162 | 163 | 164 | public AddScheduleRequest scheduleAt(Timestamp scheduleAt) { 165 | params.add("schedule_at", scheduleAt); 166 | return this; 167 | } 168 | 169 | 170 | @Override 171 | public Params params() { 172 | return params; 173 | } 174 | } 175 | 176 | } 177 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/CustomerEntitlement.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class CustomerEntitlement extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public CustomerEntitlement(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public CustomerEntitlement(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String customerId() { 31 | return reqString("customer_id"); 32 | } 33 | 34 | public String subscriptionId() { 35 | return optString("subscription_id"); 36 | } 37 | 38 | public String featureId() { 39 | return optString("feature_id"); 40 | } 41 | 42 | public String value() { 43 | return optString("value"); 44 | } 45 | 46 | public String name() { 47 | return optString("name"); 48 | } 49 | 50 | public Boolean isEnabled() { 51 | return reqBoolean("is_enabled"); 52 | } 53 | 54 | // Operations 55 | //=========== 56 | 57 | public static ListRequest entitlementsForCustomer(String id) { 58 | String uri = uri("customers", nullCheck(id), "customer_entitlements"); 59 | return new ListRequest(uri); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Discount.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Discount extends Resource { 15 | 16 | public enum Type { 17 | FIXED_AMOUNT, 18 | PERCENTAGE, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | //Constructors 24 | //============ 25 | 26 | public Discount(String jsonStr) { 27 | super(jsonStr); 28 | } 29 | 30 | public Discount(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | // Fields 35 | //======= 36 | 37 | public String id() { 38 | return reqString("id"); 39 | } 40 | 41 | public String invoiceName() { 42 | return optString("invoice_name"); 43 | } 44 | 45 | public Type type() { 46 | return reqEnum("type", Type.class); 47 | } 48 | 49 | public Double percentage() { 50 | return optDouble("percentage"); 51 | } 52 | 53 | public Long amount() { 54 | return optLong("amount"); 55 | } 56 | 57 | public String currencyCode() { 58 | return optString("currency_code"); 59 | } 60 | 61 | public DurationType durationType() { 62 | return reqEnum("duration_type", DurationType.class); 63 | } 64 | 65 | public Integer period() { 66 | return optInteger("period"); 67 | } 68 | 69 | public PeriodUnit periodUnit() { 70 | return optEnum("period_unit", PeriodUnit.class); 71 | } 72 | 73 | public Boolean includedInMrr() { 74 | return reqBoolean("included_in_mrr"); 75 | } 76 | 77 | public ApplyOn applyOn() { 78 | return reqEnum("apply_on", ApplyOn.class); 79 | } 80 | 81 | public String itemPriceId() { 82 | return optString("item_price_id"); 83 | } 84 | 85 | public Timestamp createdAt() { 86 | return reqTimestamp("created_at"); 87 | } 88 | 89 | public Timestamp applyTill() { 90 | return optTimestamp("apply_till"); 91 | } 92 | 93 | public Integer appliedCount() { 94 | return optInteger("applied_count"); 95 | } 96 | 97 | public String couponId() { 98 | return reqString("coupon_id"); 99 | } 100 | 101 | public Integer index() { 102 | return reqInteger("index"); 103 | } 104 | 105 | // Operations 106 | //=========== 107 | 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Download.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Download extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Download(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Download(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String downloadUrl() { 31 | return reqString("download_url"); 32 | } 33 | 34 | public Timestamp validTill() { 35 | return reqTimestamp("valid_till"); 36 | } 37 | 38 | public String mimeType() { 39 | return optString("mime_type"); 40 | } 41 | 42 | // Operations 43 | //=========== 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Entitlement.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Entitlement extends Resource { 15 | 16 | public enum EntityType { 17 | PLAN, 18 | ADDON, 19 | CHARGE, 20 | PLAN_PRICE, 21 | ADDON_PRICE, 22 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 23 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 24 | } 25 | 26 | //Constructors 27 | //============ 28 | 29 | public Entitlement(String jsonStr) { 30 | super(jsonStr); 31 | } 32 | 33 | public Entitlement(JSONObject jsonObj) { 34 | super(jsonObj); 35 | } 36 | 37 | // Fields 38 | //======= 39 | 40 | public String id() { 41 | return reqString("id"); 42 | } 43 | 44 | public String entityId() { 45 | return optString("entity_id"); 46 | } 47 | 48 | public EntityType entityType() { 49 | return optEnum("entity_type", EntityType.class); 50 | } 51 | 52 | public String featureId() { 53 | return optString("feature_id"); 54 | } 55 | 56 | public String featureName() { 57 | return optString("feature_name"); 58 | } 59 | 60 | public String value() { 61 | return optString("value"); 62 | } 63 | 64 | public String name() { 65 | return optString("name"); 66 | } 67 | 68 | // Operations 69 | //=========== 70 | 71 | public static EntitlementListRequest list() { 72 | String uri = uri("entitlements"); 73 | return new EntitlementListRequest(uri); 74 | } 75 | 76 | public static CreateRequest create() { 77 | String uri = uri("entitlements"); 78 | return new CreateRequest(Method.POST, uri); 79 | } 80 | 81 | 82 | // Operation Request Classes 83 | //========================== 84 | 85 | public static class EntitlementListRequest extends ListRequest { 86 | 87 | private EntitlementListRequest(String uri) { 88 | super(uri); 89 | } 90 | 91 | public StringFilter featureId() { 92 | return new StringFilter("feature_id",this).supportsMultiOperators(true); 93 | } 94 | 95 | 96 | public EnumFilter entityType() { 97 | return new EnumFilter("entity_type",this).supportsMultiOperators(true); 98 | } 99 | 100 | 101 | public StringFilter entityId() { 102 | return new StringFilter("entity_id",this).supportsMultiOperators(true); 103 | } 104 | 105 | 106 | @Deprecated 107 | public EntitlementListRequest includeDrafts(Boolean includeDrafts) { 108 | params.addOpt("include_drafts", includeDrafts); 109 | return this; 110 | } 111 | 112 | 113 | @Deprecated 114 | public EntitlementListRequest embed(String embed) { 115 | params.addOpt("embed", embed); 116 | return this; 117 | } 118 | 119 | 120 | @Override 121 | public Params params() { 122 | return params; 123 | } 124 | } 125 | 126 | public static class CreateRequest extends Request { 127 | 128 | private CreateRequest(Method httpMeth, String uri) { 129 | super(httpMeth, uri); 130 | } 131 | 132 | public CreateRequest action(com.chargebee.models.enums.Action action) { 133 | params.add("action", action); 134 | return this; 135 | } 136 | 137 | 138 | public CreateRequest entitlementEntityId(int index, String entitlementEntityId) { 139 | params.add("entitlements[entity_id][" + index + "]", entitlementEntityId); 140 | return this; 141 | } 142 | public CreateRequest entitlementFeatureId(int index, String entitlementFeatureId) { 143 | params.add("entitlements[feature_id][" + index + "]", entitlementFeatureId); 144 | return this; 145 | } 146 | public CreateRequest entitlementEntityType(int index, Entitlement.EntityType entitlementEntityType) { 147 | params.addOpt("entitlements[entity_type][" + index + "]", entitlementEntityType); 148 | return this; 149 | } 150 | public CreateRequest entitlementValue(int index, String entitlementValue) { 151 | params.addOpt("entitlements[value][" + index + "]", entitlementValue); 152 | return this; 153 | } 154 | @Override 155 | public Params params() { 156 | return params; 157 | } 158 | } 159 | 160 | } 161 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/GatewayErrorDetail.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class GatewayErrorDetail extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public GatewayErrorDetail(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public GatewayErrorDetail(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String requestId() { 31 | return optString("request_id"); 32 | } 33 | 34 | public String errorCategory() { 35 | return optString("error_category"); 36 | } 37 | 38 | public String errorCode() { 39 | return optString("error_code"); 40 | } 41 | 42 | public String errorMessage() { 43 | return optString("error_message"); 44 | } 45 | 46 | public String declineCode() { 47 | return optString("decline_code"); 48 | } 49 | 50 | public String declineMessage() { 51 | return optString("decline_message"); 52 | } 53 | 54 | public String networkErrorCode() { 55 | return optString("network_error_code"); 56 | } 57 | 58 | public String networkErrorMessage() { 59 | return optString("network_error_message"); 60 | } 61 | 62 | public String errorField() { 63 | return optString("error_field"); 64 | } 65 | 66 | public String recommendationCode() { 67 | return optString("recommendation_code"); 68 | } 69 | 70 | public String recommendationMessage() { 71 | return optString("recommendation_message"); 72 | } 73 | 74 | public String processorErrorCode() { 75 | return optString("processor_error_code"); 76 | } 77 | 78 | public String processorErrorMessage() { 79 | return optString("processor_error_message"); 80 | } 81 | 82 | public String errorCauseId() { 83 | return optString("error_cause_id"); 84 | } 85 | 86 | // Operations 87 | //=========== 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Hierarchy.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Hierarchy extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Hierarchy(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Hierarchy(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String customerId() { 31 | return reqString("customer_id"); 32 | } 33 | 34 | public String parentId() { 35 | return optString("parent_id"); 36 | } 37 | 38 | public String paymentOwnerId() { 39 | return reqString("payment_owner_id"); 40 | } 41 | 42 | public String invoiceOwnerId() { 43 | return reqString("invoice_owner_id"); 44 | } 45 | 46 | public List childrenIds() { 47 | return optList("children_ids", String.class); 48 | } 49 | 50 | // Operations 51 | //=========== 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ImpactedItem.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ImpactedItem extends Resource { 15 | 16 | public static class Download extends Resource { 17 | public Download(JSONObject jsonObj) { 18 | super(jsonObj); 19 | } 20 | 21 | public String downloadUrl() { 22 | return reqString("download_url"); 23 | } 24 | 25 | public Timestamp validTill() { 26 | return reqTimestamp("valid_till"); 27 | } 28 | 29 | public String mimeType() { 30 | return optString("mime_type"); 31 | } 32 | 33 | } 34 | 35 | //Constructors 36 | //============ 37 | 38 | public ImpactedItem(String jsonStr) { 39 | super(jsonStr); 40 | } 41 | 42 | public ImpactedItem(JSONObject jsonObj) { 43 | super(jsonObj); 44 | } 45 | 46 | // Fields 47 | //======= 48 | 49 | public Integer count() { 50 | return optInteger("count"); 51 | } 52 | 53 | public ImpactedItem.Download download() { 54 | return optSubResource("download", ImpactedItem.Download.class); 55 | } 56 | 57 | public JSONArray items() { 58 | return optJSONArray("items"); 59 | } 60 | 61 | // Operations 62 | //=========== 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ImpactedItemPrice.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ImpactedItemPrice extends Resource { 15 | 16 | public static class Download extends Resource { 17 | public Download(JSONObject jsonObj) { 18 | super(jsonObj); 19 | } 20 | 21 | public String downloadUrl() { 22 | return reqString("download_url"); 23 | } 24 | 25 | public Timestamp validTill() { 26 | return reqTimestamp("valid_till"); 27 | } 28 | 29 | public String mimeType() { 30 | return optString("mime_type"); 31 | } 32 | 33 | } 34 | 35 | //Constructors 36 | //============ 37 | 38 | public ImpactedItemPrice(String jsonStr) { 39 | super(jsonStr); 40 | } 41 | 42 | public ImpactedItemPrice(JSONObject jsonObj) { 43 | super(jsonObj); 44 | } 45 | 46 | // Fields 47 | //======= 48 | 49 | public Integer count() { 50 | return optInteger("count"); 51 | } 52 | 53 | public ImpactedItemPrice.Download download() { 54 | return optSubResource("download", ImpactedItemPrice.Download.class); 55 | } 56 | 57 | public JSONArray itemPrices() { 58 | return optJSONArray("item_prices"); 59 | } 60 | 61 | // Operations 62 | //=========== 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ImpactedSubscription.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ImpactedSubscription extends Resource { 15 | 16 | public static class Download extends Resource { 17 | public Download(JSONObject jsonObj) { 18 | super(jsonObj); 19 | } 20 | 21 | public String downloadUrl() { 22 | return reqString("download_url"); 23 | } 24 | 25 | public Timestamp validTill() { 26 | return reqTimestamp("valid_till"); 27 | } 28 | 29 | public String mimeType() { 30 | return optString("mime_type"); 31 | } 32 | 33 | } 34 | 35 | //Constructors 36 | //============ 37 | 38 | public ImpactedSubscription(String jsonStr) { 39 | super(jsonStr); 40 | } 41 | 42 | public ImpactedSubscription(JSONObject jsonObj) { 43 | super(jsonObj); 44 | } 45 | 46 | // Fields 47 | //======= 48 | 49 | public Integer count() { 50 | return optInteger("count"); 51 | } 52 | 53 | public ImpactedSubscription.Download download() { 54 | return optSubResource("download", ImpactedSubscription.Download.class); 55 | } 56 | 57 | public JSONArray subscriptionIds() { 58 | return optJSONArray("subscription_ids"); 59 | } 60 | 61 | // Operations 62 | //=========== 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Metadata.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Metadata extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public Metadata(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public Metadata(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public String changeType() { 31 | return optString("change_type"); 32 | } 33 | 34 | // Operations 35 | //=========== 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/OmnichannelSubscriptionItem.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class OmnichannelSubscriptionItem extends Resource { 15 | 16 | public enum Status { 17 | ACTIVE, 18 | EXPIRED, 19 | CANCELLED, 20 | IN_DUNNING, 21 | IN_GRACE_PERIOD, 22 | PAUSED, 23 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 24 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 25 | } 26 | 27 | public enum AutoRenewStatus { 28 | OFF, 29 | ON, 30 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 31 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 32 | } 33 | 34 | public enum ExpirationReason { 35 | BILLING_ERROR, 36 | PRODUCT_NOT_AVAILABLE, 37 | OTHER, 38 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 39 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 40 | } 41 | 42 | public enum CancellationReason { 43 | CUSTOMER_CANCELLED, 44 | CUSTOMER_DID_NOT_CONSENT_TO_PRICE_INCREASE, 45 | REFUNDED_DUE_TO_APP_ISSUE, 46 | REFUNDED_FOR_OTHER_REASON, 47 | MERCHANT_REVOKED, 48 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 49 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 50 | } 51 | 52 | public static class UpcomingRenewal extends Resource { 53 | public UpcomingRenewal(JSONObject jsonObj) { 54 | super(jsonObj); 55 | } 56 | 57 | public String priceCurrency() { 58 | return optString("price_currency"); 59 | } 60 | 61 | public Long priceUnits() { 62 | return optLong("price_units"); 63 | } 64 | 65 | public Long priceNanos() { 66 | return optLong("price_nanos"); 67 | } 68 | 69 | } 70 | 71 | //Constructors 72 | //============ 73 | 74 | public OmnichannelSubscriptionItem(String jsonStr) { 75 | super(jsonStr); 76 | } 77 | 78 | public OmnichannelSubscriptionItem(JSONObject jsonObj) { 79 | super(jsonObj); 80 | } 81 | 82 | // Fields 83 | //======= 84 | 85 | public String id() { 86 | return reqString("id"); 87 | } 88 | 89 | public String itemIdAtSource() { 90 | return reqString("item_id_at_source"); 91 | } 92 | 93 | public String itemParentIdAtSource() { 94 | return optString("item_parent_id_at_source"); 95 | } 96 | 97 | public Status status() { 98 | return reqEnum("status", Status.class); 99 | } 100 | 101 | public AutoRenewStatus autoRenewStatus() { 102 | return optEnum("auto_renew_status", AutoRenewStatus.class); 103 | } 104 | 105 | public Timestamp currentTermStart() { 106 | return optTimestamp("current_term_start"); 107 | } 108 | 109 | public Timestamp currentTermEnd() { 110 | return optTimestamp("current_term_end"); 111 | } 112 | 113 | public Timestamp expiredAt() { 114 | return optTimestamp("expired_at"); 115 | } 116 | 117 | public ExpirationReason expirationReason() { 118 | return optEnum("expiration_reason", ExpirationReason.class); 119 | } 120 | 121 | public Timestamp cancelledAt() { 122 | return optTimestamp("cancelled_at"); 123 | } 124 | 125 | public CancellationReason cancellationReason() { 126 | return optEnum("cancellation_reason", CancellationReason.class); 127 | } 128 | 129 | public Timestamp gracePeriodExpiresAt() { 130 | return optTimestamp("grace_period_expires_at"); 131 | } 132 | 133 | public Boolean hasScheduledChanges() { 134 | return reqBoolean("has_scheduled_changes"); 135 | } 136 | 137 | public Long resourceVersion() { 138 | return optLong("resource_version"); 139 | } 140 | 141 | public OmnichannelSubscriptionItem.UpcomingRenewal upcomingRenewal() { 142 | return optSubResource("upcoming_renewal", OmnichannelSubscriptionItem.UpcomingRenewal.class); 143 | } 144 | 145 | // Operations 146 | //=========== 147 | 148 | public static ListRequest listOmniSubItemScheduleChanges(String id) { 149 | String uri = uri("omnichannel_subscription_items", nullCheck(id), "scheduled_changes"); 150 | return new ListRequest(uri); 151 | } 152 | 153 | 154 | } 155 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/OmnichannelSubscriptionItemScheduledChange.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class OmnichannelSubscriptionItemScheduledChange extends Resource { 15 | 16 | public enum ChangeType { 17 | DOWNGRADE, 18 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 19 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 20 | } 21 | 22 | public static class CurrentState extends Resource { 23 | public CurrentState(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | public String itemIdAtSource() { 28 | return optString("item_id_at_source"); 29 | } 30 | 31 | } 32 | 33 | public static class ScheduledState extends Resource { 34 | public ScheduledState(JSONObject jsonObj) { 35 | super(jsonObj); 36 | } 37 | 38 | public String itemIdAtSource() { 39 | return optString("item_id_at_source"); 40 | } 41 | 42 | } 43 | 44 | //Constructors 45 | //============ 46 | 47 | public OmnichannelSubscriptionItemScheduledChange(String jsonStr) { 48 | super(jsonStr); 49 | } 50 | 51 | public OmnichannelSubscriptionItemScheduledChange(JSONObject jsonObj) { 52 | super(jsonObj); 53 | } 54 | 55 | // Fields 56 | //======= 57 | 58 | public String id() { 59 | return optString("id"); 60 | } 61 | 62 | public String omnichannelSubscriptionItemId() { 63 | return optString("omnichannel_subscription_item_id"); 64 | } 65 | 66 | public Timestamp scheduledAt() { 67 | return reqTimestamp("scheduled_at"); 68 | } 69 | 70 | public ChangeType changeType() { 71 | return reqEnum("change_type", ChangeType.class); 72 | } 73 | 74 | public Timestamp createdAt() { 75 | return reqTimestamp("created_at"); 76 | } 77 | 78 | public Timestamp modifiedAt() { 79 | return reqTimestamp("modified_at"); 80 | } 81 | 82 | public Long resourceVersion() { 83 | return optLong("resource_version"); 84 | } 85 | 86 | public OmnichannelSubscriptionItemScheduledChange.CurrentState currentState() { 87 | return optSubResource("current_state", OmnichannelSubscriptionItemScheduledChange.CurrentState.class); 88 | } 89 | 90 | public OmnichannelSubscriptionItemScheduledChange.ScheduledState scheduledState() { 91 | return optSubResource("scheduled_state", OmnichannelSubscriptionItemScheduledChange.ScheduledState.class); 92 | } 93 | 94 | // Operations 95 | //=========== 96 | 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/OmnichannelTransaction.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class OmnichannelTransaction extends Resource { 15 | 16 | public enum Type { 17 | PURCHASE, 18 | RENEWAL, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | //Constructors 24 | //============ 25 | 26 | public OmnichannelTransaction(String jsonStr) { 27 | super(jsonStr); 28 | } 29 | 30 | public OmnichannelTransaction(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | // Fields 35 | //======= 36 | 37 | public String id() { 38 | return reqString("id"); 39 | } 40 | 41 | public String idAtSource() { 42 | return reqString("id_at_source"); 43 | } 44 | 45 | public String appId() { 46 | return reqString("app_id"); 47 | } 48 | 49 | public String priceCurrency() { 50 | return optString("price_currency"); 51 | } 52 | 53 | public Long priceUnits() { 54 | return optLong("price_units"); 55 | } 56 | 57 | public Long priceNanos() { 58 | return optLong("price_nanos"); 59 | } 60 | 61 | public Type type() { 62 | return reqEnum("type", Type.class); 63 | } 64 | 65 | public Timestamp transactedAt() { 66 | return optTimestamp("transacted_at"); 67 | } 68 | 69 | public Timestamp createdAt() { 70 | return reqTimestamp("created_at"); 71 | } 72 | 73 | public Long resourceVersion() { 74 | return optLong("resource_version"); 75 | } 76 | 77 | // Operations 78 | //=========== 79 | 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/PaymentReferenceNumber.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class PaymentReferenceNumber extends Resource { 15 | 16 | public enum Type { 17 | KID, 18 | OCR, 19 | FRN, 20 | FIK, 21 | SWISS_REFERENCE, 22 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 23 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 24 | } 25 | 26 | //Constructors 27 | //============ 28 | 29 | public PaymentReferenceNumber(String jsonStr) { 30 | super(jsonStr); 31 | } 32 | 33 | public PaymentReferenceNumber(JSONObject jsonObj) { 34 | super(jsonObj); 35 | } 36 | 37 | // Fields 38 | //======= 39 | 40 | public String id() { 41 | return reqString("id"); 42 | } 43 | 44 | public Type type() { 45 | return reqEnum("type", Type.class); 46 | } 47 | 48 | public String number() { 49 | return reqString("number"); 50 | } 51 | 52 | public String invoiceId() { 53 | return optString("invoice_id"); 54 | } 55 | 56 | // Operations 57 | //=========== 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/PaymentSchedule.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class PaymentSchedule extends Resource { 15 | 16 | public enum EntityType { 17 | INVOICE, 18 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 19 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 20 | } 21 | 22 | public static class ScheduleEntry extends Resource { 23 | public enum Status { 24 | POSTED,PAYMENT_DUE,PAID, 25 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 26 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 27 | } 28 | 29 | public ScheduleEntry(JSONObject jsonObj) { 30 | super(jsonObj); 31 | } 32 | 33 | public String id() { 34 | return reqString("id"); 35 | } 36 | 37 | public Timestamp date() { 38 | return reqTimestamp("date"); 39 | } 40 | 41 | public Long amount() { 42 | return reqLong("amount"); 43 | } 44 | 45 | public Status status() { 46 | return reqEnum("status", Status.class); 47 | } 48 | 49 | } 50 | 51 | //Constructors 52 | //============ 53 | 54 | public PaymentSchedule(String jsonStr) { 55 | super(jsonStr); 56 | } 57 | 58 | public PaymentSchedule(JSONObject jsonObj) { 59 | super(jsonObj); 60 | } 61 | 62 | // Fields 63 | //======= 64 | 65 | public String id() { 66 | return reqString("id"); 67 | } 68 | 69 | public String schemeId() { 70 | return reqString("scheme_id"); 71 | } 72 | 73 | public EntityType entityType() { 74 | return reqEnum("entity_type", EntityType.class); 75 | } 76 | 77 | public String entityId() { 78 | return reqString("entity_id"); 79 | } 80 | 81 | public Long amount() { 82 | return optLong("amount"); 83 | } 84 | 85 | public Timestamp createdAt() { 86 | return reqTimestamp("created_at"); 87 | } 88 | 89 | public Long resourceVersion() { 90 | return optLong("resource_version"); 91 | } 92 | 93 | public Timestamp updatedAt() { 94 | return optTimestamp("updated_at"); 95 | } 96 | 97 | public String currencyCode() { 98 | return optString("currency_code"); 99 | } 100 | 101 | public List scheduleEntries() { 102 | return optList("schedule_entries", PaymentSchedule.ScheduleEntry.class); 103 | } 104 | 105 | // Operations 106 | //=========== 107 | 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/PaymentScheduleEstimate.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class PaymentScheduleEstimate extends Resource { 15 | 16 | public enum EntityType { 17 | INVOICE, 18 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 19 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 20 | } 21 | 22 | public static class ScheduleEntry extends Resource { 23 | public enum Status { 24 | POSTED,PAYMENT_DUE,PAID, 25 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 26 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 27 | } 28 | 29 | public ScheduleEntry(JSONObject jsonObj) { 30 | super(jsonObj); 31 | } 32 | 33 | public String id() { 34 | return reqString("id"); 35 | } 36 | 37 | public Timestamp date() { 38 | return reqTimestamp("date"); 39 | } 40 | 41 | public Long amount() { 42 | return reqLong("amount"); 43 | } 44 | 45 | public Status status() { 46 | return reqEnum("status", Status.class); 47 | } 48 | 49 | } 50 | 51 | //Constructors 52 | //============ 53 | 54 | public PaymentScheduleEstimate(String jsonStr) { 55 | super(jsonStr); 56 | } 57 | 58 | public PaymentScheduleEstimate(JSONObject jsonObj) { 59 | super(jsonObj); 60 | } 61 | 62 | // Fields 63 | //======= 64 | 65 | public String id() { 66 | return reqString("id"); 67 | } 68 | 69 | public String schemeId() { 70 | return reqString("scheme_id"); 71 | } 72 | 73 | public EntityType entityType() { 74 | return reqEnum("entity_type", EntityType.class); 75 | } 76 | 77 | public String entityId() { 78 | return optString("entity_id"); 79 | } 80 | 81 | public Long amount() { 82 | return reqLong("amount"); 83 | } 84 | 85 | public String currencyCode() { 86 | return optString("currency_code"); 87 | } 88 | 89 | public List scheduleEntries() { 90 | return optList("schedule_entries", PaymentScheduleEstimate.ScheduleEntry.class); 91 | } 92 | 93 | // Operations 94 | //=========== 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/PaymentScheduleScheme.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.math.BigDecimal; 12 | import java.sql.Timestamp; 13 | import java.util.*; 14 | 15 | public class PaymentScheduleScheme extends Resource { 16 | 17 | public enum PeriodUnit { 18 | DAY, 19 | WEEK, 20 | MONTH, 21 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 22 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 23 | } 24 | 25 | public static class PreferredSchedule extends Resource { 26 | public PreferredSchedule(JSONObject jsonObj) { 27 | super(jsonObj); 28 | } 29 | 30 | public Integer period() { 31 | return optInteger("period"); 32 | } 33 | 34 | public BigDecimal amountPercentage() { 35 | return optBigDecimal("amount_percentage"); 36 | } 37 | 38 | } 39 | 40 | //Constructors 41 | //============ 42 | 43 | public PaymentScheduleScheme(String jsonStr) { 44 | super(jsonStr); 45 | } 46 | 47 | public PaymentScheduleScheme(JSONObject jsonObj) { 48 | super(jsonObj); 49 | } 50 | 51 | // Fields 52 | //======= 53 | 54 | public String id() { 55 | return reqString("id"); 56 | } 57 | 58 | public String name() { 59 | return optString("name"); 60 | } 61 | 62 | public String description() { 63 | return optString("description"); 64 | } 65 | 66 | public Integer numberOfSchedules() { 67 | return reqInteger("number_of_schedules"); 68 | } 69 | 70 | public PeriodUnit periodUnit() { 71 | return reqEnum("period_unit", PeriodUnit.class); 72 | } 73 | 74 | public Integer period() { 75 | return optInteger("period"); 76 | } 77 | 78 | public Timestamp createdAt() { 79 | return reqTimestamp("created_at"); 80 | } 81 | 82 | public Long resourceVersion() { 83 | return optLong("resource_version"); 84 | } 85 | 86 | public Timestamp updatedAt() { 87 | return optTimestamp("updated_at"); 88 | } 89 | 90 | @Deprecated 91 | public List preferredSchedules() { 92 | return optList("preferred_schedules", PaymentScheduleScheme.PreferredSchedule.class); 93 | } 94 | 95 | // Operations 96 | //=========== 97 | 98 | public static CreateRequest create() { 99 | String uri = uri("payment_schedule_schemes"); 100 | return new CreateRequest(Method.POST, uri); 101 | } 102 | 103 | public static Request retrieve(String id) { 104 | String uri = uri("payment_schedule_schemes", nullCheck(id)); 105 | return new Request(Method.GET, uri); 106 | } 107 | 108 | public static Request delete(String id) { 109 | String uri = uri("payment_schedule_schemes", nullCheck(id), "delete"); 110 | return new Request(Method.POST, uri); 111 | } 112 | 113 | 114 | // Operation Request Classes 115 | //========================== 116 | 117 | public static class CreateRequest extends Request { 118 | 119 | private CreateRequest(Method httpMeth, String uri) { 120 | super(httpMeth, uri); 121 | } 122 | 123 | public CreateRequest numberOfSchedules(Integer numberOfSchedules) { 124 | params.add("number_of_schedules", numberOfSchedules); 125 | return this; 126 | } 127 | 128 | 129 | public CreateRequest periodUnit(PaymentScheduleScheme.PeriodUnit periodUnit) { 130 | params.add("period_unit", periodUnit); 131 | return this; 132 | } 133 | 134 | 135 | public CreateRequest period(Integer period) { 136 | params.addOpt("period", period); 137 | return this; 138 | } 139 | 140 | 141 | public CreateRequest name(String name) { 142 | params.add("name", name); 143 | return this; 144 | } 145 | 146 | 147 | public CreateRequest flexibleSchedulePeriod(int index, Integer flexibleSchedulePeriod) { 148 | params.addOpt("flexible_schedules[period][" + index + "]", flexibleSchedulePeriod); 149 | return this; 150 | } 151 | public CreateRequest flexibleScheduleAmountPercentage(int index, BigDecimal flexibleScheduleAmountPercentage) { 152 | params.addOpt("flexible_schedules[amount_percentage][" + index + "]", flexibleScheduleAmountPercentage); 153 | return this; 154 | } 155 | @Override 156 | public Params params() { 157 | return params; 158 | } 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/RecordedPurchase.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class RecordedPurchase extends Resource { 15 | 16 | public enum Source { 17 | APPLE_APP_STORE, 18 | GOOGLE_PLAY_STORE, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | public enum Status { 24 | IN_PROCESS, 25 | COMPLETED, 26 | FAILED, 27 | IGNORED, 28 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 29 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 30 | } 31 | 32 | public static class LinkedOmnichannelSubscription extends Resource { 33 | public LinkedOmnichannelSubscription(JSONObject jsonObj) { 34 | super(jsonObj); 35 | } 36 | 37 | public String omnichannelSubscriptionId() { 38 | return optString("omnichannel_subscription_id"); 39 | } 40 | 41 | } 42 | 43 | public static class ErrorDetail extends Resource { 44 | public ErrorDetail(JSONObject jsonObj) { 45 | super(jsonObj); 46 | } 47 | 48 | public String errorMessage() { 49 | return optString("error_message"); 50 | } 51 | 52 | } 53 | 54 | //Constructors 55 | //============ 56 | 57 | public RecordedPurchase(String jsonStr) { 58 | super(jsonStr); 59 | } 60 | 61 | public RecordedPurchase(JSONObject jsonObj) { 62 | super(jsonObj); 63 | } 64 | 65 | // Fields 66 | //======= 67 | 68 | public String id() { 69 | return reqString("id"); 70 | } 71 | 72 | public String customerId() { 73 | return reqString("customer_id"); 74 | } 75 | 76 | public String appId() { 77 | return reqString("app_id"); 78 | } 79 | 80 | public Source source() { 81 | return reqEnum("source", Source.class); 82 | } 83 | 84 | public Status status() { 85 | return reqEnum("status", Status.class); 86 | } 87 | 88 | public String omnichannelTransactionId() { 89 | return optString("omnichannel_transaction_id"); 90 | } 91 | 92 | public Timestamp createdAt() { 93 | return reqTimestamp("created_at"); 94 | } 95 | 96 | public Long resourceVersion() { 97 | return optLong("resource_version"); 98 | } 99 | 100 | public List linkedOmnichannelSubscriptions() { 101 | return optList("linked_omnichannel_subscriptions", RecordedPurchase.LinkedOmnichannelSubscription.class); 102 | } 103 | 104 | public RecordedPurchase.ErrorDetail errorDetail() { 105 | return optSubResource("error_detail", RecordedPurchase.ErrorDetail.class); 106 | } 107 | 108 | // Operations 109 | //=========== 110 | 111 | public static CreateRequest create() { 112 | String uri = uri("recorded_purchases"); 113 | return new CreateRequest(Method.POST, uri); 114 | } 115 | 116 | public static Request retrieve(String id) { 117 | String uri = uri("recorded_purchases", nullCheck(id)); 118 | return new Request(Method.GET, uri); 119 | } 120 | 121 | 122 | // Operation Request Classes 123 | //========================== 124 | 125 | public static class CreateRequest extends Request { 126 | 127 | private CreateRequest(Method httpMeth, String uri) { 128 | super(httpMeth, uri); 129 | } 130 | 131 | public CreateRequest appId(String appId) { 132 | params.add("app_id", appId); 133 | return this; 134 | } 135 | 136 | 137 | public CreateRequest customerId(String customerId) { 138 | params.add("customer[id]", customerId); 139 | return this; 140 | } 141 | 142 | public CreateRequest appleAppStoreTransactionId(String appleAppStoreTransactionId) { 143 | params.addOpt("apple_app_store[transaction_id]", appleAppStoreTransactionId); 144 | return this; 145 | } 146 | 147 | public CreateRequest appleAppStoreReceipt(String appleAppStoreReceipt) { 148 | params.addOpt("apple_app_store[receipt]", appleAppStoreReceipt); 149 | return this; 150 | } 151 | 152 | public CreateRequest appleAppStoreProductId(String appleAppStoreProductId) { 153 | params.addOpt("apple_app_store[product_id]", appleAppStoreProductId); 154 | return this; 155 | } 156 | 157 | public CreateRequest googlePlayStorePurchaseToken(String googlePlayStorePurchaseToken) { 158 | params.addOpt("google_play_store[purchase_token]", googlePlayStorePurchaseToken); 159 | return this; 160 | } 161 | 162 | @Override 163 | public Params params() { 164 | return params; 165 | } 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ResourceMigration.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ResourceMigration extends Resource { 15 | 16 | public enum Status { 17 | SCHEDULED, 18 | FAILED, 19 | SUCCEEDED, 20 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 21 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 22 | } 23 | 24 | //Constructors 25 | //============ 26 | 27 | public ResourceMigration(String jsonStr) { 28 | super(jsonStr); 29 | } 30 | 31 | public ResourceMigration(JSONObject jsonObj) { 32 | super(jsonObj); 33 | } 34 | 35 | // Fields 36 | //======= 37 | 38 | public String fromSite() { 39 | return reqString("from_site"); 40 | } 41 | 42 | public EntityType entityType() { 43 | return reqEnum("entity_type", EntityType.class); 44 | } 45 | 46 | public String entityId() { 47 | return reqString("entity_id"); 48 | } 49 | 50 | public Status status() { 51 | return reqEnum("status", Status.class); 52 | } 53 | 54 | public String errors() { 55 | return optString("errors"); 56 | } 57 | 58 | public Timestamp createdAt() { 59 | return reqTimestamp("created_at"); 60 | } 61 | 62 | public Timestamp updatedAt() { 63 | return reqTimestamp("updated_at"); 64 | } 65 | 66 | // Operations 67 | //=========== 68 | 69 | public static RetrieveLatestRequest retrieveLatest() { 70 | String uri = uri("resource_migrations", "retrieve_latest"); 71 | return new RetrieveLatestRequest(Method.GET, uri); 72 | } 73 | 74 | 75 | // Operation Request Classes 76 | //========================== 77 | 78 | public static class RetrieveLatestRequest extends Request { 79 | 80 | private RetrieveLatestRequest(Method httpMeth, String uri) { 81 | super(httpMeth, uri); 82 | } 83 | 84 | public RetrieveLatestRequest fromSite(String fromSite) { 85 | params.add("from_site", fromSite); 86 | return this; 87 | } 88 | 89 | 90 | public RetrieveLatestRequest entityType(com.chargebee.models.enums.EntityType entityType) { 91 | params.add("entity_type", entityType); 92 | return this; 93 | } 94 | 95 | 96 | public RetrieveLatestRequest entityId(String entityId) { 97 | params.add("entity_id", entityId); 98 | return this; 99 | } 100 | 101 | 102 | @Override 103 | public Params params() { 104 | return params; 105 | } 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Rule.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Rule extends Resource { 15 | 16 | public enum Status { 17 | ACTIVE, 18 | DISABLED, 19 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 20 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 21 | } 22 | 23 | //Constructors 24 | //============ 25 | 26 | public Rule(String jsonStr) { 27 | super(jsonStr); 28 | } 29 | 30 | public Rule(JSONObject jsonObj) { 31 | super(jsonObj); 32 | } 33 | 34 | // Fields 35 | //======= 36 | 37 | public String id() { 38 | return reqString("id"); 39 | } 40 | 41 | public String namespace() { 42 | return reqString("namespace"); 43 | } 44 | 45 | public String ruleName() { 46 | return reqString("rule_name"); 47 | } 48 | 49 | public Integer ruleOrder() { 50 | return optInteger("rule_order"); 51 | } 52 | 53 | public Status status() { 54 | return reqEnum("status", Status.class); 55 | } 56 | 57 | public String conditions() { 58 | return optString("conditions"); 59 | } 60 | 61 | public String outcome() { 62 | return optString("outcome"); 63 | } 64 | 65 | public Boolean deleted() { 66 | return reqBoolean("deleted"); 67 | } 68 | 69 | public Timestamp createdAt() { 70 | return reqTimestamp("created_at"); 71 | } 72 | 73 | public Timestamp modifiedAt() { 74 | return reqTimestamp("modified_at"); 75 | } 76 | 77 | // Operations 78 | //=========== 79 | 80 | public static Request retrieve(String id) { 81 | String uri = uri("rules", nullCheck(id)); 82 | return new Request(Method.GET, uri); 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/SiteMigrationDetail.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class SiteMigrationDetail extends Resource { 15 | 16 | public enum Status { 17 | MOVED_IN, 18 | MOVED_OUT, 19 | MOVING_OUT, 20 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 21 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 22 | } 23 | 24 | //Constructors 25 | //============ 26 | 27 | public SiteMigrationDetail(String jsonStr) { 28 | super(jsonStr); 29 | } 30 | 31 | public SiteMigrationDetail(JSONObject jsonObj) { 32 | super(jsonObj); 33 | } 34 | 35 | // Fields 36 | //======= 37 | 38 | public String entityId() { 39 | return reqString("entity_id"); 40 | } 41 | 42 | public String otherSiteName() { 43 | return reqString("other_site_name"); 44 | } 45 | 46 | public String entityIdAtOtherSite() { 47 | return reqString("entity_id_at_other_site"); 48 | } 49 | 50 | public Timestamp migratedAt() { 51 | return reqTimestamp("migrated_at"); 52 | } 53 | 54 | public EntityType entityType() { 55 | return reqEnum("entity_type", EntityType.class); 56 | } 57 | 58 | public Status status() { 59 | return reqEnum("status", Status.class); 60 | } 61 | 62 | // Operations 63 | //=========== 64 | 65 | public static SiteMigrationDetailListRequest list() { 66 | String uri = uri("site_migration_details"); 67 | return new SiteMigrationDetailListRequest(uri); 68 | } 69 | 70 | 71 | // Operation Request Classes 72 | //========================== 73 | 74 | public static class SiteMigrationDetailListRequest extends ListRequest { 75 | 76 | private SiteMigrationDetailListRequest(String uri) { 77 | super(uri); 78 | } 79 | 80 | public StringFilter entityIdAtOtherSite() { 81 | return new StringFilter("entity_id_at_other_site",this); 82 | } 83 | 84 | 85 | public StringFilter otherSiteName() { 86 | return new StringFilter("other_site_name",this); 87 | } 88 | 89 | 90 | public StringFilter entityId() { 91 | return new StringFilter("entity_id",this); 92 | } 93 | 94 | 95 | public EnumFilter entityType() { 96 | return new EnumFilter("entity_type",this); 97 | } 98 | 99 | 100 | public EnumFilter status() { 101 | return new EnumFilter("status",this); 102 | } 103 | 104 | 105 | @Override 106 | public Params params() { 107 | return params; 108 | } 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/TaxWithheld.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.math.BigDecimal; 12 | import java.sql.Timestamp; 13 | import java.util.*; 14 | 15 | public class TaxWithheld extends Resource { 16 | 17 | @Deprecated 18 | public enum Type { 19 | PAYMENT, 20 | REFUND, 21 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 22 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 23 | } 24 | 25 | @Deprecated 26 | public enum PaymentMethod { 27 | CASH, 28 | CHECK, 29 | CHARGEBACK, 30 | BANK_TRANSFER, 31 | OTHER, 32 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 33 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 34 | } 35 | 36 | //Constructors 37 | //============ 38 | 39 | public TaxWithheld(String jsonStr) { 40 | super(jsonStr); 41 | } 42 | 43 | public TaxWithheld(JSONObject jsonObj) { 44 | super(jsonObj); 45 | } 46 | 47 | // Fields 48 | //======= 49 | 50 | public String id() { 51 | return reqString("id"); 52 | } 53 | 54 | @Deprecated 55 | public String user() { 56 | return optString("user"); 57 | } 58 | 59 | public String referenceNumber() { 60 | return optString("reference_number"); 61 | } 62 | 63 | public String description() { 64 | return optString("description"); 65 | } 66 | 67 | @Deprecated 68 | public Type type() { 69 | return reqEnum("type", Type.class); 70 | } 71 | 72 | @Deprecated 73 | public PaymentMethod paymentMethod() { 74 | return reqEnum("payment_method", PaymentMethod.class); 75 | } 76 | 77 | public Timestamp date() { 78 | return optTimestamp("date"); 79 | } 80 | 81 | @Deprecated 82 | public String currencyCode() { 83 | return reqString("currency_code"); 84 | } 85 | 86 | public Long amount() { 87 | return optLong("amount"); 88 | } 89 | 90 | public Long resourceVersion() { 91 | return optLong("resource_version"); 92 | } 93 | 94 | public Timestamp updatedAt() { 95 | return optTimestamp("updated_at"); 96 | } 97 | 98 | @Deprecated 99 | public BigDecimal exchangeRate() { 100 | return optBigDecimal("exchange_rate"); 101 | } 102 | 103 | // Operations 104 | //=========== 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/ThirdPartyPaymentMethod.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class ThirdPartyPaymentMethod extends Resource { 15 | 16 | //Constructors 17 | //============ 18 | 19 | public ThirdPartyPaymentMethod(String jsonStr) { 20 | super(jsonStr); 21 | } 22 | 23 | public ThirdPartyPaymentMethod(JSONObject jsonObj) { 24 | super(jsonObj); 25 | } 26 | 27 | // Fields 28 | //======= 29 | 30 | public Type type() { 31 | return reqEnum("type", Type.class); 32 | } 33 | 34 | public Gateway gateway() { 35 | return reqEnum("gateway", Gateway.class); 36 | } 37 | 38 | public String gatewayAccountId() { 39 | return optString("gateway_account_id"); 40 | } 41 | 42 | public String referenceId() { 43 | return reqString("reference_id"); 44 | } 45 | 46 | // Operations 47 | //=========== 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/TimeMachine.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class TimeMachine extends Resource { 15 | 16 | public enum TimeTravelStatus { 17 | NOT_ENABLED, 18 | IN_PROGRESS, 19 | SUCCEEDED, 20 | FAILED, 21 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 22 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 23 | } 24 | 25 | //Constructors 26 | //============ 27 | 28 | public TimeMachine(String jsonStr) { 29 | super(jsonStr); 30 | } 31 | 32 | public TimeMachine(JSONObject jsonObj) { 33 | super(jsonObj); 34 | } 35 | 36 | // Fields 37 | //======= 38 | 39 | public String name() { 40 | return reqString("name"); 41 | } 42 | 43 | public TimeTravelStatus timeTravelStatus() { 44 | return reqEnum("time_travel_status", TimeTravelStatus.class); 45 | } 46 | 47 | public Timestamp genesisTime() { 48 | return reqTimestamp("genesis_time"); 49 | } 50 | 51 | public Timestamp destinationTime() { 52 | return reqTimestamp("destination_time"); 53 | } 54 | 55 | public String failureCode() { 56 | return optString("failure_code"); 57 | } 58 | 59 | public String failureReason() { 60 | return optString("failure_reason"); 61 | } 62 | 63 | public String errorJson() { 64 | return optString("error_json"); 65 | } 66 | 67 | // Operations 68 | //=========== 69 | 70 | public static Request retrieve(String id) { 71 | String uri = uri("time_machines", nullCheck(id)); 72 | return new Request(Method.GET, uri); 73 | } 74 | 75 | public static StartAfreshRequest startAfresh(String id) { 76 | String uri = uri("time_machines", nullCheck(id), "start_afresh"); 77 | return new StartAfreshRequest(Method.POST, uri); 78 | } 79 | 80 | public static TravelForwardRequest travelForward(String id) { 81 | String uri = uri("time_machines", nullCheck(id), "travel_forward"); 82 | return new TravelForwardRequest(Method.POST, uri); 83 | } 84 | 85 | public TimeMachine waitForTimeTravelCompletion() 86 | throws Exception{ 87 | return waitForTimeTravelCompletion(null); 88 | } 89 | 90 | public TimeMachine waitForTimeTravelCompletion(Environment env) 91 | throws Exception { 92 | int count = 0; 93 | int sleepTime = Integer.getInteger("cb.java.time_travel.sleep.millis", 3000); 94 | while(timeTravelStatus() == TimeTravelStatus.IN_PROGRESS){ 95 | if(count++ > 30){ 96 | throw new RuntimeException("The time travel is taking too much time"); 97 | } 98 | Thread.sleep(sleepTime); 99 | Request req = retrieve(name()); 100 | jsonObj = ((env == null) ? req.request() : req.request(env)).timeMachine().jsonObj; 101 | } 102 | if(timeTravelStatus() == TimeTravelStatus.FAILED){ 103 | JSONObject errorJson = new JSONObject(errorJson()); 104 | int httpStatusCode = errorJson.getInt("http_code"); 105 | String exceptionMessage = errorJson.getString("message"); 106 | throw new com.chargebee.exceptions.OperationFailedException(httpStatusCode, exceptionMessage, errorJson); 107 | } 108 | if(timeTravelStatus() == TimeTravelStatus.NOT_ENABLED 109 | || timeTravelStatus() == TimeTravelStatus._UNKNOWN){ 110 | throw new RuntimeException("Time travel status is in wrong state" + timeTravelStatus()); 111 | } 112 | return this; 113 | } 114 | 115 | 116 | // Operation Request Classes 117 | //========================== 118 | 119 | public static class StartAfreshRequest extends Request { 120 | 121 | private StartAfreshRequest(Method httpMeth, String uri) { 122 | super(httpMeth, uri); 123 | } 124 | 125 | public StartAfreshRequest genesisTime(Timestamp genesisTime) { 126 | params.addOpt("genesis_time", genesisTime); 127 | return this; 128 | } 129 | 130 | 131 | @Override 132 | public Params params() { 133 | return params; 134 | } 135 | } 136 | 137 | public static class TravelForwardRequest extends Request { 138 | 139 | private TravelForwardRequest(Method httpMeth, String uri) { 140 | super(httpMeth, uri); 141 | } 142 | 143 | public TravelForwardRequest destinationTime(Timestamp destinationTime) { 144 | params.addOpt("destination_time", destinationTime); 145 | return this; 146 | } 147 | 148 | 149 | @Override 150 | public Params params() { 151 | return params; 152 | } 153 | } 154 | 155 | } 156 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/Token.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class Token extends Resource { 15 | 16 | public enum Status { 17 | NEW, 18 | EXPIRED, 19 | CONSUMED, 20 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 21 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 22 | } 23 | 24 | public enum Vault { 25 | SPREEDLY, 26 | GATEWAY, 27 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 28 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 29 | } 30 | 31 | //Constructors 32 | //============ 33 | 34 | public Token(String jsonStr) { 35 | super(jsonStr); 36 | } 37 | 38 | public Token(JSONObject jsonObj) { 39 | super(jsonObj); 40 | } 41 | 42 | // Fields 43 | //======= 44 | 45 | public String id() { 46 | return reqString("id"); 47 | } 48 | 49 | public Gateway gateway() { 50 | return reqEnum("gateway", Gateway.class); 51 | } 52 | 53 | public String gatewayAccountId() { 54 | return reqString("gateway_account_id"); 55 | } 56 | 57 | public PaymentMethodType paymentMethodType() { 58 | return reqEnum("payment_method_type", PaymentMethodType.class); 59 | } 60 | 61 | public Status status() { 62 | return reqEnum("status", Status.class); 63 | } 64 | 65 | public String idAtVault() { 66 | return reqString("id_at_vault"); 67 | } 68 | 69 | public Vault vault() { 70 | return reqEnum("vault", Vault.class); 71 | } 72 | 73 | public String ipAddress() { 74 | return optString("ip_address"); 75 | } 76 | 77 | public Long resourceVersion() { 78 | return optLong("resource_version"); 79 | } 80 | 81 | public Timestamp updatedAt() { 82 | return optTimestamp("updated_at"); 83 | } 84 | 85 | public Timestamp createdAt() { 86 | return reqTimestamp("created_at"); 87 | } 88 | 89 | public Timestamp expiredAt() { 90 | return optTimestamp("expired_at"); 91 | } 92 | 93 | // Operations 94 | //=========== 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/UsageFile.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models; 2 | 3 | import com.chargebee.*; 4 | import com.chargebee.internal.*; 5 | import com.chargebee.filters.*; 6 | import com.chargebee.filters.enums.SortOrder; 7 | import com.chargebee.internal.HttpUtil.Method; 8 | import com.chargebee.models.enums.*; 9 | import org.json.*; 10 | import java.io.*; 11 | import java.sql.Timestamp; 12 | import java.util.*; 13 | 14 | public class UsageFile extends Resource { 15 | 16 | public enum Status { 17 | QUEUED, 18 | IMPORTED, 19 | PROCESSING, 20 | PROCESSED, 21 | FAILED, 22 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 23 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 24 | } 25 | 26 | public static class UploadDetail extends Resource { 27 | public UploadDetail(JSONObject jsonObj) { 28 | super(jsonObj); 29 | } 30 | 31 | public String url() { 32 | return reqString("url"); 33 | } 34 | 35 | public Timestamp expiresAt() { 36 | return reqTimestamp("expires_at"); 37 | } 38 | 39 | } 40 | 41 | //Constructors 42 | //============ 43 | 44 | public UsageFile(String jsonStr) { 45 | super(jsonStr); 46 | } 47 | 48 | public UsageFile(JSONObject jsonObj) { 49 | super(jsonObj); 50 | } 51 | 52 | // Fields 53 | //======= 54 | 55 | public String id() { 56 | return reqString("id"); 57 | } 58 | 59 | public String name() { 60 | return reqString("name"); 61 | } 62 | 63 | public String mimeType() { 64 | return reqString("mime_type"); 65 | } 66 | 67 | public String errorCode() { 68 | return optString("error_code"); 69 | } 70 | 71 | public String errorReason() { 72 | return optString("error_reason"); 73 | } 74 | 75 | public Status status() { 76 | return optEnum("status", Status.class); 77 | } 78 | 79 | public Long totalRecordsCount() { 80 | return optLong("total_records_count"); 81 | } 82 | 83 | public Long processedRecordsCount() { 84 | return optLong("processed_records_count"); 85 | } 86 | 87 | public Long failedRecordsCount() { 88 | return optLong("failed_records_count"); 89 | } 90 | 91 | public Long fileSizeInBytes() { 92 | return optLong("file_size_in_bytes"); 93 | } 94 | 95 | public Timestamp processingStartedAt() { 96 | return optTimestamp("processing_started_at"); 97 | } 98 | 99 | public Timestamp processingCompletedAt() { 100 | return optTimestamp("processing_completed_at"); 101 | } 102 | 103 | public String uploadedBy() { 104 | return optString("uploaded_by"); 105 | } 106 | 107 | public Timestamp uploadedAt() { 108 | return optTimestamp("uploaded_at"); 109 | } 110 | 111 | public UsageFile.UploadDetail uploadDetails() { 112 | return optSubResource("upload_details", UsageFile.UploadDetail.class); 113 | } 114 | 115 | // Operations 116 | //=========== 117 | 118 | public static UploadRequest upload() { 119 | String uri = uri("usage_files", "upload"); 120 | return new UploadRequest(Method.POST, uri); 121 | } 122 | 123 | public static Request status(String id) { 124 | String uri = uri("usage_files", nullCheck(id), "status"); 125 | return new Request(Method.GET, uri); 126 | } 127 | 128 | 129 | // Operation Request Classes 130 | //========================== 131 | 132 | public static class UploadRequest extends Request { 133 | 134 | private UploadRequest(Method httpMeth, String uri) { 135 | super(httpMeth, uri, null, "file-ingest"); 136 | } 137 | 138 | public UploadRequest fileName(String fileName) { 139 | params.add("file_name", fileName); 140 | return this; 141 | } 142 | 143 | 144 | public UploadRequest mimeType(String mimeType) { 145 | params.add("mime_type", mimeType); 146 | return this; 147 | } 148 | 149 | 150 | @Override 151 | public Params params() { 152 | return params; 153 | } 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/AccountHolderType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum AccountHolderType { 4 | INDIVIDUAL, 5 | COMPANY, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/AccountReceivablesHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum AccountReceivablesHandling { 4 | NO_ACTION, 5 | SCHEDULE_PAYMENT_COLLECTION, 6 | WRITE_OFF, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/AccountType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum AccountType { 4 | CHECKING, 5 | SAVINGS, 6 | BUSINESS_CHECKING, 7 | CURRENT, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Action.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Action { 4 | UPSERT, 5 | REMOVE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ApiVersion.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ApiVersion { 4 | V1, 5 | V2, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ApplyOn.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ApplyOn { 4 | INVOICE_AMOUNT, 5 | SPECIFIC_ITEM_PRICE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/AutoCollection.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum AutoCollection { 4 | ON, 5 | OFF, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/AvalaraSaleType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum AvalaraSaleType { 4 | WHOLESALE, 5 | RETAIL, 6 | CONSUMED, 7 | VENDOR_USE, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/BillingAlignmentMode.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum BillingAlignmentMode { 4 | IMMEDIATE, 5 | DELAYED, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/BillingDateMode.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum BillingDateMode { 4 | USING_DEFAULTS, 5 | MANUALLY_SET, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/BillingDayOfWeekMode.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum BillingDayOfWeekMode { 4 | USING_DEFAULTS, 5 | MANUALLY_SET, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/CancelOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum CancelOption { 4 | IMMEDIATELY, 5 | END_OF_TERM, 6 | SPECIFIC_DATE, 7 | END_OF_BILLING_TERM, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChangeOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChangeOption { 4 | IMMEDIATELY, 5 | END_OF_TERM, 6 | SPECIFIC_DATE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Channel.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Channel { 4 | WEB, 5 | APP_STORE, 6 | PLAY_STORE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChargeModel.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChargeModel { 4 | FULL_CHARGE, 5 | PRORATE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChargeOn.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChargeOn { 4 | IMMEDIATELY, 5 | ON_EVENT, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChargeOnEvent.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChargeOnEvent { 4 | SUBSCRIPTION_CREATION, 5 | SUBSCRIPTION_TRIAL_START, 6 | PLAN_ACTIVATION, 7 | SUBSCRIPTION_ACTIVATION, 8 | CONTRACT_TERMINATION, 9 | ON_DEMAND, 10 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 11 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 12 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChargeOnOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChargeOnOption { 4 | IMMEDIATELY, 5 | ON_EVENT, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ChargesHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ChargesHandling { 4 | INVOICE_IMMEDIATELY, 5 | ADD_TO_UNBILLED_CHARGES, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ContractTermCancelOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ContractTermCancelOption { 4 | TERMINATE_IMMEDIATELY, 5 | END_OF_CONTRACT_TERM, 6 | SPECIFIC_DATE, 7 | END_OF_SUBSCRIPTION_BILLING_TERM, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/CreditOptionForCurrentTermCharges.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum CreditOptionForCurrentTermCharges { 4 | NONE, 5 | PRORATE, 6 | FULL, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/CreditType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum CreditType { 4 | LOYALTY_CREDITS, 5 | REFERRAL_REWARDS, 6 | GENERAL, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/CustomerType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum CustomerType { 4 | RESIDENTIAL, 5 | BUSINESS, 6 | SENIOR_CITIZEN, 7 | INDUSTRIAL, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/DedupeOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum DedupeOption { 4 | SKIP, 5 | UPDATE_EXISTING, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/DirectDebitScheme.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum DirectDebitScheme { 4 | ACH, 5 | BACS, 6 | SEPA_CORE, 7 | AUTOGIRO, 8 | BECS, 9 | BECS_NZ, 10 | PAD, 11 | NOT_APPLICABLE, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/DispositionType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum DispositionType { 4 | ATTACHMENT, 5 | INLINE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/DunningType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum DunningType { 4 | AUTO_COLLECT, 5 | OFFLINE, 6 | DIRECT_DEBIT, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/DurationType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum DurationType { 4 | ONE_TIME, 5 | FOREVER, 6 | LIMITED_PERIOD, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EcheckType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EcheckType { 4 | WEB, 5 | PPD, 6 | CCD, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EinvoicingMethod.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EinvoicingMethod { 4 | AUTOMATIC, 5 | MANUAL, 6 | SITE_DEFAULT, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EndScheduleOn.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EndScheduleOn { 4 | AFTER_NUMBER_OF_INTERVALS, 5 | SPECIFIC_DATE, 6 | SUBSCRIPTION_END, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EntityCode.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EntityCode { 4 | A, 5 | B, 6 | C, 7 | D, 8 | E, 9 | F, 10 | G, 11 | H, 12 | I, 13 | J, 14 | K, 15 | L, 16 | M, 17 | N, 18 | P, 19 | Q, 20 | R, 21 | MED1, 22 | MED2, 23 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 24 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 25 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EntityType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EntityType { 4 | CUSTOMER, 5 | SUBSCRIPTION, 6 | COUPON, 7 | PLAN_ITEM_PRICE, 8 | ADDON_ITEM_PRICE, 9 | CHARGE_ITEM_PRICE, 10 | INVOICE, 11 | QUOTE, 12 | CREDIT_NOTE, 13 | TRANSACTION, 14 | PLAN, 15 | ADDON, 16 | ORDER, 17 | ITEM_FAMILY, 18 | ITEM, 19 | ITEM_PRICE, 20 | PLAN_ITEM, 21 | ADDON_ITEM, 22 | CHARGE_ITEM, 23 | PLAN_PRICE, 24 | ADDON_PRICE, 25 | CHARGE_PRICE, 26 | DIFFERENTIAL_PRICE, 27 | ATTACHED_ITEM, 28 | FEATURE, 29 | SUBSCRIPTION_ENTITLEMENT, 30 | ITEM_ENTITLEMENT, 31 | BUSINESS_ENTITY, 32 | PRICE_VARIANT, 33 | OMNICHANNEL_SUBSCRIPTION, 34 | OMNICHANNEL_SUBSCRIPTION_ITEM, 35 | OMNICHANNEL_TRANSACTION, 36 | RECORDED_PURCHASE, 37 | OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CHANGE, 38 | SALES_ORDER, 39 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 40 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 41 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/EventName.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum EventName { 4 | CANCELLATION_PAGE_LOADED, 5 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 6 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 7 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ExportType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ExportType { 4 | DATA, 5 | IMPORT_FRIENDLY_DATA, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/FreePeriodUnit.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum FreePeriodUnit { 4 | DAY, 5 | WEEK, 6 | MONTH, 7 | YEAR, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/FriendOfferType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum FriendOfferType { 4 | NONE, 5 | COUPON, 6 | COUPON_CODE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Gateway.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Gateway { 4 | CHARGEBEE, 5 | CHARGEBEE_PAYMENTS, 6 | ADYEN, 7 | STRIPE, 8 | WEPAY, 9 | BRAINTREE, 10 | AUTHORIZE_NET, 11 | PAYPAL_PRO, 12 | PIN, 13 | EWAY, 14 | EWAY_RAPID, 15 | WORLDPAY, 16 | BALANCED_PAYMENTS, 17 | BEANSTREAM, 18 | BLUEPAY, 19 | ELAVON, 20 | FIRST_DATA_GLOBAL, 21 | HDFC, 22 | MIGS, 23 | NMI, 24 | OGONE, 25 | PAYMILL, 26 | PAYPAL_PAYFLOW_PRO, 27 | SAGE_PAY, 28 | TCO, 29 | WIRECARD, 30 | AMAZON_PAYMENTS, 31 | PAYPAL_EXPRESS_CHECKOUT, 32 | ORBITAL, 33 | MONERIS_US, 34 | MONERIS, 35 | BLUESNAP, 36 | CYBERSOURCE, 37 | VANTIV, 38 | CHECKOUT_COM, 39 | PAYPAL, 40 | INGENICO_DIRECT, 41 | EXACT, 42 | MOLLIE, 43 | QUICKBOOKS, 44 | RAZORPAY, 45 | GLOBAL_PAYMENTS, 46 | BANK_OF_AMERICA, 47 | ECENTRIC, 48 | METRICS_GLOBAL, 49 | WINDCAVE, 50 | PAY_COM, 51 | EBANX, 52 | DLOCAL, 53 | NUVEI, 54 | PAYSTACK, 55 | JP_MORGAN, 56 | GOCARDLESS, 57 | NOT_APPLICABLE, 58 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 59 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 60 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/HierarchyOperationType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum HierarchyOperationType { 4 | COMPLETE_HIERARCHY, 5 | SUBORDINATES, 6 | PATH_TO_ROOT, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/InvoiceDunningHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum InvoiceDunningHandling { 4 | CONTINUE, 5 | STOP, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ItemType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ItemType { 4 | PLAN, 5 | ADDON, 6 | CHARGE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Layout.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Layout { 4 | IN_APP, 5 | FULL_PAGE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/NotifyReferralSystem.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum NotifyReferralSystem { 4 | NONE, 5 | FIRST_PAID_CONVERSION, 6 | ALL_INVOICES, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/OfflinePaymentMethod.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum OfflinePaymentMethod { 4 | NO_PREFERENCE, 5 | CASH, 6 | CHECK, 7 | BANK_TRANSFER, 8 | ACH_CREDIT, 9 | SEPA_CREDIT, 10 | BOLETO, 11 | US_AUTOMATED_BANK_TRANSFER, 12 | EU_AUTOMATED_BANK_TRANSFER, 13 | UK_AUTOMATED_BANK_TRANSFER, 14 | JP_AUTOMATED_BANK_TRANSFER, 15 | MX_AUTOMATED_BANK_TRANSFER, 16 | CUSTOM, 17 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 18 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 19 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/OnEvent.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum OnEvent { 4 | SUBSCRIPTION_CREATION, 5 | SUBSCRIPTION_TRIAL_START, 6 | PLAN_ACTIVATION, 7 | SUBSCRIPTION_ACTIVATION, 8 | CONTRACT_TERMINATION, 9 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 10 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 11 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Operation.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Operation { 4 | CREATE, 5 | UPDATE, 6 | DELETE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/OperationType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum OperationType { 4 | ADD, 5 | REMOVE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PauseOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PauseOption { 4 | IMMEDIATELY, 5 | END_OF_TERM, 6 | SPECIFIC_DATE, 7 | BILLING_CYCLES, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PaymentInitiator.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PaymentInitiator { 4 | CUSTOMER, 5 | MERCHANT, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PaymentMethod.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PaymentMethod { 4 | CASH, 5 | CHECK, 6 | BANK_TRANSFER, 7 | OTHER, 8 | CUSTOM, 9 | CHARGEBACK, 10 | CARD, 11 | AMAZON_PAYMENTS, 12 | PAYPAL_EXPRESS_CHECKOUT, 13 | DIRECT_DEBIT, 14 | ALIPAY, 15 | UNIONPAY, 16 | APPLE_PAY, 17 | WECHAT_PAY, 18 | ACH_CREDIT, 19 | SEPA_CREDIT, 20 | IDEAL, 21 | GOOGLE_PAY, 22 | SOFORT, 23 | BANCONTACT, 24 | GIROPAY, 25 | DOTPAY, 26 | UPI, 27 | NETBANKING_EMANDATES, 28 | BOLETO, 29 | VENMO, 30 | PAY_TO, 31 | FASTER_PAYMENTS, 32 | SEPA_INSTANT_TRANSFER, 33 | AUTOMATED_BANK_TRANSFER, 34 | KLARNA_PAY_NOW, 35 | ONLINE_BANKING_POLAND, 36 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 37 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 38 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PaymentMethodType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PaymentMethodType { 4 | CARD, 5 | PAYPAL_EXPRESS_CHECKOUT, 6 | AMAZON_PAYMENTS, 7 | DIRECT_DEBIT, 8 | GENERIC, 9 | ALIPAY, 10 | UNIONPAY, 11 | APPLE_PAY, 12 | WECHAT_PAY, 13 | IDEAL, 14 | GOOGLE_PAY, 15 | SOFORT, 16 | BANCONTACT, 17 | GIROPAY, 18 | DOTPAY, 19 | UPI, 20 | NETBANKING_EMANDATES, 21 | VENMO, 22 | PAY_TO, 23 | FASTER_PAYMENTS, 24 | SEPA_INSTANT_TRANSFER, 25 | AUTOMATED_BANK_TRANSFER, 26 | KLARNA_PAY_NOW, 27 | ONLINE_BANKING_POLAND, 28 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 29 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 30 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PaymentVoucherType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PaymentVoucherType { 4 | BOLETO, 5 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 6 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 7 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PeriodUnit.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PeriodUnit { 4 | DAY, 5 | WEEK, 6 | MONTH, 7 | YEAR, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PriceType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PriceType { 4 | TAX_EXCLUSIVE, 5 | TAX_INCLUSIVE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PricingModel.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PricingModel { 4 | FLAT_FEE, 5 | PER_UNIT, 6 | TIERED, 7 | VOLUME, 8 | STAIRSTEP, 9 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 10 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 11 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/PricingType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum PricingType { 4 | PER_UNIT, 5 | FLAT_FEE, 6 | PACKAGE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ProductCatalogVersion.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ProductCatalogVersion { 4 | V1, 5 | V2, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ProrationType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ProrationType { 4 | FULL_TERM, 5 | PARTIAL_TERM, 6 | NONE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ReferralSystem.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ReferralSystem { 4 | REFERRAL_CANDY, 5 | REFERRAL_SAASQUATCH, 6 | FRIENDBUY, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ReferrerRewardType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ReferrerRewardType { 4 | NONE, 5 | REFERRAL_DIRECT_REWARD, 6 | CUSTOM_PROMOTIONAL_CREDIT, 7 | CUSTOM_REVENUE_PERCENT_BASED, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/RefundableCreditsHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum RefundableCreditsHandling { 4 | NO_ACTION, 5 | SCHEDULE_REFUND, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ReportBy.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ReportBy { 4 | CUSTOMER, 5 | INVOICE, 6 | PRODUCT, 7 | SUBSCRIPTION, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ResumeOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ResumeOption { 4 | IMMEDIATELY, 5 | SPECIFIC_DATE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Role.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Role { 4 | PRIMARY, 5 | BACKUP, 6 | NONE, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ScheduleType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ScheduleType { 4 | IMMEDIATE, 5 | SPECIFIC_DATES, 6 | FIXED_INTERVALS, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Source.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Source { 4 | ADMIN_CONSOLE, 5 | API, 6 | BULK_OPERATION, 7 | SCHEDULED_JOB, 8 | HOSTED_PAGE, 9 | PORTAL, 10 | SYSTEM, 11 | NONE, 12 | JS_API, 13 | MIGRATION, 14 | EXTERNAL_SERVICE, 15 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 16 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 17 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Status.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Status { 4 | FUTURE, 5 | IN_TRIAL, 6 | ACTIVE, 7 | NON_RENEWING, 8 | PAUSED, 9 | CANCELLED, 10 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 11 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 12 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Tax1JurisType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Tax1JurisType { 4 | COUNTRY, 5 | FEDERAL, 6 | STATE, 7 | COUNTY, 8 | CITY, 9 | SPECIAL, 10 | UNINCORPORATED, 11 | OTHER, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Tax2JurisType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Tax2JurisType { 4 | COUNTRY, 5 | FEDERAL, 6 | STATE, 7 | COUNTY, 8 | CITY, 9 | SPECIAL, 10 | UNINCORPORATED, 11 | OTHER, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Tax3JurisType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Tax3JurisType { 4 | COUNTRY, 5 | FEDERAL, 6 | STATE, 7 | COUNTY, 8 | CITY, 9 | SPECIAL, 10 | UNINCORPORATED, 11 | OTHER, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Tax4JurisType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Tax4JurisType { 4 | COUNTRY, 5 | FEDERAL, 6 | STATE, 7 | COUNTY, 8 | CITY, 9 | SPECIAL, 10 | UNINCORPORATED, 11 | OTHER, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/TaxExemptReason.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum TaxExemptReason { 4 | TAX_NOT_CONFIGURED, 5 | REGION_NON_TAXABLE, 6 | EXPORT, 7 | CUSTOMER_EXEMPT, 8 | PRODUCT_EXEMPT, 9 | ZERO_RATED, 10 | REVERSE_CHARGE, 11 | HIGH_VALUE_PHYSICAL_GOODS, 12 | ZERO_VALUE_ITEM, 13 | TAX_NOT_CONFIGURED_EXTERNAL_PROVIDER, 14 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 15 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 16 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/TaxJurisType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum TaxJurisType { 4 | COUNTRY, 5 | FEDERAL, 6 | STATE, 7 | COUNTY, 8 | CITY, 9 | SPECIAL, 10 | UNINCORPORATED, 11 | OTHER, 12 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 13 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 14 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/TaxOverrideReason.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum TaxOverrideReason { 4 | ID_EXEMPT, 5 | CUSTOMER_EXEMPT, 6 | EXPORT, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Taxability.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Taxability { 4 | TAXABLE, 5 | EXEMPT, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/TaxjarExemptionCategory.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum TaxjarExemptionCategory { 4 | WHOLESALE, 5 | GOVERNMENT, 6 | OTHER, 7 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 8 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 9 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/TrialEndAction.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum TrialEndAction { 4 | SITE_DEFAULT, 5 | PLAN_DEFAULT, 6 | ACTIVATE_SUBSCRIPTION, 7 | CANCEL_SUBSCRIPTION, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/Type.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum Type { 4 | CARD, 5 | PAYPAL_EXPRESS_CHECKOUT, 6 | AMAZON_PAYMENTS, 7 | DIRECT_DEBIT, 8 | GENERIC, 9 | ALIPAY, 10 | UNIONPAY, 11 | APPLE_PAY, 12 | WECHAT_PAY, 13 | IDEAL, 14 | GOOGLE_PAY, 15 | SOFORT, 16 | BANCONTACT, 17 | GIROPAY, 18 | DOTPAY, 19 | UPI, 20 | NETBANKING_EMANDATES, 21 | VENMO, 22 | PAY_TO, 23 | FASTER_PAYMENTS, 24 | SEPA_INSTANT_TRANSFER, 25 | AUTOMATED_BANK_TRANSFER, 26 | KLARNA_PAY_NOW, 27 | ONLINE_BANKING_POLAND, 28 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 29 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 30 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/UnbilledChargesHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum UnbilledChargesHandling { 4 | NO_ACTION, 5 | INVOICE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/UnbilledChargesOption.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum UnbilledChargesOption { 4 | INVOICE, 5 | DELETE, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/UnpaidInvoicesHandling.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum UnpaidInvoicesHandling { 4 | NO_ACTION, 5 | SCHEDULE_PAYMENT_COLLECTION, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/UsageAccumulationResetFrequency.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum UsageAccumulationResetFrequency { 4 | NEVER, 5 | SUBSCRIPTION_BILLING_FREQUENCY, 6 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 7 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 8 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/ValidationStatus.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum ValidationStatus { 4 | NOT_VALIDATED, 5 | VALID, 6 | PARTIALLY_VALID, 7 | INVALID, 8 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 9 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 10 | } -------------------------------------------------------------------------------- /src/main/java/com/chargebee/models/enums/VoucherType.java: -------------------------------------------------------------------------------- 1 | package com.chargebee.models.enums; 2 | 3 | public enum VoucherType { 4 | BOLETO, 5 | _UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a 6 | java-client version incompatibility. We suggest you to upgrade to the latest version */ 7 | } --------------------------------------------------------------------------------