/* Options: Date: 2025-07-19 19:01:23 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://www.clubready.com/api/current //Package: //GlobalNamespace: dtos //AddPropertyAccessors: True //SettersReturnThis: True //AddServiceStackTypes: True //AddResponseStatus: False //AddDescriptionAsComments: True //AddImplicitVersion: IncludeTypes: SaleEndpoint.* //ExcludeTypes: //TreatTypesAsStrings: //DefaultImports: java.math.*,java.util.*,net.servicestack.client.* */ import java.math.*; import java.util.*; import net.servicestack.client.*; public class dtos { @Route(Path="/sales/agreement/sale", Verbs="POST") @ApiResponse(Description="", ResponseType=SaleResponse.class, StatusCode=200) public static class SaleEndpoint implements IReturn, IAgreementSaleEndpoint, IRestrictedApiRequest { /** * IP address of the end user */ @ApiMember(Description="IP address of the end user", IsRequired=true, Name="X-Forwarded-For", ParameterType="header") public String XForwardedFor = null; /** * Api Authentication Key */ @ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query") public String ApiKey = null; /** * Member Id of the user buying the Package */ @ApiMember(Description="Member Id of the user buying the Package", IsRequired=true, ParameterType="query") public Integer MemberId = null; public Integer ChainId = null; /** * Id of the store for the user */ @ApiMember(Description="Id of the store for the user", IsRequired=true) public Integer StoreId = null; /** * IncompleteAgreementToken from Agreement/ContractText endpoint. */ @ApiMember(Description="IncompleteAgreementToken from Agreement/ContractText endpoint.", IsRequired=true) public String IncompleteAgreementToken = null; /** * Amount being paid down, including tax */ @ApiMember(Description="Amount being paid down, including tax", IsRequired=true) public BigDecimal PaymentAmount = null; /** * Promo code to apply a discount. */ @ApiMember(Description="Promo code to apply a discount.") public String PromoCode = null; /** * Staff Id of salesperson who sold the agreement. */ @ApiMember(Description="Staff Id of salesperson who sold the agreement.") public Integer StaffId = null; /** * An array of PaymentMethod objects to be used for this purchase. A null array (or omitted property) will use thePreferred method for the total amount.Each object of the array may contain properties:| Property | Description || --- | --- || PaymentAmount | The maximum amount to be attempted for this PaymentMethod. When null or omitted, the remaining PaymentAmount will be attempted. || **Use only one of the following three** | **UsePreferred** or **AcctToken** or **ProfileToken [DoNotUpdatePaymentTypePreference]** || UsePreferred | Set to `true` to use the Preferred method, otherwise omit the value or set to `null` or `false` || AcctToken | The AcctToken to attempt payment || ProfileToken | When provided, a PaymentMethod will be created (this will prevent the requirement to call `/sales/paymentprofile/import`) || DoNotUpdatePaymentTypePreference | [Optional] When creating a PaymentMethod (ProfileToken), it is set as the preferred method. To not create as preferred, set `DoNotUpdatePaymentTypePreference` to `true`. (for more information, see `/sales/paymentprofile/import`) || | |Only one of `UsePreferred`, `AcctToken`, `ProfileToken` or is needed. `DoNotUpdatePaymentTypePreference` is optionaland only valid with `ProfileToken`.* Scenario #1: Sell $3 contract using an existing PaymentMethod (i.e. AcctToken) for $1 and the Preferred method for $2.JSON:```json{ ... "PaymentAmount": 3.00, "PaymentMethods": [ { "PaymentAmount": "1.00", "AcctToken": "eyJ..." }, { "PaymentAmount": "2.00", "UsePreferred": true } ]}```JSV:```...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,AcctToken:eyJ...NdQ},{PaymentAmount:2.00,UsePreferred:true}]```* Scenario #2: Sell $3 contract using a new PaymentMethod (i.e. ProfileToken) for $1 and the Preferred method for the remaining.Note, the sum of the PaymentMethod's PaymentAmount ($4) is greater than the agreement amount ($3). PaymentAmount is the maximum amount.This allows the first PaymentMethod to decline or partially approve (common with gift cards). Therefore, if the first PaymentMethod approvesfor $0.75, the second will be attempted for $2.25.JSON:```json{ ... "PaymentAmount": 3.00, "PaymentMethods": [ { "PaymentAmount": "1.00", "ProfileToken": "eyJ..." }, { "PaymentAmount": "3.00", "UsePreferred": true } ]}```JSV:```jsv...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,ProfileToken:eyj...NdQ},{PaymentAmount:3.00,UsePreferred:true}]```Notes: * AcctTokens should not be parsed or persisted in the client application. They are currently jsonbased, but can be updated without notice.* ProfileToken is used to create a PaymentMethod in the ClubReady system. For more information, see `/sales/paymentprofile/import`.* If `PaymentMethods` is missing or `null`, the Preferred method will be used.* If a `PaymentMethods` `PaymentAmount` is not specified, the remaining amount will be attempted.* If a PaymentMethod is partially approved (common for gift cards), the PaymentMethod with anunspecified PaymentAmount will be charged the remaining amount, including the unapproved amount not.* When testing with this website, the PaymentMethods textbox needs JSV and only the square brackets and contents(e.g. `[{PaymentAmount:1.00,UsePreferred:true}]`). */ @ApiMember(Description="An array of PaymentMethod objects to be used for this purchase. A null array (or omitted property) will use the\r\nPreferred method for the total amount.\r\n\r\nEach object of the array may contain properties:\r\n\r\n| Property | Description |\r\n| --- | --- |\r\n| PaymentAmount | The maximum amount to be attempted for this PaymentMethod. When null or omitted, the remaining PaymentAmount will be attempted. |\r\n| **Use only one of the following three** | **UsePreferred** or **AcctToken** or **ProfileToken [DoNotUpdatePaymentTypePreference]** |\r\n| UsePreferred | Set to `true` to use the Preferred method, otherwise omit the value or set to `null` or `false` |\r\n| AcctToken | The AcctToken to attempt payment |\r\n| ProfileToken | When provided, a PaymentMethod will be created (this will prevent the requirement to call `/sales/paymentprofile/import`) |\r\n| DoNotUpdatePaymentTypePreference | [Optional] When creating a PaymentMethod (ProfileToken), it is set as the preferred method. To not create as preferred, set `DoNotUpdatePaymentTypePreference` to `true`. (for more information, see `/sales/paymentprofile/import`) |\r\n| | |\r\n\r\nOnly one of `UsePreferred`, `AcctToken`, `ProfileToken` or is needed. `DoNotUpdatePaymentTypePreference` is optional\r\nand only valid with `ProfileToken`.\r\n\r\n* Scenario #1: Sell $3 contract using an existing PaymentMethod (i.e. AcctToken) for $1 and the Preferred method for $2.\r\n\r\nJSON:\r\n```json\r\n{\r\n ...\r\n \"PaymentAmount\": 3.00,\r\n \"PaymentMethods\": [\r\n {\r\n \"PaymentAmount\": \"1.00\",\r\n \"AcctToken\": \"eyJ...\"\r\n },\r\n {\r\n \"PaymentAmount\": \"2.00\",\r\n \"UsePreferred\": true\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```\r\n...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,AcctToken:eyJ...NdQ},{PaymentAmount:2.00,UsePreferred:true}]\r\n```\r\n\r\n* Scenario #2: Sell $3 contract using a new PaymentMethod (i.e. ProfileToken) for $1 and the Preferred method for the remaining.\r\nNote, the sum of the PaymentMethod's PaymentAmount ($4) is greater than the agreement amount ($3). PaymentAmount is the maximum amount.\r\nThis allows the first PaymentMethod to decline or partially approve (common with gift cards). Therefore, if the first PaymentMethod approves\r\nfor $0.75, the second will be attempted for $2.25.\r\n\r\nJSON:\r\n```json\r\n{ \r\n ...\r\n \"PaymentAmount\": 3.00,\r\n \"PaymentMethods\": [\r\n {\r\n \"PaymentAmount\": \"1.00\",\r\n \"ProfileToken\": \"eyJ...\"\r\n },\r\n {\r\n \"PaymentAmount\": \"3.00\",\r\n \"UsePreferred\": true\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```jsv\r\n...,PaymentAmount:3.00,PaymentMethods:[{PaymentAmount:1.00,ProfileToken:eyj...NdQ},{PaymentAmount:3.00,UsePreferred:true}]\r\n```\r\n\r\nNotes: \r\n\r\n* AcctTokens should not be parsed or persisted in the client application. They are currently json\r\nbased, but can be updated without notice.\r\n\r\n* ProfileToken is used to create a PaymentMethod in the ClubReady system. For more information, \r\nsee `/sales/paymentprofile/import`.\r\n\r\n* If `PaymentMethods` is missing or `null`, the Preferred method will be used.\r\n\r\n* If a `PaymentMethods` `PaymentAmount` is not specified, the remaining amount will be attempted.\r\n\r\n* If a PaymentMethod is partially approved (common for gift cards), the PaymentMethod with an\r\nunspecified PaymentAmount will be charged the remaining amount, including the unapproved amount not.\r\n\r\n* When testing with this website, the PaymentMethods textbox needs JSV and only the square brackets and contents\r\n(e.g. `[{PaymentAmount:1.00,UsePreferred:true}]`).") public ArrayList PaymentMethods = null; public Integer RestrictedId = null; public RestrictedResourceType RestrictedResourceType = null; public String getXForwardedFor() { return XForwardedFor; } public SaleEndpoint setXForwardedFor(String value) { this.XForwardedFor = value; return this; } public String getApiKey() { return ApiKey; } public SaleEndpoint setApiKey(String value) { this.ApiKey = value; return this; } public Integer getMemberId() { return MemberId; } public SaleEndpoint setMemberId(Integer value) { this.MemberId = value; return this; } public Integer getChainId() { return ChainId; } public SaleEndpoint setChainId(Integer value) { this.ChainId = value; return this; } public Integer getStoreId() { return StoreId; } public SaleEndpoint setStoreId(Integer value) { this.StoreId = value; return this; } public String getIncompleteAgreementToken() { return IncompleteAgreementToken; } public SaleEndpoint setIncompleteAgreementToken(String value) { this.IncompleteAgreementToken = value; return this; } public BigDecimal getPaymentAmount() { return PaymentAmount; } public SaleEndpoint setPaymentAmount(BigDecimal value) { this.PaymentAmount = value; return this; } public String getPromoCode() { return PromoCode; } public SaleEndpoint setPromoCode(String value) { this.PromoCode = value; return this; } public Integer getStaffId() { return StaffId; } public SaleEndpoint setStaffId(Integer value) { this.StaffId = value; return this; } public ArrayList getPaymentMethods() { return PaymentMethods; } public SaleEndpoint setPaymentMethods(ArrayList value) { this.PaymentMethods = value; return this; } public Integer getRestrictedId() { return RestrictedId; } public SaleEndpoint setRestrictedId(Integer value) { this.RestrictedId = value; return this; } public RestrictedResourceType getRestrictedResourceType() { return RestrictedResourceType; } public SaleEndpoint setRestrictedResourceType(RestrictedResourceType value) { this.RestrictedResourceType = value; return this; } private static Object responseType = SaleResponse.class; public Object getResponseType() { return responseType; } } public static class SaleResponse extends ApiResponse2Base { } public static enum RestrictedResourceType { Store, Chain, User, Undefined; } public static interface IApiDtoBase { public String ApiKey = null; public Integer StoreId = null; public Integer ChainId = null; } public static interface IRestrictedApiRequest implements IApiKeyEndpoint { public Integer RestrictedId = null; public RestrictedResourceType RestrictedResourceType = null; } public static interface IApiKeyEndpoint { public String ApiKey = null; } @DataContract public static class PaymentMethodDto { @DataMember public String AcctToken = null; @DataMember public String ProfileToken = null; @DataMember public String PaymentProfileId = null; @DataMember public BigDecimal PaymentAmount = null; @DataMember public Boolean UsePreferred = null; @DataMember public Boolean DoNotUpdatePaymentTypePreference = null; public String getAcctToken() { return AcctToken; } public PaymentMethodDto setAcctToken(String value) { this.AcctToken = value; return this; } public String getProfileToken() { return ProfileToken; } public PaymentMethodDto setProfileToken(String value) { this.ProfileToken = value; return this; } public String getPaymentProfileId() { return PaymentProfileId; } public PaymentMethodDto setPaymentProfileId(String value) { this.PaymentProfileId = value; return this; } public BigDecimal getPaymentAmount() { return PaymentAmount; } public PaymentMethodDto setPaymentAmount(BigDecimal value) { this.PaymentAmount = value; return this; } public Boolean isUsePreferred() { return UsePreferred; } public PaymentMethodDto setUsePreferred(Boolean value) { this.UsePreferred = value; return this; } public Boolean isDoNotUpdatePaymentTypePreference() { return DoNotUpdatePaymentTypePreference; } public PaymentMethodDto setDoNotUpdatePaymentTypePreference(Boolean value) { this.DoNotUpdatePaymentTypePreference = value; return this; } } public static interface IAgreementSaleEndpoint implements IApiDtoBase { public Integer MemberId = null; public BigDecimal PaymentAmount = null; public ArrayList PaymentMethods = null; public String IncompleteAgreementToken = null; } public static class ApiResponse2Base { public Boolean success = null; public String message = null; public Boolean isSuccess() { return success; } public ApiResponse2Base setSuccess(Boolean value) { this.success = value; return this; } public String getMessage() { return message; } public ApiResponse2Base setMessage(String value) { this.message = value; return this; } } }