public async Task <RecurringPaymentOutput> MakePreAuthorizedPaymentAsync(RecurringPaymentInput input, CancellationToken token = default)
        {
            switch (input)
            {
            case IatsRecurringPaymentInput i:
                var iats = this.serviceProvider.GetRequiredService <IPaymentClient <IatsRecurringPaymentInput, IatsRecurringPaymentOutput> >();
                return(await iats.MakePaymentAsync(i, token));

            case MonerisRecurringPaymentInput i:
                var moneris = this.serviceProvider.GetRequiredService <IPaymentClient <MonerisRecurringPaymentInput, MonerisRecurringPaymentOutput> >();
                return(await moneris.MakePaymentAsync(i, token));

            case StripeRecurringPaymentInput i:
                var stripe = this.serviceProvider.GetRequiredService <IPaymentClient <StripeRecurringPaymentInput, StripeRecurringPaymentOutput> >();
                return(await stripe.MakePaymentAsync(i, token));

            case WorldPayRecurringPaymentInput i:
                var worldPay = this.serviceProvider.GetRequiredService <IPaymentClient <WorldPayRecurringPaymentInput, WorldPayRecurringPaymentOutput> >();
                return(await worldPay.MakePaymentAsync(i, token));
            }

            throw new NotSupportedException($"Input of type '{input.GetType().Name}' is not supported.");
        }
Beispiel #2
0
 public Task <RecurringPaymentOutput> MakePreAuthorizedPaymentAsync(RecurringPaymentInput request, CancellationToken token = default)
 {
     throw new NotImplementedException();
 }