This commit is contained in:
@@ -95,15 +95,9 @@ namespace Sockeye.Biz
|
||||
var jData = JObject.Parse(vn.VendorData);
|
||||
|
||||
//It's a test purchase, no need to process it any further...or is there??
|
||||
bool IsTestOrder = false;
|
||||
if (jData["order_notification"]["purchase"]["is_test"] != null && jData["order_notification"]["purchase"]["is_test"].Value<bool>() == true)
|
||||
{
|
||||
|
||||
//during debugging allow it to process as a test but normally test orders should stop here
|
||||
#if (!DEBUG)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
}
|
||||
IsTestOrder = true;
|
||||
|
||||
//fundamentally validate the object is a purchase notification
|
||||
if (jData["order_notification"]["purchase"]["purchase_id"] == null)
|
||||
@@ -170,6 +164,11 @@ namespace Sockeye.Biz
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var salesOrderNumber = jData["order_notification"]["purchase"]["purchase_id"].Value<string>();
|
||||
if (IsTestOrder)
|
||||
salesOrderNumber = "test-order-" + salesOrderNumber;
|
||||
#if (DEBUG)
|
||||
salesOrderNumber += "-debug-test";
|
||||
#endif
|
||||
|
||||
//https://www.newtonsoft.com/json/help/html/DatesInJSON.htm
|
||||
var purchaseDate = jData["order_notification"]["purchase"]["purchase_date"].Value<DateTime>();
|
||||
|
||||
Reference in New Issue
Block a user