# Code Examples

## The Button that Starts it All

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FoJH5VkFYmRsTaHAWaNCn%2Fstart.PNG?alt=media&#x26;token=a1d6663f-e40f-4884-8572-8932572539fb" alt=""><figcaption></figcaption></figure>

So here the user presses the button to pay, which then calls our backend server (PaymentController.cs) to get the payment link, this then calls OpenStripeCheckout which just opens the internet to this url. Then we repeat.

<figure><img src="https://1055530831-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTLAKl9MnL4UmPhZlb3vF%2Fuploads%2FfI16iGX8tz9fAX841KEB%2Frepeats.PNG?alt=media&#x26;token=ba8f2b70-a69d-4eeb-9916-02e546bef593" alt=""><figcaption></figcaption></figure>

We simply keep calling the controller to grab information we need if the HTTP request is successful. We get the paymeny Intent Id so we can monitor its satus, we then strip it from being {"paymentID"} to be paymentID so we can then check the payment status to then finally tell if "status" from the JSON is "succeeded" so we can correctly give the buffs if paid.
