C# Class Confer.CheddarGetter.CheddarGetter

Mostra file Open project: nofxsnap/CheddarGetter

Public Methods

Method Description
AddCustomCharge ( CustomChargePost customCharge ) : Customer

Add a customer charge for a customer

AddItem ( string customerCode, string itemCode, int quantityToAdd ) : Customer

Add an item and set the quantity for a customer Note: if no quantity is specified then it will increment by 1 by default

CancelSubscription ( string customerCode ) : bool

Cancel a customer's subscription

CreateCustomer ( CustomerPost customer ) : Customer

Create a new customer based on the passed in CustomerPost object

GetCustomer ( string customerCode ) : Customer

Get a particular customer based on a passed in customer code and your product code

GetCustomers ( ) : List

Get a list of all customers for your product code

GetSubscriptionPlans ( ) : List

Get all of the subscription plans for your product code

RemoveItem ( string customerCode, string itemCode, int quantityToRemove ) : Customer

Remove an item and set the quantity for a customer Note: if no quantity is specified then it will decrement by 1 by default

SetItem ( string customerCode, ProductItemCode itemCode, int quantityToSet ) : Customer

Set an item count to a specific quantity

UpdateCustomer ( CustomerPost customer ) : Customer

Update a customer

UpdateCustomerAndSubscription ( CustomerPost customer ) : Customer

Update a customer and their subscription

UpdateSubscription ( CustomerPost customer ) : Customer

Update a customer's subscription

UpdateSubscriptionPartial ( CustomerPost customer ) : Customer

Update a customer's subscription with only partial subscription information

UpdateSubscriptionPlanOnly ( string customerCode, PlanCodeEnum newPlan ) : Customer

Update a customer's subscription plan

Private Methods

Method Description
CheddarGetter ( ) : System

The constructor will set the username and password for the CheddarGetter account

formatMonth ( string ccMonth ) : string

Will format the string into a acceptable month date format for CG

getCharges ( System.Xml.Linq.XElement charges ) : List

Get a list of charges based on a charge XML node in a XElement object

getCustomerList ( System.Xml.Linq.XDocument customersXML ) : Customers

Get the customer list and any associated CG errors from a XDocument (customer XML)

getInvoiceList ( System.Xml.Linq.XElement invoices ) : List

Get a list of invoices based on an invoice XML node in a XElement object

getPlanItemsList ( System.Xml.Linq.XElement items ) : List

Get a list of plan items based on an items XML node in a XElement object

getRequest ( string urlBase, string urlPath ) : string

Handles the GET requests

getSubscriptionItems ( System.Xml.Linq.XElement item ) : List

Get a list of SubscriptionItem objects based on an item XML node in a XElement object

getSubscriptionList ( System.Xml.Linq.XElement subscriptions ) : List

Get a list of subscriptions based on a subscriptions XML node in a XElement object

getSubscriptionPlanList ( System.Xml.Linq.XElement plans ) : List

Get a list of subscription plans based on a plan XML node in a XElement object

postRequest ( string urlBase, string urlPath, string postParams ) : string

Handles the POST request

Method Details

AddCustomCharge() public static method

Add a customer charge for a customer
public static AddCustomCharge ( CustomChargePost customCharge ) : Customer
customCharge CustomChargePost A CustomerChargePost object with the customer charge and customer code
return Customer

AddItem() public static method

Add an item and set the quantity for a customer Note: if no quantity is specified then it will increment by 1 by default
public static AddItem ( string customerCode, string itemCode, int quantityToAdd ) : Customer
customerCode string The customer's code to associate the item with
itemCode string The item code of the item which we are adding
quantityToAdd int The number of units to add of this item
return Customer

CancelSubscription() public static method

Cancel a customer's subscription
public static CancelSubscription ( string customerCode ) : bool
customerCode string The customer code of the customer to cancel
return bool

CreateCustomer() public static method

Create a new customer based on the passed in CustomerPost object
public static CreateCustomer ( CustomerPost customer ) : Customer
customer CustomerPost A CustomerPost object that represents a customer to be created
return Customer

GetCustomer() public static method

Get a particular customer based on a passed in customer code and your product code
public static GetCustomer ( string customerCode ) : Customer
customerCode string A string representing a customer's code in CG
return Customer

GetCustomers() public static method

Get a list of all customers for your product code
public static GetCustomers ( ) : List
return List

GetSubscriptionPlans() public static method

Get all of the subscription plans for your product code
public static GetSubscriptionPlans ( ) : List
return List

RemoveItem() public static method

Remove an item and set the quantity for a customer Note: if no quantity is specified then it will decrement by 1 by default
public static RemoveItem ( string customerCode, string itemCode, int quantityToRemove ) : Customer
customerCode string The customer's code to associate the item with
itemCode string The item code of the item which we are removing
quantityToRemove int The number of units to remove of this item
return Customer

SetItem() public static method

Set an item count to a specific quantity
public static SetItem ( string customerCode, ProductItemCode itemCode, int quantityToSet ) : Customer
customerCode string The customer's code of the customer that will be updated
itemCode ProductItemCode The code of the item that will be updated
quantityToSet int The quantity to set for the item
return Customer

UpdateCustomer() public static method

Update a customer
public static UpdateCustomer ( CustomerPost customer ) : Customer
customer CustomerPost A CustomerPost object that represents the changes to be updated
return Customer

UpdateCustomerAndSubscription() public static method

Update a customer and their subscription
public static UpdateCustomerAndSubscription ( CustomerPost customer ) : Customer
customer CustomerPost A CustomerPost object that represents the changes to be updated
return Customer

UpdateSubscription() public static method

Update a customer's subscription
public static UpdateSubscription ( CustomerPost customer ) : Customer
customer CustomerPost A CustomerPost object with the subscription details to update
return Customer

UpdateSubscriptionPartial() public static method

Update a customer's subscription with only partial subscription information
public static UpdateSubscriptionPartial ( CustomerPost customer ) : Customer
customer CustomerPost A CustomerPost object with the changes that are to be updated
return Customer

UpdateSubscriptionPlanOnly() public static method

Update a customer's subscription plan
public static UpdateSubscriptionPlanOnly ( string customerCode, PlanCodeEnum newPlan ) : Customer
customerCode string The customer's code of the customer to be updated
newPlan PlanCodeEnum The plan to set the customer to
return Customer