public static void CreateSalesOrderandPayments(PrepareAndImportOrdersParams objParams)
        {
            try
            {
                using (PXTransactionScope ts = new PXTransactionScope())
                {
                    if (objParams.objliUsrMapping.Where(X => X.IntegrationID == objParams.objSOProcessOrderRecord.IntegrationID).Count() == 0)
                    {
                        objParams.objliUsrMapping.Clear();
                        objParams.objliUsrMapping = SOHelper.GetUsrFieldMapping(objParams.objSOOrderEntry, objParams.objSOProcessOrderRecord.IntegrationID);
                    }
                    if (objParams.objliUsrMapping.Count > 0)
                    {
                        CreateSO objCreateSO = new CreateSO();
                        objCreateSO.SetSOHeaderObjectsData(objParams);
                        objCreateSO.SetSOLineObjectsData(objParams);
                        objCreateSO.SetBillingContactObjectsData(objParams);
                        objCreateSO.SetBillingAddressobjectsData(objParams);
                        objCreateSO.SetFinancialInformationobjectsData(objParams);
                        objCreateSO.SetShippingContactObjectsData(objParams);
                        objCreateSO.SetShippingAddressObjectsData(objParams);
                        objCreateSO.SetFreightData(objParams);
                        objCreateSO.SetDocumentLevelDiscountandTaxData(objParams);

                        //Validate order total -
                        decimal dAmazonTotal = 0;
                        Decimal.TryParse(objParams.ObjCurrentOrder.OrderTotal.Amount, out dAmazonTotal);
                        if (dAmazonTotal !=
                            objParams.objSOOrderEntry.Document.Current.CuryOrderTotal.GetValueOrDefault(0))
                        {
                            throw new PXException(SOMessages.ErrorOrderTotalNotMatch);
                        }

                        objParams.objSOOrderEntry.Actions.PressSave();

                        objCreateSO.CreatePaymentProcess(objParams);
                        if (objParams.objSOOrderEntry.Document.Current != null && !string.IsNullOrEmpty(objParams.objSOOrderEntry.Document.Current.OrderNbr))
                        {
                            ts.Complete();
                            SOLogService.LogImportStatus(objParams, true, SOMessages.sucess);
                            PXProcessing <SOProcessOrder> .SetInfo(objParams.CurrentOrderIndex, SOMessages.sucess);
                        }
                    }
                    else
                    {
                        throw new PXException(SOMessages.FieldMappingEmptyErrMsg);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }