# Server into the Project

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.&#x20;

## 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

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FlOr2VuCdwECxzpR61AMC%2FprojectNeeded.PNG?alt=media&#x26;token=b4e5ac5c-2f59-41dd-9e05-c661909553f9" alt=""><figcaption></figcaption></figure>

* 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.&#x20;

## PaymentController.cs

This is the new controller class we created under the Controller Folder, I will show how this works.

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FuYXt8LnVUjfpBUoCg5Dg%2FpaymentController.PNG?alt=media&#x26;token=7f3f4a12-8e91-4ba4-b91e-0ff7a06a63b0" alt=""><figcaption><p>Piece of PaymentController.cs</p></figcaption></figure>

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.&#x20;

Example:

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2Ft9PXD1nOBhd1HaWW3fhq%2FserverExample%20call.PNG?alt=media&#x26;token=1dfeca76-cdec-49f1-ade2-2d22fabc018f" alt=""><figcaption></figcaption></figure>

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.
