public IETCTollTransaction Submit(IETCTollTransaction transaction) { var builtTransaction = EntityBuilder.Build(transaction); if (builtTransaction != null) { try { var builtETCTransaction = ETCEntityBuilder.Build(transaction); var syncTransaction = Mapper.Map <ITollTransaction, Transaction>(builtTransaction); var syncETCTransaction = Mapper.Map <IETCTollTransaction, ETCTransaction>(builtETCTransaction); Sync.Client.SyncClient.SubmitETCTransaction(syncTransaction, syncETCTransaction , GetIAuthenticator(syncETCTransaction.IssuerAuthenticatorGuid) , GetOAuthenticator(syncETCTransaction.OperatorAuthenticatorGuid)); transaction.IsSent = true; return(builtTransaction); } catch (Exception ex) { Log.LogException(ex); Log.LogTrace(ex.Message + ". Check error log for more details."); } } return(transaction); }
public IETCTollTransaction Build(IETCTollTransaction entity) { if (entity.TransactionID.EndsWith("D")) { MailClient.SendMessage <DuplicateTransactionMailFormatter>("Duplicate etc transaction", "Duplicate etc transaction detected: " + entity.TransactionID); } entity.LicensePlate = entity.ANPRLicensePlate; entity.ClassGUID = entity.AppliedClassGUID; entity.IssuerAuthenticatorGuid = Guid.NewGuid(); entity.OperatorAuthenticatorGuid = Guid.NewGuid(); return(!entity.TransactionID.EndsWith("D") ? entity : null); }