/// <summary>
 ///     Constructor.
 /// </summary>
 /// <param name="messageBus">Message bus used to publish results</param>
 /// <param name="stagedReceiveViewModel">Send parameter view model needed to create transaction</param>
 /// <param name="agentSelector">agent parameter view model needed to create transaction</param>
 /// <param name="sendOperations">Send operations parameter</param>
 public StagedReceiveHandler(IMessageBus messageBus, IStagedReceiveViewModel stagedReceiveViewModel,
                             IAgentSelectorViewModel agentSelector, SendOperations sendOperations, ReceiveOperations receiveOperations)
 {
     SendOperations          = sendOperations;
     ReceiveOperations       = receiveOperations;
     _messageBus             = messageBus;
     _stagedReceiveViewModel = stagedReceiveViewModel;
     _agentSelector          = agentSelector;
 }
Example #2
0
 private static UserSettings GetUserSettingsFromVm(IAgentSelectorViewModel agentSettings,
                                                   IReceiveViewModel receiveSettings,
                                                   IStagedReceiveViewModel stagedReceiveSettings,
                                                   ISendParametersViewModel sendSettings,
                                                   ISendParametersViewModel stagedSendSettings,
                                                   ISendReversalParametersViewModel sendReversalSettings,
                                                   IBillPayViewModel billPaySettings, IStagedBillPayViewModel stagedBillPaySettings, ITransactionPickerViewModel transactionPicker)
 {
     return(new UserSettings
     {
         Environment = agentSettings.SelectedEnvironment,
         AgentId = agentSettings.SelectedAgent.AgentId,
         AgentLocation = agentSettings.SelectedAgentLocation.AgentStateCode,
         AgentPosId = agentSettings.SelectedAgentPos.AgentSequence,
         TransactionType = transactionPicker.SelectedTransaction.Type,
         SendSettings = new SendSettings
         {
             CountryCode = sendSettings.SelectedCountry?.CountryCode,
             AmountRange = sendSettings.SelectedAmountRange?.Code,
             CustomAmount = sendSettings.CustomAmount,
             CountrySubdivisionCode = sendSettings?.SelectedCountrySubdivision.CountrySubdivisionCode,
             CurrencyCode = sendSettings.SelectedCurrency?.CurrencyCode,
             ItemChoice = sendSettings.SelectedItemChoice?.Code,
             ServiceOption = sendSettings.SelectedServiceOption?.Key,
             ThirdPartyType = sendSettings.SelectedThirdPartyType
         },
         StagedSendSettings = new SendSettings
         {
             CountryCode = stagedSendSettings.SelectedCountry?.CountryCode,
             AmountRange = stagedSendSettings.SelectedAmountRange?.Code,
             CustomAmount = stagedSendSettings.CustomAmount,
             CountrySubdivisionCode = stagedSendSettings?.SelectedCountrySubdivision.CountrySubdivisionCode,
             CurrencyCode = stagedSendSettings.SelectedCurrency?.CurrencyCode,
             ItemChoice = stagedSendSettings.SelectedItemChoice?.Code,
             ServiceOption = stagedSendSettings.SelectedServiceOption?.Key,
             ThirdPartyType = stagedSendSettings.SelectedThirdPartyType
         },
         SendReversalSettings = new SendReversalSettings
         {
             CountryCode = sendReversalSettings.SelectedCountry?.CountryCode,
             AmountRange = sendReversalSettings.SelectedAmountRange?.Code,
             CustomAmount = sendReversalSettings.CustomAmount,
             CountrySubdivisionCode = sendReversalSettings?.SelectedCountrySubdivision.CountrySubdivisionCode,
             CurrencyCode = sendReversalSettings.SelectedCurrency?.CurrencyCode,
             ItemChoice = sendReversalSettings.SelectedItemChoice?.Code,
             ServiceOption = sendReversalSettings.SelectedServiceOption?.Key,
             ThirdPartyType = sendReversalSettings.SelectedThirdPartyType,
             RefundReasonCode = sendReversalSettings.SelectedRefundReason?.Identifier,
             RefundFee = sendReversalSettings.RefundFee
         },
         ReceiveSettings = new ReceiveSettings
         {
             AgentState = receiveSettings.SelectedCountrySubdivision?.CountrySubdivisionCode,
             CountryCode = receiveSettings.SelectedCountry?.CountryCode,
             CountrySubdivisionCode = receiveSettings.SelectedCountrySubdivision?.CountrySubdivisionCode,
             CurrencyCode = receiveSettings.SelectedCurrency?.CurrencyCode,
             AmountRange = receiveSettings.SelectedAmountRange?.Code,
             CustomAmount = receiveSettings.CustomAmount,
             ItemChoice = receiveSettings.SelectedItemChoice?.Code,
             ServiceOption = receiveSettings.SelectedServiceOption?.Key,
             ThirdPartyType = receiveSettings.SelectedThirdPartyType
         },
         StagedReceiveSettings = new ReceiveSettings
         {
             AgentState = stagedReceiveSettings.SelectedCountrySubdivision?.CountrySubdivisionCode,
             CountryCode = stagedReceiveSettings.SelectedCountry?.CountryCode,
             CountrySubdivisionCode = stagedReceiveSettings.SelectedCountrySubdivision?.CountrySubdivisionCode,
             CurrencyCode = stagedReceiveSettings.SelectedCurrency?.CurrencyCode,
             AmountRange = stagedReceiveSettings.SelectedAmountRange?.Code,
             CustomAmount = stagedReceiveSettings.CustomAmount,
             ItemChoice = stagedReceiveSettings.SelectedItemChoice?.Code,
             ServiceOption = stagedReceiveSettings.SelectedServiceOption?.Key,
             ThirdPartyType = stagedReceiveSettings.SelectedThirdPartyType
         },
         BillPaySettings = new BillPaySettings
         {
             CountryCode = billPaySettings.SelectedCountry?.CountryCode,
             AmountRange = billPaySettings.SelectedAmountRange?.Code,
             CustomAmount = billPaySettings.CustomAmount,
             ThirdPartyType = billPaySettings.SelectedThirdPartyType,
             Biller = billPaySettings.SelectedBiller?.Code,
             ManualBillerCode = billPaySettings.ManualBillerCode,
             ManualBillerAccountNumber = billPaySettings.ManualBillerAccountNumber
         },
         StagedBillPaySettings = new BillPaySettings
         {
             CountryCode = stagedBillPaySettings.SelectedCountry?.CountryCode,
             AmountRange = stagedBillPaySettings.SelectedAmountRange?.Code,
             CustomAmount = stagedBillPaySettings.CustomAmount,
             ThirdPartyType = stagedBillPaySettings.SelectedThirdPartyType,
             Biller = stagedBillPaySettings.SelectedBiller?.Code,
             ManualBillerCode = stagedBillPaySettings.ManualBillerCode,
             ManualBillerAccountNumber = stagedBillPaySettings.ManualBillerAccountNumber
         },
         FileFormat = StaticSettings.SettingsSvc.UserSettings.FileFormat,
         LastUsedDirectory = StaticSettings.SettingsSvc.UserSettings.LastUsedDirectory
     });
 }
 private void StagedReceiveControl_Initialized(object sender, EventArgs e)
 {
     _vm = StaticStagedReceiveVm.StagedReceiveViewModel;
     _vm.Initialize();
     DataContext = _vm;
 }