//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

        public Braintree(IServiceCollection services, /*IConfiguration configuration, IMediator med,*/ string connectionString)
        {
            Image = "location";

            BraintreeDbContext.Configure(connectionString);

            RequiredConfigurationFields = new FluentList <ProviderConfiguration>()
                                          .Add(new ProviderConfiguration(nameof(ClientId)))
                                          .Add(new ProviderConfiguration(nameof(SecretId)))
                                          .Add(new ProviderConfiguration(nameof(Image)));

            services.AddTransient <TestController>();
        }
示例#2
0
        //■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

        public string Create(string invoiceId, decimal amount)
        {
            //Payment Logic

            using var context = new BraintreeDbContext();

            var paypal = new Paypal {
                Image = "test"
            };

            context.PaypalPayments.Add(paypal);
            context.SaveChanges();

            return($"PaymentID: {paypal.Id}");
        }
示例#3
0
        //═════════════════════════════════════════════════════════════════════════════════════════

        public Dictionary <string, object> Get(string paymentId)
        {
            using var context = new BraintreeDbContext();
            return(context.PaypalPayments.FirstOrDefault().ToDictionary());
        }