Server into the Project
It is required that we have some type of server function for us to be able to use the stripe API and gather the info we need to make sure the payments do or don't happen
For us to ne able to use the stripe API we need to create a server, so we have to create a new project in our solution.
Steps to set up the project
Create a new project by right clicking the .sln and choosing "New Project", make sure it is a ASP .Net API project
Go to Properties -> launchSetings.json and then note the https and http ports we will use them
Go to the Controllers folder and add a new c# class, this class will be our Controller which we reference in our FallCSC403_Project project.
PaymentController.cs
This is the new controller class we created under the Controller Folder, I will show how this works.
Essentially the [Route] is what we reference in our main code and the Controller has different [HTTPGets] that are different locations we need information from.
Example:
We see the url has our pathway up to /api/payment, but then it has /get-payment-link. This is handled by our controller as we have an HTTPGet that has the path "get-payment-link". This is how we handle all server calls. But here it simply returns the payment link we need for this certain product.
Last updated