# Stripe

## Why Stripe?

Well for one, paypal sdk is outdated, has little documentation, and didn't play nicely with windows form.  So I decided to go with stripe as it had all of these things which made my life easier.&#x20;

## Setting up Stripe

First off you need access to the account. From there you are able to access everything in the test environment. We had to set up a product and issue cards to start testing in our project

## Creating a Product

We want to create a product so we have something the user can purchase that we can track. So look up in the search bar "Product" and then click the purple "New" button. Then create the product with a name and description, we can then see it in the product menu.

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2Fzw6mkDT8lps7YD6XtJTh%2FtoViewLink.PNG?alt=media&#x26;token=821ec8a1-f7d8-47b8-ae3c-3e667a9e4e18" alt=""><figcaption><p>Shows our product and its id</p></figcaption></figure>

With this we can now press the "view payment link" to grab what we really need.

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FVe77Dj1c1uStXscnqjm2%2FcopyLink.PNG?alt=media&#x26;token=17e6480c-9f03-405e-a788-248f4621d9aa" alt=""><figcaption><p>Copy the product buy url so we can reference it in our project</p></figcaption></figure>

We can grab the url which we can use in our project to take the user to the purchase page when they click the "Pay" option after killing the flea. This method can be used for whenever a new transaction is implemented into the project.

## Testing our Product

First thing first, we need to issue a fake credit card so we can test the product and track it's payment logs. So type "Card" into the search bar and press issuing. Againsimply press the purple "New" and input fake info to create a card. Then we can see the credit card info which looks like ...

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FUFTWtNd56XUmJJ4u1wAk%2FviewingCreditInfi.PNG?alt=media&#x26;token=1bc49c3d-19f8-4195-ab84-9e240e6c007b" alt=""><figcaption><p>Credit Card Info</p></figcaption></figure>

Now when we use the product link we have a credit card to test the payment success and failure.&#x20;

Before testing don't forget to add funds to the card, so type "Balances" in the search andonce there simply go to top-up and add funds, or take away to test instances of success and failure methods.

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FQSx6cDhuII0z8ydEvyOE%2FAddBalance.PNG?alt=media&#x26;token=91986317-0de6-4eeb-adc8-d5dbdb086e77" alt=""><figcaption></figcaption></figure>

Lastly with all this together we can check the logs to see what happens and adjust accordingly, simply search logs and you get&#x20;

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FX6AbGhJziKjDT3z8wBid%2FusingLogs.PNG?alt=media&#x26;token=3a31e0ce-5c4c-4231-9909-f9e8020835b3" alt=""><figcaption><p>Logs and all http Post, Get, etc</p></figcaption></figure>
