This commit is contained in:
2023-01-23 23:27:38 +00:00
parent d40367c884
commit e9ef4f0b40
2 changed files with 8 additions and 9 deletions

View File

@@ -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>();