Ejemplo n.º 1
0
 internal ConsoleApiCaller(
     IPaymentProviderBackend apiProvider,
     PaymentProviderConfiguration providerConfig)
 {
     this._apiProvider    = apiProvider;
     this._providerConfig = providerConfig;
 }
Ejemplo n.º 2
0
        static async Task MainAsync(string [] args)
        {
            CmdOptions options         = new CmdOptions();
            bool       didParseOptions = CommandLine.Parser.Default.ParseArguments(args, options);

            if (!didParseOptions)
            {
                Console.WriteLine("Error: failed to parse command line options");
                return;
            }

            IPaymentProviderBackend      apiProvider    = PaymentProviderBackendFactory.GetProvider(options.Provider, new ConsoleLoggerAdapter());
            PaymentProviderConfiguration providerConfig = new PaymentProviderConfiguration()
            {
                AccountIdentifer = options.MerchantId,
                SharedSecret     = options.SecretKey
            };
            ConsoleApiCaller apiCaller = new ConsoleApiCaller(apiProvider, providerConfig);

            switch (options.CommandName)
            {
            case "checkAuth":
                await apiCaller.DoCheckAuth(options.RecordId /* , options.SubAccount */);

                break;

            default:
                Console.WriteLine($"Error: command \"{options.CommandName}\" not supporter");
                break;
            }
        }
Ejemplo n.º 3
0
 public DefaultController()
 {
     _paymentProvider = PaymentProviderFactory.GetProvider((ProviderType)Enum.Parse(typeof(ProviderType), _providerName, true),
                                                           new TraceWriterLogAdapter());
     _paymentProviderBackend = PaymentProviderBackendFactory.GetProvider(ProviderType.Realex, new TraceWriterLogAdapter());
 }