public PayPalService(PayPalOptions options) { _merchantEmail = options.MerchantEmail; _returnUrl = options.ReturnUrl; _cancelUrl = options.CancelUrl; _currencyCode = options.CurrencyCode; _discount = options.Discount; _tax = options.Tax; _paypalUrl = options.PayPalUrl; }
public HomeController(IOptionsMonitor <PayPalOptions> optionsMonitor) { _options = optionsMonitor.CurrentValue; }
public static IServiceCollection AddPayPalService(this IServiceCollection services, PayPalOptions options) { return(services.AddTransient <IPayPalService>(DefaultServiceProviderFactory => { return new PayPalService(options); })); }