Difference between revisions of "Order class"

From Catglobe Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=Order
+
|Name=<nowiki>Order</nowiki>
|Description=Order object used while processing orders
+
|Description=<nowiki>Order object used while processing orders</nowiki>
|Constructors=
+
|InheritsFrom=object|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=currency|Description=Currency to use for calculations. Use empty for default currency}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>id</nowiki>|Description=<nowiki>The order's id</nowiki>}}
|Description=Create a new order}}
+
|Description=<nowiki>Fetch exist Order</nowiki>}}
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=currency|Description=Currency to use for calculations. Use empty for default currency|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=deliveryTo|Description=Name of recipient|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=address|Description=First address line of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=address2|Description=Second address line of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=city|Description=City of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=zipcode|Description=Zipcode of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=region|Description=Region of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=postbox|Description=Postbox of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=country|Description=Country of delivery address|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=deliveryTypeId|Description=Which type of delivery to use|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=userComment|Description=Optional comment from the user}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>currency</nowiki>|Description=<nowiki>Currency to use for calculations. Use empty for default currency</nowiki>}}
|Description=Create a new order for physical products}}
+
|Description=<nowiki>Create a new order</nowiki>}}
 +
{{CGscriptConstructors_Template|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>currency</nowiki>|Description=<nowiki>Currency to use for calculations. Use empty for default currency</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>deliveryTo</nowiki>|Description=<nowiki>Name of recipient</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>address</nowiki>|Description=<nowiki>First address line of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>address2</nowiki>|Description=<nowiki>Second address line of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>city</nowiki>|Description=<nowiki>City of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>zipcode</nowiki>|Description=<nowiki>Zipcode of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>region</nowiki>|Description=<nowiki>Region of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>postbox</nowiki>|Description=<nowiki>Postbox of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>country</nowiki>|Description=<nowiki>Country of delivery address</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>deliveryTypeId</nowiki>|Description=<nowiki>Which type of delivery to use</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userComment</nowiki>|Description=<nowiki>Optional comment from the user</nowiki>}}
 +
|Description=<nowiki>Create a new order for physical products</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=AddLog|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddLog</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=msg|Description=Message to add.}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>msg</nowiki>|Description=<nowiki>Message to add.</nowiki>}}
|Description=Add an entry to AdminNote automatically appending a newline.}}
+
|Description=<nowiki>Add an entry to AdminNote automatically appending a newline.</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ExecuteFromOther|Parameters=
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ExecuteFromOther</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=successUrl|Description=Url to send buyer to after successfully paying for the product. If empty then send to webshop receipt page|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=failureUrl|Description=Url to send buyer to after cancelling payment. If empty then send to webshop cancel page. Empty means default|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=merchantName|Description=Merchant name to load the appropriate merchant configuration from the web config|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=payByInvoice|Description=Pay by points/creditcard or if true by invoice|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=callback|Description=Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>successUrl</nowiki>|Description=<nowiki>Url to send buyer to after successfully paying for the product. If empty then send to webshop receipt page</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>failureUrl</nowiki>|Description=<nowiki>Url to send buyer to after cancelling payment. If empty then send to webshop cancel page. Empty means default</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>merchantName</nowiki>|Description=<nowiki>Merchant name to load the appropriate merchant configuration from the web config</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>payByInvoice</nowiki>|Description=<nowiki>Pay by points/creditcard or if true by invoice</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter</nowiki>}}
|Description=Save and initiate the payment process. This will commit current transaction and return the url to show next}}
+
|Description=<nowiki>Save and initiate the payment process. This will commit current transaction and return the url to show next</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=ExecuteFromQuestionnaire|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=merchantName|Description=Merchant name to load the appropriate merchant configuration from the web config|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=payByInvoice|Description=Pay by points/creditcard or if true by invoice|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=callback|Description=Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>merchantName</nowiki>|Description=<nowiki>Merchant name to load the appropriate merchant configuration from the web config</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>payByInvoice</nowiki>|Description=<nowiki>Pay by points/creditcard or if true by invoice</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter</nowiki>}}
|Description=Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order}}
+
|Description=<nowiki>Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=ExecuteFromQuestionnaire|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=string|Name=merchantName|Description=Merchant name to load the appropriate merchant configuration from the web config. Empty means default|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=callback|Description=Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>merchantName</nowiki>|Description=<nowiki>Merchant name to load the appropriate merchant configuration from the web config. Empty means default</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter</nowiki>}}
|Description=Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order}}
+
|Description=<nowiki>Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=ExecuteFromQuestionnaire|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=Function|Name=callback|Description=Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter}}
+
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>callback</nowiki>|Description=<nowiki>Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter</nowiki>}}
|Description=Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order}}
+
|Description=<nowiki>Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=string|Name=AdminNote|HasGetter=1|Description=Get the comments the system or admin has written.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>AdminNote</nowiki>|HasGetter=1|Description=<nowiki>Get the comments the system or admin has written.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=GiftPoints|HasGetter=1|Description=How many points does the buyer get for completing this order.}}
+
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>GiftPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points does the buyer get for completing this order.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=HandlingPoints|HasGetter=1|Description=How many points was used for handling.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>HandlingPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used for handling.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=IsPhysicalOrder|HasGetter=1|Description=Does the order contain physical items or not.}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsPhysicalOrder</nowiki>|HasGetter=1|Description=<nowiki>Does the order contain physical items or not.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=OrderCash|HasGetter=1|Description=How much cash was used in total.}}
+
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>OrderCash</nowiki>|HasGetter=1|Description=<nowiki>How much cash was used in total.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=DateTime|Name=OrderDate|HasGetter=1|Description=Time and date the buyer completed the order.}}
+
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>OrderDate</nowiki>|HasGetter=1|Description=<nowiki>Time and date the buyer completed the order.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=OrderNumber|HasGetter=1|Description=The order number of the order.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>OrderId</nowiki>|HasGetter=1|Description=<nowiki>The order's id</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=OrderPaymentType|HasGetter=1|Description=How was the order paid. Possible values is ByPoint, ByCreditCard, ByInvoice, ByCash, ByGiro, ByDanKort, ByPointAndCreditCard.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>OrderNumber</nowiki>|HasGetter=1|Description=<nowiki>The order number of the order.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=OrderPoints|HasGetter=1|Description=How many points was used in total.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>OrderPaymentType</nowiki>|HasGetter=1|Description=<nowiki>How was the order paid. Possible values is ByPoint, ByCreditCard, ByInvoice, ByCash, ByGiro, ByDanKort, ByPointAndCreditCard.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=PercentageDiscount|HasGetter=1|Description=How much discount does this user get.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>OrderPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used in total.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=PostagePoints|HasGetter=1|Description=How many points was used for postage.}}
+
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>PercentageDiscount</nowiki>|HasGetter=1|Description=<nowiki>How much discount does this user get.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=array|Name=ProductOrders|HasGetter=1|Description=List of actual products bought.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PostagePoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used for postage.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=ProductPoints|HasGetter=1|Description=How many points was used for the actual products.}}
+
{{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>ProductOrders</nowiki>|HasGetter=1|Description=<nowiki>List of actual products bought.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ProductPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used for the actual products.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=UseGiftPoints|HasGetter=1|Description=Does this user get gift points if a bought product gives some.}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=UserComment|HasGetter=1|HasSetter=1|Description=Get the comment the buyer wrote.}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>UseGiftPoints</nowiki>|HasGetter=1|Description=<nowiki>Does this user get gift points if a bought product gives some.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=UserId|HasGetter=1|Description=The id of the user ordering.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>UserComment</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get the comment the buyer wrote.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>UserId</nowiki>|HasGetter=1|Description=<nowiki>The id of the user ordering.</nowiki>}}
 
}}
 
}}

Revision as of 07:15, 2 July 2020

Order



Order object used while processing orders

Parent class

Inherits from object

Constructors

  • (int id "The order's id") - Fetch exist Order
  • (string currency "Currency to use for calculations. Use empty for default currency") - Create a new order
  • (string currency "Currency to use for calculations. Use empty for default currency", string deliveryTo "Name of recipient", string address "First address line of delivery address", string address2 "Second address line of delivery address", string city "City of delivery address", string zipcode "Zipcode of delivery address", string region "Region of delivery address", string postbox "Postbox of delivery address", string country "Country of delivery address", int deliveryTypeId "Which type of delivery to use", string userComment "Optional comment from the user") - Create a new order for physical products

Methods

  • Empty AddLog(string msg "Message to add.") - Add an entry to AdminNote automatically appending a newline.
  • string ExecuteFromOther(string successUrl "Url to send buyer to after successfully paying for the product. If empty then send to webshop receipt page", string failureUrl "Url to send buyer to after cancelling payment. If empty then send to webshop cancel page. Empty means default", string merchantName "Merchant name to load the appropriate merchant configuration from the web config", bool payByInvoice "Pay by points/creditcard or if true by invoice", Function callback "Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter") - Save and initiate the payment process. This will commit current transaction and return the url to show next
  • Empty ExecuteFromQuestionnaire(string merchantName "Merchant name to load the appropriate merchant configuration from the web config", bool payByInvoice "Pay by points/creditcard or if true by invoice", Function callback "Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter") - Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order
  • Empty ExecuteFromQuestionnaire(string merchantName "Merchant name to load the appropriate merchant configuration from the web config. Empty means default", Function callback "Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter") - Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order
  • Empty ExecuteFromQuestionnaire(Function callback "Function to call after ordernumber is assigned, so that it can be stored somewhere. OrderNumber is the first and only parameter") - Save and initiate the payment process. This will commit current transaction and redirect to payment. On next question you can see state of order
  • (From object) string ToString() - The string representation of the object.

Properties

  • string AdminNote { get; } - Get the comments the system or admin has written.
  • number GiftPoints { get; } - How many points does the buyer get for completing this order.
  • int HandlingPoints { get; } - How many points was used for handling.
  • bool IsPhysicalOrder { get; } - Does the order contain physical items or not.
  • string ObjectTypeName { get; } - The name of the type of object.
  • number OrderCash { get; } - How much cash was used in total.
  • DateTime OrderDate { get; } - Time and date the buyer completed the order.
  • int OrderId { get; } - The order's id
  • string OrderNumber { get; } - The order number of the order.
  • string OrderPaymentType { get; } - How was the order paid. Possible values is ByPoint, ByCreditCard, ByInvoice, ByCash, ByGiro, ByDanKort, ByPointAndCreditCard.
  • int OrderPoints { get; } - How many points was used in total.
  • number PercentageDiscount { get; } - How much discount does this user get.
  • int PostagePoints { get; } - How many points was used for postage.
  • array ProductOrders { get; } - List of actual products bought.
  • int ProductPoints { get; } - How many points was used for the actual products.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.
  • bool UseGiftPoints { get; } - Does this user get gift points if a bought product gives some.
  • string UserComment { get; set; } - Get the comment the buyer wrote.
  • int UserId { get; } - The id of the user ordering.