Difference between revisions of "PaymentNamespace class"

From Catglobe Wiki
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=PaymentNamespace
+
|Name=<nowiki>PaymentNamespace</nowiki>
|Description=The payment namespace
+
|Description=<nowiki>The payment namespace</nowiki>
|Methods=
+
|InheritsFrom=object|Methods=
{{CGscriptMethods_Template|ReturnType=array|Name=GetDetailedUsageCost|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetDetailedUsageCost</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date}}
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>}}
|Description=Get detailed information about cost in the specified period}}
+
|Description=<nowiki>Get detailed information about cost in the specified period</nowiki>}}
{{CGscriptMethods_Template|ReturnType=array|Name=GetDetailedUsageCost|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetDetailedUsageCost</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=inFolderResourceId|Description=Top level folder to limit the search to}}
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>inFolderResourceId</nowiki>|Description=<nowiki>Top level folder to limit the search to</nowiki>}}
|Description=Get detailed information about cost in the specified period}}
+
|Description=<nowiki>Get detailed information about cost in the specified period</nowiki>}}
{{CGscriptMethods_Template|ReturnType=array|Name=GetDetailedUsageCostByDay|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetDetailedUsageCostByDay</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date}}
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>}}
|Description=Get detailed information about cost in the specified period for each day with cost}}
+
|Description=<nowiki>Get detailed information about cost in the specified period for each day with cost</nowiki>}}
{{CGscriptMethods_Template|ReturnType=array|Name=GetDetailedUsageCostByDay|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetDetailedUsageCostByDay</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=inFolderResourceId|Description=Top level folder to limit the search to}}
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>inFolderResourceId</nowiki>|Description=<nowiki>Top level folder to limit the search to</nowiki>}}
|Description=Get detailed information about cost in the specified period for each day with cost}}
+
|Description=<nowiki>Get detailed information about cost in the specified period for each day with cost</nowiki>}}
{{CGscriptMethods_Template|ReturnType=CatglobeCost|Name=GetSimpleUsageCost|Parameters=
+
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>GetPurchaseInformation</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>inFolderResourceId</nowiki>|Description=<nowiki>Top level folder to get information about</nowiki>}}
|Description=Get simple information about cost in the specified period}}
+
|Description=<nowiki>Get detailed information about purchases made for a given resource</nowiki>}}
{{CGscriptMethods_Template|ReturnType=CatglobeCost|Name=GetSimpleUsageCost|Parameters=
+
{{CGscriptMethods_Template|ReturnType=CatglobeCost|Name=<nowiki>GetSimpleUsageCost</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=array|Name=startDate|Description=Period start date|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=endDate|Description=Period end date|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=inFolderResourceId|Description=Top level folder to limit the search to}}
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>}}
|Description=Get simple information about cost in the specified period}}
+
|Description=<nowiki>Get simple information about cost in the specified period</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
+
{{CGscriptMethods_Template|ReturnType=CatglobeCost|Name=<nowiki>GetSimpleUsageCost</nowiki>|Parameters=
{{CGscriptMethods_Template|ReturnType=Empty|Name=UpdateExpired|Parameters=
+
{{CGscriptParameters_Template|Type=array|Name=<nowiki>startDate</nowiki>|Description=<nowiki>Period start date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>endDate</nowiki>|Description=<nowiki>Period end date</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>inFolderResourceId</nowiki>|Description=<nowiki>Top level folder to limit the search to</nowiki>}}
{{CGscriptParameters_Template|Type=int|Name=inFolderResourceId|Description=Top level folder to limit the search to}}
+
|Description=<nowiki>Get simple information about cost in the specified period</nowiki>}}
|Description=Register any expired packages as used units}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>UpdateExpired</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>inFolderResourceId</nowiki>|Description=<nowiki>Top level folder to limit the search to</nowiki>}}
 +
|Description=<nowiki>Register any expired packages as used units</nowiki>}}
 
|Properties=
 
|Properties=
{{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=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
  
Line 33: Line 36:
  
 
<source lang="javascript">
 
<source lang="javascript">
//array endDate=getCurrentDateTime();
+
//GetDetailedUsageCost
//array startDate = DateTime_subtractDays(endDate,7);
+
array startDate ={2016,12,30,0,0};
 +
array endDate = {2016,12,31,23,59};
 +
number folderRId =15555058;
 +
array DetailedUsageCost1 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate);// array of CatglobeCost
 +
array DetailedUsageCost2 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate,folderRId);//array of CatglobeCost
 +
print(DetailedUsageCost1);//{Qnaire A (Q:478000, Cgs:18136000, Import:0, Mail:1200, Sms:0, Exp:0, Bought:0) = 18615200,Qnanire B (...),...}
 +
print(DetailedUsageCost2);//{Qnaire A (Q:478000, Cgs:18136000, Import:0, Mail:1200, Sms:0, Exp:0, Bought:0) = 18615200,Qnanire B (...),...}
 +
</source><br/><source lang="javascript">
 +
//GetDetailedUsageCostByDay
 
array endDate = {2016,11,28,23,59};
 
array endDate = {2016,11,28,23,59};
 
array startDate ={2016,11,28,0,0};
 
array startDate ={2016,11,28,0,0};
number folderRId =15548914;//"AnCompany" folder;
+
number folderRId =15548914;
+
array arrayCatglobeCostPerDay = Catglobe.Payment.GetDetailedUsageCostByDay(startDate, endDate,folderRId);
array DetailedUsageCost1 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate);
+
CatglobeCostPerDay CostPerDay = arrayCatglobeCostPerDay[0];
array DetailedUsageCost2 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate,folderRId);
+
CostPerDay.CollectionType;//1
print(DetailedUsageCost1);
+
CostPerDay.CollectionTypeAsString ;//ImportedData
/* result
+
CostPerDay.Date;//2016-11-28 00:00:00
{Function_System\Questionnaire (Q:0, Cgs:0, Import:0, Mail:0, Exp:0, Bought:-1000) = -1000,
+
CostPerDay.Units;//20300
-----\AnCompany\Qnaire\Survey test (Q:0, Cgs:0, Import:20300, Mail:0, Exp:0, Bought:0) = 20300}
 
*/
 
print(DetailedUsageCost2);
 
/* Resoult {
 
-----\AnCompany\Qnaire\Survey test (Q:0, Cgs:0, Import:20300, Mail:0, Exp:0, Bought:0) = 20300
 
}*/
 
 
</source><br/><source lang="javascript">
 
</source><br/><source lang="javascript">
//array endDate=getCurrentDateTime();
+
//GetSimpleUsageCost
//array startDate = DateTime_subtractDays(endDate,7);
+
array startDate ={2016,12,30,0,0};
array endDate = {2016,11,28,23,59};
+
array endDate = {2016,12,31,23,59};
array startDate ={2016,11,28,0,0};
+
number folderRId =15555058;
number folderRId =15548914;//"AnCompany" folder;
 
 
CatglobeCost SimpleUsageCost1 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate);
 
CatglobeCost SimpleUsageCost1 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate);
 
CatglobeCost SimpleUsageCost2 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate,folderRId);
 
CatglobeCost SimpleUsageCost2 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate,folderRId);
print(SimpleUsageCost1);// (Q:0, Cgs:0, Import:20300, Mail:0, Exp:0, Bought:-1000) = 19300
+
print(SimpleUsageCost1);//(Q:11000, Cgs:8000, Import:4000, Mail:8000, Exp:0, Bought:-400000) = -369000
print(SimpleUsageCost2);// (Q:0, Cgs:0, Import:20300, Mail:0, Exp:0, Bought:0) = 20300
+
print(SimpleUsageCost2);//(Q:11000, Cgs:8000, Import:4000, Mail:8000, Exp:0, Bought:-200000) = -169000
 +
</source><br/><source lang="javascript">
 +
//GetPurchaseInformation
 +
number folderRId=15556593;
 +
array purInfo = Catglobe.Payment.GetPurchaseInformation(folderRId);
 +
CatglobeCostPurchase a = purInfo[0];
 +
print(a.BuyStatusAsString);
 +
print(a.ExpireDate);
 +
print(a.PurchaseDate);
 +
print(a.ResourceId);
 +
print(a.Units);
 +
print(a.UsageStatusAsString);
 
</source>
 
</source>

Latest revision as of 06:21, 2 July 2020

PaymentNamespace



The payment namespace

Parent class

Inherits from object

Methods

  • array GetDetailedUsageCost(array startDate "Period start date", array endDate "Period end date") - Get detailed information about cost in the specified period
  • array GetDetailedUsageCost(array startDate "Period start date", array endDate "Period end date", int inFolderResourceId "Top level folder to limit the search to") - Get detailed information about cost in the specified period
  • array GetDetailedUsageCostByDay(array startDate "Period start date", array endDate "Period end date") - Get detailed information about cost in the specified period for each day with cost
  • array GetDetailedUsageCostByDay(array startDate "Period start date", array endDate "Period end date", int inFolderResourceId "Top level folder to limit the search to") - Get detailed information about cost in the specified period for each day with cost
  • array GetPurchaseInformation(int inFolderResourceId "Top level folder to get information about") - Get detailed information about purchases made for a given resource
  • CatglobeCost GetSimpleUsageCost(array startDate "Period start date", array endDate "Period end date") - Get simple information about cost in the specified period
  • CatglobeCost GetSimpleUsageCost(array startDate "Period start date", array endDate "Period end date", int inFolderResourceId "Top level folder to limit the search to") - Get simple information about cost in the specified period
  • (From object) string ToString() - The string representation of the object.
  • Empty UpdateExpired(int inFolderResourceId "Top level folder to limit the search to") - Register any expired packages as used units

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

//GetDetailedUsageCost
array startDate ={2016,12,30,0,0};
array endDate = {2016,12,31,23,59};
number folderRId =15555058; 
array DetailedUsageCost1 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate);// array of CatglobeCost
array DetailedUsageCost2 = Catglobe.Payment.GetDetailedUsageCost(startDate, endDate,folderRId);//array of CatglobeCost
print(DetailedUsageCost1);//{Qnaire A (Q:478000, Cgs:18136000, Import:0, Mail:1200, Sms:0, Exp:0, Bought:0) = 18615200,Qnanire B (...),...}
print(DetailedUsageCost2);//{Qnaire A (Q:478000, Cgs:18136000, Import:0, Mail:1200, Sms:0, Exp:0, Bought:0) = 18615200,Qnanire B (...),...}


//GetDetailedUsageCostByDay
array endDate = {2016,11,28,23,59};
array startDate ={2016,11,28,0,0};
number folderRId =15548914;
array arrayCatglobeCostPerDay = Catglobe.Payment.GetDetailedUsageCostByDay(startDate, endDate,folderRId);
CatglobeCostPerDay CostPerDay = arrayCatglobeCostPerDay[0];
CostPerDay.CollectionType;//1
CostPerDay.CollectionTypeAsString ;//ImportedData
CostPerDay.Date;//2016-11-28 00:00:00
CostPerDay.Units;//20300


//GetSimpleUsageCost
array startDate ={2016,12,30,0,0};
array endDate = {2016,12,31,23,59};
number folderRId =15555058;
CatglobeCost SimpleUsageCost1 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate);
CatglobeCost SimpleUsageCost2 = Catglobe.Payment.GetSimpleUsageCost(startDate, endDate,folderRId);
print(SimpleUsageCost1);//(Q:11000, Cgs:8000, Import:4000, Mail:8000, Exp:0, Bought:-400000) = -369000
print(SimpleUsageCost2);//(Q:11000, Cgs:8000, Import:4000, Mail:8000, Exp:0, Bought:-200000) = -169000


//GetPurchaseInformation
number folderRId=15556593;
array purInfo = Catglobe.Payment.GetPurchaseInformation(folderRId);
CatglobeCostPurchase a = purInfo[0];
print(a.BuyStatusAsString);
print(a.ExpireDate);
print(a.PurchaseDate);
print(a.ResourceId);
print(a.Units);
print(a.UsageStatusAsString);