Stripe Susbscription Payment Using API Key
How to set up Subscription payments in your app using EasySite
Stripe integration
Step 1. Create Your Website
Already have a project? Great — you can skip this step and move on!
create consulting website
Step 2. Enable your database
Already enabled? Perfect — just skip this step and continue!
Step 3. Add Sign In & Sign Up
Already have registration and login pages? Awesome — just skip this step!
add signin signup
Step 4. Configured Stripe in EasySite
Enable Stripe in EasySite.
Already configured? Perfect — just skip this step and continue!
- Copy Your Stripe Secret Key
Log in to your Stripe account, locate your Secret Key, and click "Click to Copy".
- Enter the Key in Settings
Go to Settings, select Stripe from the left menu, Choose "Subscription Payment" Option, paste your Secret Key into the field, and click "Save".
Step 5. Implement Subscription Payment Functionality
Implement Subscription Payment Functionality
Create a Pricing Page:
- Display a list of subscription products (no login required).
- If a product is not subscribed to by the current user, show a "Subscribe" button (login required) and implement the subscription logic.
- If a product is already subscribed to by the current user, display a clear "Subscribed" indicator and replace the button with a "Cancel Subscription" button (login required), implementing the cancellation logic.
- Each user can only subscribe to one plan at a time.
Step 6. Add Products in "Product" table from Project Admin
Add products so users can make purchases.
-
Open the Project Detail page.
-
Click the "Project Admin" button.
-
Click the "Add Data" button
-
Enter the details for the new product
-
Ensure that the "Status" field is set to "Active."
EasySite
will automatically add subscription products to your Stripe Account product pages. -
Click the Save button to display the StripeProductID, StripeID, and LookupKey values retrieved from your Stripe Account.
Here is what the Stripe Accounts look like
Step 7 Test Stripe Payment
The payment functionality has been implemented. Follow the steps below to verify that it works correctly.
- Step 1:
Open your website in a new window by clicking the "New Open" button located next to the browser’s URL address bar.
Navigate to the Product page, the subscription product should be visible in subscriptoin page.
- Step 2: Click the "Subscribe Now" button to be redirected to the Stripe checkout page, choose "Pay without Link"
-
Step 3: In the next page, Enter the test payment card details as shown below. (You can find test card information in integration-stripe)
-
Step 4: After clicking the "Subscribe" button, a payment successful message is displayed.