Kartris User Guide

17.20.3. Development and testing

If you are developing and testing locally, Stripe provides a useful tool in the shape of the CLI (Command Line Interface). At time of writing, the latest version is here: https://github.com/stripe/stripe-cli/releases/tag/v1.13.6

Copy the Stripe.exe file to your local machine, and then use a command prompt to navigate to it. If you run your Kartris on Visual Studio's built in server, you can get Stripe's CLI to listen for webhooks and forward them to your local development site's callback page (Kartris will map requests to callback-stripe.aspx to callback.aspx?g=stripe, which tells Kartris which gateway DLL to use for processing the callback). For example, something like this:

stripe listen --forward-to http://localhost:4242/callback-stripe.aspx

The CLI will give you the webhook endpoint secret to use. You need to add this in your settings, see @17.20.1.3. WebhookEndpointSecret‍ 

Once this is set, you can move through your checkout process, select Stripe as payment method, and go through to pay. If you have Stripe set to TEST mode, you will see some dev info on the page before you go to Stripe, and have a checkout button to push. This way, you can view the page source if you need to see what is being posted during development. This page does not show in LIVE mode, Kartris will format the javascript silently and submit it immediately.

You should see the order details to the left, and a payment form to the right. Use the following test card details:

 

4242 4242 4242 4242
any name

a date in the future

any three digit security code

 

Stripe should show the transaction as complete and forward you back to your development site.

 

You should see the order showing as paid in your back end, with the event ID added as the reference code. In the CLI window, you should see some indication that the webhook was triggered and received a 200 ok response.

The full CLI reference is here: https://stripe.com/docs/cli

 
powered by tomehost