ASP.NET CORE & Angular (single solution) .NET 5.0 v10.2.0
Hi,
We would like to sell ebooks to our tenant subscribers. Where after received payment (webhook) they get a download link to the ebook. I was thinking of adding products to our Stripe dashboard and set all options Make a StripeProductsAppService, or should i use the current StripePaymentAppservice and make a function to get all products and displays them in Angular, then on buy go to the stripe checkout page.
Any advice on this? Point me in the right directions. Maybe someone already build this?
Kind regards, Rene van Woezik
7 Answer(s)
-
0
Hi @rvanwoezik
The current AppSubscriptionPayments table is designed only for tenant subscription. I think it will be better to keep payment requests for your e-books in a separate table and use it. So, creating a new AppService will be better.
-
0
I will, should i also create a seperate Stripe Controller for Payment?
-
0
Hi,
I think duplicating the entire flow will be better including a new StripeController.
-
0
Hi,
Do you happen to have some document/description of the entire flow, this would help me a lot instead of reverse enginering.
-
0
Hi @rvanwoezik
Unfortunately not but I can try to explain the flow.
- When a user tries to purchase something, we create a record on database (PaymentRequest) with a not paid status. This record also holds what user is trying to purchase.
- Then, user is provided with the payment gateway selection (If you are planning to use 1 payment gateway, you can skip this section).
- Some payment gateways require additional information, so when user selects a payment gateway we show a form to get additional data if requested by payment gateway.
- Redirect user to payment gateway with a callbackUrl to our website. When user makes the payment, user will be redirected to callbackUrl.
- Validate the payment status on calback URL's controller and set the payment status to paid and make necessary updates on user's account.
For some payment gateways, there might be a different flow using WebHooks. In that case, payment gateway sends a webhook request to an endpoint you provide. In that endpoint, you can validate the payment and update its status to Paid. You can also make necessary updates on user's account in this step.
For this scenario (using WebHooks), in step 5 above, you don't need to validate the payment but you need to show a loading indicator until status of the payment is updated to Paid by webhook.
-
0
Thanks a lot! Very clear description, it works!
Only one more thing, after payment is succeeded i want to present them a temporary secure link where they can download the E-Book. Just like on the asp.net zero website where you can download the project.
Any suggestions, flow how to do this?
Thanks in advance! Rene van Woezik
-
0
Hi,
I think you can store temp links in a separete table, create the link when the purchase is done and delete the link when the temporary period is expired.