///<summary>Converts the XML string result from the EdgeExpress API to an XWebResponse.</summary> private static XWebResponse CreateEdgeExpressXWebResponse(string result, EdgeExpressTransactionType edgeExpressTransactionType) { XWebResponse xResponse = new XWebResponse(); if (edgeExpressTransactionType.In(EdgeExpressTransactionType.CreditSale, EdgeExpressTransactionType.CreditAuth)) { xResponse.OTK = WebSerializer.DeserializeNode(result, "SESSIONTOKEN"); xResponse.HpfUrl = WebSerializer.DeserializeNode(result, "PAYPAGEURL"); xResponse.TransactionStatus = XWebTransactionStatus.EdgeExpressPending; } if (edgeExpressTransactionType == EdgeExpressTransactionType.QueryPayment) { string responseCode = WebSerializer.DeserializeNode(result, "RESPONSECODE"); XWebResponseCodes responseCodeEnum = PIn.Enum <XWebResponseCodes>(PIn.Int(responseCode, hasExceptions: false), XWebResponseCodes.Undefined); if (responseCodeEnum == XWebResponseCodes.InvalidReferenceError) { //XWeb gives this code before the patient completes the transaction. They also give this code when the OrderId doesn't exist. xResponse.XWebResponseCode = XWebResponseCodes.Pending; } else { xResponse = ConvertEdgeExpressResponse(result); } } return(xResponse); }
/// <summary>When we fetch webforms, they are not yet formated as our SheetField objects, so pass in as a datarow.</summary> public static string GetSignatureKeySheets(List <DataRow> listSheetRows) { List <SheetField> listSheetFields = new List <SheetField>(); foreach (DataRow row in listSheetRows) { listSheetFields.Add(new SheetField() { FieldValue = PIn.String(row["FieldValue"].ToString()), FieldType = PIn.Enum <SheetFieldType>(row["FieldType"].ToString()) }); } return(GetSignatureKeySheets(listSheetFields)); }