Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How add a fee with Stripe in a Blazor implementation

$
0
0

I'm creating a platform with Blazor. The web application is a multitenant application for booking appointments. There are 2 different kind of appointment:

  • one off: the user pays only for one session
  • recurring until cancel: the user can book a session a week and every month the platform has to take a payment

For each payment, a small percentage of the amount has to be paid as fee to my Stripe account and the other part sends to the professional.

I saw those links:

Also, I saw the Stripe documentation to transfer amount. There are 2 options for that: collect fees with either an application_fee_amount or transfer_data[amount]. Here there is an example:

StripeConfiguration.ApiKey = "sk_test_ESDdbUTrLo4e9SC7uoQqlhd2";var options = new Stripe.Checkout.SessionCreateOptions{    LineItems = new List<Stripe.Checkout.SessionLineItemOptions>    {        new Stripe.Checkout.SessionLineItemOptions        {            PriceData = new Stripe.Checkout.SessionLineItemPriceDataOptions            {                Currency = "usd",                ProductData = new Stripe.Checkout.SessionLineItemPriceDataProductDataOptions                {                    Name = "T-shirt",                },                UnitAmount = 1000,            },            Quantity = 1,        },    },    PaymentIntentData = new Stripe.Checkout.SessionPaymentIntentDataOptions    {        ApplicationFeeAmount = 123,        TransferData = new Stripe.Checkout.SessionPaymentIntentDataTransferDataOptions        {            Destination = "{{CONNECTED_ACCOUNT_ID}}",        },    },    Mode = "payment",    SuccessUrl = "https://example.com/success",};var service = new Stripe.Checkout.SessionService();service. Create(options);

If I understood correctly, the {{CONNECTED_ACCOUNT_ID}} is the Stripe account of my platform and the StripeConfiguration.ApiKey is the client ApiKey?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>