Payment Provider Integration

How to get started with payment provider integrations.

Stripe

Installing the integration

  • Install the Ucommerce.Payments.Stripe NuGet package.

  • To use our default Stripe implementation, add the Stripe integration to your program file:

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

OptionalCallbackUri is the URI where the Stripe webhook should be pointed to later. If left without a value, the default endpoint will be:{yourDomain}/Stripe/process/callback

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 administration interface, navigate to Settings -> Payment Methods.

  • Click "New" to create a new Payment Method.

  • Select Stripe as the service.

Configuring Stripe

Connecting the payment method to a Stripe account.

  • On the Payment Method editor, fill out the Service Properties section.

The Service Properties available will vary depending on the payment service selected.

PropertyDescriotionRequired

Public Key

User-specific public key for Stripe, found in the Stripe Developer Dashboard.

Secret Key

Your user-specific secret key for Stripe, found in the Stripe Developer Dashboard.

Webhook Secret

A key specific for your webhook, 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.

The keys can be found on the Stripe Developer Dashboard located here. When setting up your webhook, remember to point it to the webhook you set up in startup.

  • Once configured, the Payment Method can be enabled by flipping the "Enabled" toggle in the editor.

When testing your Stripe integration, the Stripe CLI can greatly help. And if you want to test this on localhost, a tunneling service can be used as a proxy.

Last updated