A sample of Stripe payments implementation in ASP.NET Web Forms
For this sample, you can download and copy. Warning, there is some trash (useless) code in here, due to my various attempts to learn Stripe.... so make sure to pay attention to only these files below: *CheckoutTest.aspx.cs *Script.js *WebConfig
To make your life easier, make sure you do the following changes:
-
Change the stripe keys in web config file
-
Create a database in Microsoft SQL Management studio, and create the tables in this directory (Customers, and Subscriptions)
-
Change the connection string in webconfig, to reflect your database connection.
-
Make sure to read the Stripe documentation: Introduction https://stripe.com/docs/billing https://stripe.com/docs/billing/subscriptions/set-up-subscription
Github examples https://github.com/stripe-samples/charging-for-multiple-plan-subscriptions https://stripe.dev/elements-examples/
Stripe elements for web https://stripe.com/docs/stripe-js
-
Use the following cards for testing: https://stripe.com/docs/testing#cards
4000000000000002 Charge is declined with a card_declined code. 4000000000000341 Attaching this card to a Customer object succeeds, but attempts to charge the customer fail. 4000000000009995 Charge is declined with a card_declined code. The decline_code attribute is insufficient_funds.