/* Options: Date: 2024-11-24 14:45:52 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://clubready.com/api/current //GlobalNamespace: //MakePartial: True //MakeVirtual: True //MakeInternal: False //MakeDataContractsExtensible: False //AddNullableAnnotations: False //AddReturnMarker: True //AddDescriptionAsComments: True //AddDataContractAttributes: False //AddIndexesToDataMembers: False //AddGeneratedCodeAttributes: False //AddResponseStatus: False //AddImplicitVersion: //InitializeCollections: True //ExportValueTypes: False IncludeTypes: SellContractRequest.* //ExcludeTypes: //AddNamespaces: //AddDefaultXmlNamespace: http://schemas.servicestack.net/types */ using System; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; using ServiceStack; using ServiceStack.DataAnnotations; using ClubReady.Web.Api; using ClubReady.Core.Api.Models; using ClubReady.Payments; using ClubReady.Core.Sales.Enums; using ClubReadyGateway.Gateway; using ClubReady.Web.Api.Sales.Model; namespace ClubReady.Core.Api.Models { public partial class ApiDtoBase { public virtual string ApiKey { get; set; } public virtual int? StoreId { get; set; } public virtual int? ChainId { get; set; } } [DataContract] public partial class PaymentMethodDto { [DataMember] public virtual string AcctToken { get; set; } [DataMember] public virtual string ProfileToken { get; set; } [DataMember] public virtual string PaymentProfileId { get; set; } [DataMember] public virtual decimal? PaymentAmount { get; set; } [DataMember] public virtual PaymentMethodType? PaymentMethodType { get; set; } [DataMember] public virtual bool? DoNotUpdatePaymentTypePreference { get; set; } } public partial class SellContractRequestDto : ApiDtoBase { public SellContractRequestDto() { PaymentMethods = new List{}; } public virtual int MemberId { get; set; } public virtual int PackageId { get; set; } public virtual int? InstallmentId { get; set; } public virtual DateTime? StartDate { get; set; } public virtual decimal? PaymentAmount { get; set; } public virtual string PromoCode { get; set; } public virtual List PaymentMethods { get; set; } public virtual int? StaffId { get; set; } } public partial class SellContractResultDto { public virtual string ContractSaleID { get; set; } public virtual string description { get; set; } public virtual bool Success { get; set; } public virtual IReadOnlyList PaymentResponses { get; set; } } } namespace ClubReady.Core.Sales.Enums { public enum PaymentMethodType { Uninitialized = 0, PaymentProfileId = 1, PreferredOnFile = 2, AcctToken = 3, Error = -1, } } namespace ClubReady.Payments { public partial class PendingPaymentResponse { public virtual string ResponseTransactionId { get; set; } public virtual string ResponseTxnId { get; set; } public virtual ResponseStatus ResponseStatus { get; set; } public virtual decimal ResponseAmount { get; set; } public virtual string ResponseText { get; set; } public virtual string Last4 { get; set; } public virtual string AcctClass { get; set; } public virtual string AcctType { get; set; } public virtual string AcctToken { get; set; } } } namespace ClubReady.Web.Api { public partial interface IApiKeyEndpoint { string ApiKey { get; set; } } public partial interface IRestrictedApiRequest : IApiKeyEndpoint { int? RestrictedId { get; set; } RestrictedResourceType RestrictedResourceType { get; set; } } public enum RestrictedResourceType { Store, Chain, User, Undefined, } } namespace ClubReady.Web.Api.Sales.Model { [Route("/sales/contract/sold", "POST")] [ApiResponse(Description="", ResponseType=typeof(ClubReady.Core.Api.Models.SellContractResultDto), StatusCode=200)] public partial class SellContractRequest : SellContractRequestDto, IReturn, IRestrictedApiRequest { public SellContractRequest() { PaymentMethods = new List{}; } /// ///Api Authentication Key /// [ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")] public virtual string ApiKey { get; set; } /// ///Member Id of the user buying the Package /// [ApiMember(Description="Member Id of the user buying the Package", IsRequired=true, ParameterType="query")] public virtual int MemberId { get; set; } /// ///Id for the chain of the Api Key /// [ApiMember(Description="Id for the chain of the Api Key")] public virtual int? ChainId { get; set; } /// ///Id of the store for the user /// [ApiMember(Description="Id of the store for the user", IsRequired=true)] public virtual int? StoreId { get; set; } /// ///Package Id number of the package being purchased /// [ApiMember(Description="Package Id number of the package being purchased", IsRequired=true)] public virtual int PackageId { get; set; } /// ///Installment Plan Id being purchased. If empty, the default package will be selected. /// [ApiMember(Description="Installment Plan Id being purchased. If empty, the default package will be selected.")] public virtual int? InstallmentId { get; set; } /// ///Amount being paid down, including tax /// [ApiMember(Description="Amount being paid down, including tax", IsRequired=true)] public virtual decimal? PaymentAmount { get; set; } /// ///Promo code to apply a discount. /// [ApiMember(Description="Promo code to apply a discount.")] public virtual string PromoCode { get; set; } /// ///Staff Id of salesperson who sold the agreement. /// [ApiMember(Description="Staff Id of salesperson who sold the agreement.")] public virtual int? StaffId { get; set; } /// ///An array of Payment Methods to be used for this purchase. Any entry with PreferredOnFile is assumed if omitted or null. Each object of the array may contain properties:| Property | Description || --- | --- || PaymentMethodType | Usually "AcctToken" (Default or omitted/null) or "PreferredOnFile" || PaymentAmount | The amount to be attempted for this Payment Method. When omitted (or null), the Request's PaymentAmount will be attempted || AcctToken | The AcctToken to attempt payment (when using PaymentMethodType:AcctToken) || ProfileToken | When provided (with AcctToken), a Payment Profile will be created (this will prevent the requirement to call `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) || DoNotUpdatePaymentTypePreference | When using ProfileToken, do not set the PaymentTypePreference (for more information, see `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) || | |* Scenario #1: Use the on file profile only. PaymentMethods can be omitted/null, or : JSON:```json{ PaymentMethods: [ { "PaymentMethodType":"PreferredOnFile", "PaymentAmount":"1.00" } ]}```JSV:```jsv[{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]```* Scenario #2: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. JSON:```json{ PaymentMethods: [ { "PaymentMethodType":"AcctToken", "PaymentAmount":"1.00", "AcctToken":"eyJ...GiftCard AcctToken...", "ProfileToken":"eyJ...Gift Card ProfileToken..." }, { "PaymentMethodType":"PreferredOnFile", "PaymentAmount":"1.00" } ]}```JSV:```jsv[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]``` Notes: * The example shows PaymentAmount of 1.00 for both "AcctToken" and "PreferredOnFile". This is for the examplewith a total of $1.00. The firstPaymentMethod (the Gift Card) will be attempted for $1.00. If it partially approvesfor less than 1.00 (example: $0.80), the second payment method (PreferredOnFile) will be attempted for the lesser ofit's PaymentAmount and the remaining amount (example: $0.20).* If ProfileToken has already been used (e.g. used with `/sales/paymentprofile/import`), it does not need to be included,but AcctToken is required. ProfileToken is only needed once to 'activate' the AcctToken.* When using Query String (or this web site), this value must be encoded with JSV [(JSON-like Separated Values)](https://docs.servicestack.net/jsv-format).Basic steps to convert JSON to JSV: 1) Remove properties that are null, 2) Remove white space including line feeds, 3) Remove quotes. /// [ApiMember(Description="\r\nAn array of Payment Methods to be used for this purchase. Any entry with PreferredOnFile is assumed if omitted or null. \r\n\r\nEach object of the array may contain properties:\r\n\r\n| Property | Description |\r\n| --- | --- |\r\n| PaymentMethodType | Usually \"AcctToken\" (Default or omitted/null) or \"PreferredOnFile\" |\r\n| PaymentAmount | The amount to be attempted for this Payment Method. When omitted (or null), the Request's PaymentAmount will be attempted |\r\n| AcctToken | The AcctToken to attempt payment (when using PaymentMethodType:AcctToken) |\r\n| ProfileToken | When provided (with AcctToken), a Payment Profile will be created (this will prevent the requirement to call `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) |\r\n| DoNotUpdatePaymentTypePreference | When using ProfileToken, do not set the PaymentTypePreference (for more information, see `/sales/paymentprofile/import` (when using PaymentMethodType:AcctToken) |\r\n| | |\r\n\r\n* Scenario #1: Use the on file profile only. PaymentMethods can be omitted/null, or : \r\n\r\nJSON:\r\n```json\r\n{\r\n PaymentMethods: [\r\n {\r\n \"PaymentMethodType\":\"PreferredOnFile\",\r\n \"PaymentAmount\":\"1.00\"\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```jsv\r\n[{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]\r\n```\r\n\r\n\r\n* Scenario #2: Use a Gift Card with PreferredOnFile to cover the amount not approved by the Gift Card. \r\n\r\nJSON:\r\n```json\r\n{\r\n PaymentMethods: [\r\n {\r\n \"PaymentMethodType\":\"AcctToken\",\r\n \"PaymentAmount\":\"1.00\",\r\n \"AcctToken\":\"eyJ...GiftCard AcctToken...\",\r\n \"ProfileToken\":\"eyJ...Gift Card ProfileToken...\"\r\n },\r\n {\r\n \"PaymentMethodType\":\"PreferredOnFile\",\r\n \"PaymentAmount\":\"1.00\"\r\n }\r\n ]\r\n}\r\n```\r\nJSV:\r\n```jsv\r\n[{PaymentMethodType:AcctToken,PaymentAmount:1.00,AcctToken:eyj...,ProfileToken:eyJ...},{PaymentMethodType:PreferredOnFile,PaymentAmount:1.00}]\r\n``` \r\n\r\nNotes: \r\n\r\n* The example shows PaymentAmount of 1.00 for both \"AcctToken\" and \"PreferredOnFile\". This is for the example\r\nwith a total of $1.00. The firstPaymentMethod (the Gift Card) will be attempted for $1.00. If it partially approves\r\nfor less than 1.00 (example: $0.80), the second payment method (PreferredOnFile) will be attempted for the lesser of\r\nit's PaymentAmount and the remaining amount (example: $0.20).\r\n\r\n* If ProfileToken has already been used (e.g. used with `/sales/paymentprofile/import`), it does not need to be included,\r\nbut AcctToken is required. ProfileToken is only needed once to 'activate' the AcctToken.\r\n\r\n* When using Query String (or this web site), this value must be encoded with JSV [(JSON-like Separated Values)](https://docs.servicestack.net/jsv-format).\r\nBasic steps to convert JSON to JSV: 1) Remove properties that are null, 2) Remove white space including line feeds, 3) Remove quotes.\r\n")] public virtual List PaymentMethods { get; set; } public virtual int? RestrictedId { get; set; } public virtual RestrictedResourceType RestrictedResourceType { get; set; } } } namespace ClubReadyGateway.Gateway { public enum ResponseStatus { stsUnknown = 0, stsSuccess = 1, stsDecline = 2, stsError = 3, HardDeclineAccount = 4, HardDeclineExpiry = 5, PartialApproval = 11, PendingSuccess = 12, } }