Stripe Provider Integration

How to get started with payment provider integrations.

Stripe

Installing the integration

  • Install the Ucommerce.Payments.Stripe NuGet package.

  • Add the Stripe integration to the program.cs file to use the default Stripe implementation:

Program.cs
        services.AddUcommerce()    
            .AddBackOffice()
            .AddPayments()
            .AddStripe()
        
        app.UseUcommerce()
            .UseBackOfficeUi()
            .UsePayments()
            .UseStripe("OptionalCallbackUri");

Stripe is now available as a payment method service. It can now be selected for new and existing payment methods.

Creating a Payment Method

  • In the back office UI, navigate to Settings -> Payment Methods.

  • Click New to create a new payment method.

  • Select Stripe as the service.

All added services will show up in the Service tab

Configuring Stripe

Connect the payment method to a Stripe account by filling out the Service properties section in UI.

This is what the default payment service properties looks like - it only contains an AcceptUrl property.

The service properties available will vary depending on the payment service selected.

Property
Description
Required

Public Key

The account-specific public key for the Stripe account. It can be found in the Stripe Developer Dashboard.

Secret Key

The account-specific secret key for the Stripe account. It can be found in the Stripe Developer Dashboard.

Webhook Secret

The webhook-specific key. It is set up in the Stripe Developer Dashboard.

Success URL

The partial route that the user is navigated to on a successful purchase.

Cancel URL

The partial route that the user is navigated to on an unsuccessful purchase.

Once configured, the payment method can be enabled by flipping the Enabled toggle in the UI.

When testing the Stripe integration, the Stripe CLI can greatly help. If testing is done on a local machine using localhost, a tunneling service can be used as a proxy.

Last updated

Was this helpful?