C# Class Connectster.Shopify.ShopifyCommunicator

Inheritance: IShopifyObject
Afficher le fichier Open project: shopster/NconnectSter Class Usage Examples

Méthodes publiques

Méthode Description
CleanupXmlForDeserialization ( XmlDocument inDoc ) : XmlDocument

Remove tags w/ "nil=true" for "type=decimal" or "type=datetime". Do this because XMLSerializer crashes on these cases.

CleanupXmlForShopifySubmission ( XmlDocument inDoc ) : XmlDocument

Add " type="array" " to elements that require it. Remove xsi:nil="true" elements.

CreateCollection ( ShopifyStoreAuth storeAuth, ShopifyCollection collection ) : ShopifyResponse
CreateMetafield ( ShopifyStoreAuth storeAuth, ShopifyMetafield metaField, int productId ) : ShopifyResponse
CreateProduct ( ShopifyStoreAuth storeAuth, IShopifyProduct sP ) : ShopifyResponse
DateTimeToShopifyString ( System.DateTime time ) : string

encode a datetime as a string for filtering products, metafields etc. As per shopify's specification.

DeleteProduct ( ShopifyStoreAuth storeAuth, int productId ) : bool
GetAllMetafields ( ShopifyStoreAuth storeAuth, int limit, System.DateTime createdMin, System.DateTime createdMax, System.DateTime updatedMin, System.DateTime updatedMax, string fieldNamespace, string key, string valueType, int productId ) : List

GetAllProducts ( ShopifyStoreAuth storeAuth ) : List
GetCollection ( ShopifyStoreAuth storeAuth, int collectionId ) : ShopifyResponse
GetCollectionByName ( ShopifyStoreAuth storeAuth, string name ) : ShopifyResponse
GetListAllOrders ( ShopifyStoreAuth storeAuth ) : List
GetOrder ( ShopifyStoreAuth storeAuth, int orderId ) : ShopifyResponse
GetPageOfProducts ( ShopifyStoreAuth storeAuth, int numWanted, int pageNumber ) : List
GetProduct ( ShopifyStoreAuth storeAuth, int productId ) : ShopifyResponse
GetShopInformation ( ShopifyStoreAuth storeAuth ) : ShopifyResponse
Instance ( ) : ShopifyCommunicator
UpdateProduct ( ShopifyStoreAuth storeAuth, ShopifyProduct shopifyProduct ) : ShopifyResponse

Private Methods

Méthode Description
HashString ( string value ) : string

Hashes(MD5) the given value. Typically used as "HashString(shopsterSecret + storeAuthToken)"

IsValidXml ( string input ) : XmlDocument
ShopifyCommunicator ( ) : System
ShopifyDelete ( string path, string storePassword ) : XmlDocument
ShopifyGet ( string path, string storePassword ) : XmlDocument

loads and returns the XML document found at path , using the storePassword.

ShopifyPutPost ( string path, string storePassword, XmlDocument xDocPost, string method ) : XmlDocument

PUT/POSTs the given XMLDocument to the path w/ the storePassword.

Method Details

CleanupXmlForDeserialization() public static méthode

Remove tags w/ "nil=true" for "type=decimal" or "type=datetime". Do this because XMLSerializer crashes on these cases.
public static CleanupXmlForDeserialization ( XmlDocument inDoc ) : XmlDocument
inDoc System.Xml.XmlDocument The XmlDocument you want cleaned up for deserialization.
Résultat System.Xml.XmlDocument

CleanupXmlForShopifySubmission() public static méthode

Add " type="array" " to elements that require it. Remove xsi:nil="true" elements.
public static CleanupXmlForShopifySubmission ( XmlDocument inDoc ) : XmlDocument
inDoc System.Xml.XmlDocument XmlDocument to be cleaned before submission to Shopify.
Résultat System.Xml.XmlDocument

CreateCollection() public méthode

public CreateCollection ( ShopifyStoreAuth storeAuth, ShopifyCollection collection ) : ShopifyResponse
storeAuth ShopifyStoreAuth
collection ShopifyCollection
Résultat ShopifyResponse

CreateMetafield() public méthode

public CreateMetafield ( ShopifyStoreAuth storeAuth, ShopifyMetafield metaField, int productId ) : ShopifyResponse
storeAuth ShopifyStoreAuth
metaField ShopifyMetafield
productId int
Résultat ShopifyResponse

CreateProduct() public méthode

public CreateProduct ( ShopifyStoreAuth storeAuth, IShopifyProduct sP ) : ShopifyResponse
storeAuth ShopifyStoreAuth
sP IShopifyProduct
Résultat ShopifyResponse

DateTimeToShopifyString() public méthode

encode a datetime as a string for filtering products, metafields etc. As per shopify's specification.
public DateTimeToShopifyString ( System.DateTime time ) : string
time System.DateTime
Résultat string

DeleteProduct() public méthode

public DeleteProduct ( ShopifyStoreAuth storeAuth, int productId ) : bool
storeAuth ShopifyStoreAuth
productId int
Résultat bool

GetAllMetafields() public méthode

public GetAllMetafields ( ShopifyStoreAuth storeAuth, int limit, System.DateTime createdMin, System.DateTime createdMax, System.DateTime updatedMin, System.DateTime updatedMax, string fieldNamespace, string key, string valueType, int productId ) : List
storeAuth ShopifyStoreAuth
limit int
createdMin System.DateTime
createdMax System.DateTime
updatedMin System.DateTime
updatedMax System.DateTime
fieldNamespace string
key string
valueType string
productId int If productId is >0 get all metafields for that product, if null get metafields tagged to the shop.
Résultat List

GetAllProducts() public méthode

public GetAllProducts ( ShopifyStoreAuth storeAuth ) : List
storeAuth ShopifyStoreAuth
Résultat List

GetCollection() public méthode

public GetCollection ( ShopifyStoreAuth storeAuth, int collectionId ) : ShopifyResponse
storeAuth ShopifyStoreAuth
collectionId int
Résultat ShopifyResponse

GetCollectionByName() public méthode

public GetCollectionByName ( ShopifyStoreAuth storeAuth, string name ) : ShopifyResponse
storeAuth ShopifyStoreAuth
name string
Résultat ShopifyResponse

GetListAllOrders() public méthode

public GetListAllOrders ( ShopifyStoreAuth storeAuth ) : List
storeAuth ShopifyStoreAuth
Résultat List

GetOrder() public méthode

public GetOrder ( ShopifyStoreAuth storeAuth, int orderId ) : ShopifyResponse
storeAuth ShopifyStoreAuth
orderId int
Résultat ShopifyResponse

GetPageOfProducts() public méthode

public GetPageOfProducts ( ShopifyStoreAuth storeAuth, int numWanted, int pageNumber ) : List
storeAuth ShopifyStoreAuth
numWanted int
pageNumber int
Résultat List

GetProduct() public méthode

public GetProduct ( ShopifyStoreAuth storeAuth, int productId ) : ShopifyResponse
storeAuth ShopifyStoreAuth
productId int
Résultat ShopifyResponse

GetShopInformation() public méthode

public GetShopInformation ( ShopifyStoreAuth storeAuth ) : ShopifyResponse
storeAuth ShopifyStoreAuth
Résultat ShopifyResponse

Instance() public static méthode

public static Instance ( ) : ShopifyCommunicator
Résultat ShopifyCommunicator

UpdateProduct() public méthode

public UpdateProduct ( ShopifyStoreAuth storeAuth, ShopifyProduct shopifyProduct ) : ShopifyResponse
storeAuth ShopifyStoreAuth
shopifyProduct ShopifyProduct
Résultat ShopifyResponse