GET | /sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId} | Get customer's billing status |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubReady.Web.Api.Sales.Model;
using ClubReady.Core.Api.Models;
using ClubReady.Web.Api;
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; }
}
public partial class CalculatePaymentPlanRequestDto
: ApiDtoBase
{
public virtual int InstallmentPlanId { get; set; }
public virtual int PackageId { get; set; }
public virtual DateTime? StartDate { get; set; }
public virtual string PromoCode { get; set; }
}
public partial class CalculatePaymentPlanResultDto
{
public CalculatePaymentPlanResultDto()
{
Payments = new List<PaymentPlanInstallment>{};
Fees = new List<PaymentPlanInstallment>{};
}
public virtual string PlanTotal { get; set; }
public virtual string SubTotal { get; set; }
public virtual float? TaxRate { get; set; }
public virtual string EnhancementFee { get; set; }
public virtual string EnhancementFeeTaxAmount { get; set; }
public virtual bool TaxEnhFee { get; set; }
public virtual string Tax { get; set; }
public virtual string TotalDueToday { get; set; }
public virtual List<PaymentPlanInstallment> Payments { get; set; }
public virtual List<PaymentPlanInstallment> Fees { get; set; }
public virtual bool IsEvergreen { get; set; }
public virtual bool RequirePaymentProfile { get; set; }
}
public partial class PaymentPlanInstallment
{
public virtual bool PayToday { get; set; }
public virtual decimal Amount { get; set; }
public virtual bool Taxed { get; set; }
public virtual float? TaxRate { get; set; }
public virtual decimal? TaxAmount { get; set; }
public virtual string FeeName { get; set; }
public virtual DateTime DueDate { get; set; }
public virtual string Total { get; set; }
public virtual int? SetupFeeId { get; set; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Sales.Model
{
public partial class CalculatePaymentPlanRequest
: CalculatePaymentPlanRequestDto, IRestrictedApiRequest
{
///<summary>
///Api Key - grants access to resources
///</summary>
[ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")]
public virtual string ApiKey { get; set; }
///<summary>
///ID # of store to calculate plan for
///</summary>
[ApiMember(DataType="integer", Description="ID # of store to calculate plan for", IsRequired=true, Name="StoreId", ParameterType="query")]
public virtual int? StoreId { get; set; }
///<summary>
///Installment Plan to calculate a scheduel for
///</summary>
[ApiMember(DataType="integer", Description="Installment Plan to calculate a scheduel for", IsRequired=true, Name="InstallmentPlanId", ParameterType="path")]
public virtual int InstallmentPlanId { get; set; }
///<summary>
///The package to calculate for
///</summary>
[ApiMember(DataType="integer", Description="The package to calculate for", IsRequired=true, Name="PackageId", ParameterType="path")]
public virtual int PackageId { get; set; }
///<summary>
///Date to calculate schedule from. If not provided, will use today.
///</summary>
[ApiMember(DataType="datetime", Description="Date to calculate schedule from. If not provided, will use today.", Name="StartDate", ParameterType="query")]
public virtual DateTime? StartDate { get; set; }
///<summary>
///Promo code to apply a discount.
///</summary>
[ApiMember(DataType="string", Description="Promo code to apply a discount.", Name="PromoCode", ParameterType="query")]
public virtual string PromoCode { get; set; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { get; set; }
}
}
C# CalculatePaymentPlanRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId} HTTP/1.1 Host: clubready.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CalculatePaymentPlanResultDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models"> <EnhancementFee>String</EnhancementFee> <Fees> <PaymentPlanInstallment> <Amount>0</Amount> <DueDate>0001-01-01T00:00:00</DueDate> <FeeName>String</FeeName> <PayToday>false</PayToday> <SetupFeeId>0</SetupFeeId> <TaxRate>0</TaxRate> <Taxed>false</Taxed> </PaymentPlanInstallment> </Fees> <IsEvergreen>false</IsEvergreen> <Payments> <PaymentPlanInstallment> <Amount>0</Amount> <DueDate>0001-01-01T00:00:00</DueDate> <FeeName>String</FeeName> <PayToday>false</PayToday> <SetupFeeId>0</SetupFeeId> <TaxRate>0</TaxRate> <Taxed>false</Taxed> </PaymentPlanInstallment> </Payments> <TaxEnhFee>false</TaxEnhFee> <TaxRate>0</TaxRate> </CalculatePaymentPlanResultDto>