Difference between revisions of "Order class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=Order |Description=Order object used while processing orders |Methods= {{CGscriptMethods_Template|ReturnType=Empty|Name=AddLog|Parameters= {{CGs...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{CGscriptClass_Template |Name=Order |Description=Order object used while processing orders |Methods= {{CGscriptMethods_Template|ReturnType=Empty|Name=AddLog|Parameters= {{CGscriptParameters_Template|Type=string|Name=msg|Description=Message to add.}} |Description=Add an entry to AdminNote automatically appending a newline.}} {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} |Properties= {{CGscriptProperties_Template|ReturnType=string|Name=AdminNote|HasGetter=1|Description=Get the comments the system or admin has written.}} {{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=HandlingPoints|HasGetter=1|Description=How many points was used for handling.}} {{CGscriptProperties_Template|ReturnType=bool|Name=IsPhysicalOrder|HasGetter=1|Description=Does the order contain physical items or not.}} {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} {{CGscriptProperties_Template|ReturnType=number|Name=OrderCash|HasGetter=1|Description=How much cash was used in total.}} {{CGscriptProperties_Template|ReturnType=DateTime|Name=OrderDate|HasGetter=1|Description=Time and date the buyer completed the order.}} {{CGscriptProperties_Template|ReturnType=string|Name=OrderNumber|HasGetter=1|Description=The order number of the order.}} {{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=number|Name=OrderPoints|HasGetter=1|Description=How many points was used in total.}} {{CGscriptProperties_Template|ReturnType=number|Name=PercentageDiscount|HasGetter=1|Description=How much discount does this user get.}} {{CGscriptProperties_Template|ReturnType=number|Name=PostagePoints|HasGetter=1|Description=How many points was used for postage.}} {{CGscriptProperties_Template|ReturnType=array|Name=ProductOrders|HasGetter=1|Description=List of actual products bought.}} {{CGscriptProperties_Template|ReturnType=number|Name=ProductPoints|HasGetter=1|Description=How many points was used for the actual products.}} {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} {{CGscriptProperties_Template|ReturnType=bool|Name=UseGiftPoints|HasGetter=1|Description=Does this user get gift points if a bought product gives some.}} {{CGscriptProperties_Template|ReturnType=string|Name=UserComment|HasGetter=1|Description=Get the comment the buyer wrote.}} {{CGscriptProperties_Template|ReturnType=number|Name=UserId|HasGetter=1|Description=The id of the user ordering.}} }}
+
{{CGscriptClass_Template
 +
|Name=<nowiki>Order</nowiki>
 +
|Description=<nowiki>Order object used while processing orders</nowiki>
 +
|InheritsFrom=object|Constructors=
 +
{{CGscriptConstructors_Template|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>id</nowiki>|Description=<nowiki>The order's id</nowiki>}}
 +
|Description=<nowiki>Fetch exist 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>}}
 +
|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=
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddLog</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>msg</nowiki>|Description=<nowiki>Message to add.</nowiki>}}
 +
|Description=<nowiki>Add an entry to AdminNote automatically appending a newline.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>AddNote</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>msg</nowiki>|Description=<nowiki>Message to add.</nowiki>}}
 +
|Description=<nowiki>Append new comment for exist order</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Approve</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=bool|Name=<nowiki>acceptTestPayment</nowiki>|Description=<nowiki>If true, test payments will succeed, otherwise an exception is throw if test cards are used</nowiki>}}
 +
|Description=<nowiki>Order is approve by cashier with default Merchant.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Approve</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=bool|Name=<nowiki>acceptTestPayment</nowiki>|Description=<nowiki>If true, test payments will succeed, otherwise an exception is throw if test cards are used</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>}}
 +
|Description=<nowiki>Order is approve by cashier.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ExecuteFromOther</nowiki>|Parameters=
 +
{{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=<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=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
 +
{{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=<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=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
 +
{{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=<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=<nowiki>ExecuteFromQuestionnaire</nowiki>|Parameters=
 +
{{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=<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=<nowiki>ExecutePoints</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>how many points that user used to paid</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>successUrl</nowiki>|Description=<nowiki>Url to send buyer to after successfully paying for the product. Its suffix will be added with order number</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>failureUrl</nowiki>|Description=<nowiki>Url to send buyer to after cancelling payment. Its suffix will be added with order number</nowiki>}}
 +
|Description=<nowiki>Save and initiate the payment process. It's return a url used to redirect next page</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ExecutePoints</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>how many points that user used to paid</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>successUrl</nowiki>|Description=<nowiki>Url to send buyer to after successfully paying for the product. Its suffix will be added with order number</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>failureUrl</nowiki>|Description=<nowiki>Url to send buyer to after cancelling payment. Its suffix will be added with order number</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>}}
 +
|Description=<nowiki>Save and initiate the payment process. It's return a url used to redirect next page</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 +
|Properties=
 +
{{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=<nowiki>GiftPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points does the buyer get for completing this order.</nowiki>}}
 +
{{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=<nowiki>IsPhysicalOrder</nowiki>|HasGetter=1|Description=<nowiki>Does the order contain physical items or not.</nowiki>}}
 +
{{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=<nowiki>OrderCash</nowiki>|HasGetter=1|Description=<nowiki>How much cash was used in total.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>OrderDate</nowiki>|HasGetter=1|Description=<nowiki>Time and date the buyer completed the order.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>OrderId</nowiki>|HasGetter=1|Description=<nowiki>The order's id</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>OrderNumber</nowiki>|HasGetter=1|Description=<nowiki>The order number of the order.</nowiki>}}
 +
{{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=int|Name=<nowiki>OrderPoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used in total.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>OrderStatus</nowiki>|HasGetter=1|Description=<nowiki>The current processing status of an order</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>PaidCash</nowiki>|HasGetter=1|Description=<nowiki>Cash is paid</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PaidPoints</nowiki>|HasGetter=1|Description=<nowiki>Points is paid</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>PercentageDiscount</nowiki>|HasGetter=1|Description=<nowiki>How much discount does this user get.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>PostagePoints</nowiki>|HasGetter=1|Description=<nowiki>How many points was used for postage.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>ProductOrders</nowiki>|HasGetter=1|Description=<nowiki>List of actual products bought.</nowiki>}}
 +
{{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=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 +
{{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=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|Obsolete=1
 +
|Description=<nowiki>The id of the user ordering.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>UserResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>The id of the user ordering.</nowiki>}}
 +
}}

Latest revision as of 06:35, 22 June 2023

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.
  • Empty AddNote(string msg "Message to add.") - Append new comment for exist order
  • bool Approve(bool acceptTestPayment "If true, test payments will succeed, otherwise an exception is throw if test cards are used") - Order is approve by cashier with default Merchant.
  • bool Approve(bool acceptTestPayment "If true, test payments will succeed, otherwise an exception is throw if test cards are used", string merchantName "Merchant name to load the appropriate merchant configuration from the web config") - Order is approve by cashier.
  • 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
  • string ExecutePoints(int points "how many points that user used to paid", string successUrl "Url to send buyer to after successfully paying for the product. Its suffix will be added with order number", string failureUrl "Url to send buyer to after cancelling payment. Its suffix will be added with order number") - Save and initiate the payment process. It's return a url used to redirect next page
  • string ExecutePoints(int points "how many points that user used to paid", string successUrl "Url to send buyer to after successfully paying for the product. Its suffix will be added with order number", string failureUrl "Url to send buyer to after cancelling payment. Its suffix will be added with order number", string merchantName "Merchant name to load the appropriate merchant configuration from the web config") - Save and initiate the payment process. It's return a url used to redirect next page
  • (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.
  • string OrderStatus { get; } - The current processing status of an order
  • number PaidCash { get; } - Cash is paid
  • int PaidPoints { get; } - Points is paid
  • 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.
  • int UserResourceId { get; set; } - The id of the user ordering.