Giter Club home page Giter Club logo

stripe-dotnet-extensions's Introduction

Hi everyone ๐Ÿ‘‹๐Ÿพ

I'm a Developer Advocate, Podcaster, Teacher, Swimmer & Music Lover. Born and Raised in the island of Antigua ๐Ÿ‡ฆ๐Ÿ‡ฌ. Throughout my career, I've focused on building solutions using Web technologies, .NET, JavaScript and other technologies. I also have a pasison for software architecture, testing and Web API design.

๐Ÿ’ฌ Reach out anytime and ask me about ...

  • Web APIs
  • C# / .NET
  • ASP.NET Core
  • Developer Communities
  • Creating Videos

๐ŸŒฑ Currently learning about

  • Go(lang)
  • Mobile Dev

๐Ÿ“ซ You can reach out to me on

โšก Fun fact

I'm a huge fan of watersports. I've been swimming for most of my life. I recently got certified as an Open Water Scuba Driver ๐Ÿคฟ, and now I'm working on my next certifications.

stripe-dotnet-extensions's People

Contributors

cecilphillip-stripe avatar pakrym-stripe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

stripe-dotnet-extensions's Issues

Handle multiple signing secrets

I'd love to see us support multiple webhook signing secrets either as part of the webhook processing extension or the Stripe.net SDK directly. When working with Connect, users will have at least 2 webhook endpoints set up, each with a unique secret. In the past, we've told users to "try" checking one signature and if that raises an exception "try" the next secret.

Ideally we could do that try/catch logic for devs and not use exception handling for control flow.

Stripe Assembly Scanning

@pakrym-stripe what are your thoughts on using something like this to register all the Stripe services

This ends up registering about 100+ of our services. I'm wondering if we need to register all of those up front or maybe we can use source generation? ๐Ÿค”

var collection = new ServiceCollection();

var serviceProvider = FromAssembly(collection).BuildServiceProvider();
var productService = serviceProvider.GetRequiredService<ProductService>();


static IServiceCollection FromAssembly(IServiceCollection collection)
{
    var types = typeof(StripeClient).Assembly.DefinedTypes.Select(x => x.AsType())
        .Where(t => t.IsClass && !t.IsAbstract && t.IsPublic && t.Name.EndsWith("Service"));

    foreach (var type in types)
    {
        TryAddType(collection, type);
    }

    return collection;
}

static void TryAddType(IServiceCollection collection, Type type)
{
    ConstructorInfo[] constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.Instance);
    foreach (var constructr in constructorInfo)
    {
        var parameters = constructr.GetParameters();
        foreach (var parametr in parameters)
        {
            if (parametr.ParameterType == typeof(IStripeClient))
            {
                collection.TryAdd(ServiceDescriptor.Transient(type, type));
                return;
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.