I´m trying to make a new payment module for Nop 2.0, but I have problems to get the order from the ordernumber.
For testing I set the correct ordernumber manually, at order 45 I set it to "45", but it always fails in the catch Exception orderNumberGuid = new Guid(orderNumber)... I´m stuck on this so please advise.
I leave the site for the Payment site and when payment is done, I go back to my site.
Leaving the Exception out then I get a servererror.
[ValidateInput(false)]
public ActionResult PAYHandler(FormCollection form)
{
string tx = _webHelper.QueryString<string>("tx");
var processor = _paymentService.LoadPaymentMethodBySystemName("Payments.ewire") as ewirePaymentProcessor;
if (processor == null ||
!processor.IsPaymentMethodActive(_paymentSettings) || !processor.PluginDescriptor.Installed)
throw new NopException("Fejl, ewire modulet kan ikke indlæses!");
var sb = new StringBuilder();
string orderNumber = string.Empty;
string orderNumber2 = string.Empty;
// Find orderNumber
string tempStr = tx;
//int startindex = tempStr.IndexOf("customerOrderId=") + 16;
//int endIndex = tempStr.IndexOf("&validateMD");
//orderNumber2 = tempStr.Substring(startindex, endIndex - startindex);
* orderNumber = "45"; I MANUALLY SET THE CORRECT ORDERNUMBER EACH TIME FOR FAULTFINDING
//values.TryGetValue("customerOrderId", out orderNumber);
Guid orderNumberGuid = Guid.Empty;
try
{
* orderNumberGuid = new Guid(orderNumber); THIS MUST FAIL AS THE CODE AFTER IS NOT EXECUTED
}
catch { }
* Order order = _orderService.GetOrderByGuid(orderNumberGuid); THIS IS NOT EXECUTED!