Introduction


Integrating a payment gateway with your eDirectory website is essential for receiving payments from your users when they subscribe to your platform. Stripe is a powerful payment solution that enables you to offer one-time payments, subscriptions, and trial incentives. This article will guide you through the steps to integrate Stripe with your eDirectory website.


Benefits of Using Stripe

  • Subscriptions: Provide your sponsors with flexible payment options.
  • Recurring Payments: Automate billing cycles to save time and ensure consistent revenue.
  • Trial Incentives: Offer promotions, such as a free trial for the first month, to attract more users.

Steps to Integrate Stripe


Stage 1: Obtain the Stripe API


Before enabling Stripe on your eDirectory site, you need to get the API key from the Stripe dashboard.

  1. Go to the Stripe Website: Visit Stripe's website.

  2. Create an Account: If you don’t already have a Stripe account, create one.

  3. Confirm Your Account: Check your email to confirm your account and sign in to the Stripe dashboard.

  4. Activate Your Account: Add your credit card information to make your account active.

Note: Test mode must be disabled to use live keys, make sure to have the test mode disabled in your Stripe dashboard. In order to disable the test mode, Stripe requires valid credit card details for this step. 

    

      5. Get the Secret key: Click on the "Developers" option on the left side menu, click on the "API keys

          tab.


       6. Reveal the Secret Key: Find the secret key and click on the button "Reveal live key", and copy the revealed secret key. 


Notice: When the API key is revealed, you will only be able to see it once. Make sure to copy itbefore clicking on the button "Done". 



Stage 2: Enable Stripe on eDirectory


Once you have the Stripe API key, follow these steps to enable Stripe on your eDirectory site.

  1. Log in to the Site Manager: Access your site’s admin panel.

  2. Open Settings: Select Products & Plans from the submenu.
    3. Click on Additional settings & Payment Gateways.
    4. Check the Enable Stripe box.  
    5. Paste the Stripe API into the API Key field and save changes.
      6.
    Enable Auto bill feature: If you wish to use recurring payments, enable this feature. 7. Configure Trial Plans:

    • After configuring Stripe, navigate to Products & Plans → Plans to add a new plan. In the plan creation form, you will see a field where you can specify the number of days a customer can use the plan on trial.
    • Enable trials for specific plans and define the trial duration in days.

      Notice: The trial feature is only available for Stripe payment gateway, and your user will only get the trial period if they choose to pay by Stripe (Credit card). If you would like to learn more on how to add a plan, please, refer to this article: Products and Plans for New Clients: Explanation of the new terms
        

Stage 3: Configure the Webhook URL

To ensure subscription payments are automatically renewed, you need to configure a webhook URL in Stripe.

  1. Sign in to Stripe: Access your Stripe dashboard.

  2. Open Webhooks Tab: Under the Developers option on the left side menu, click on the Webhooks tab. 

  3. Add a New Endpoint: Click + Add endpoint.

  4. Enter the Webhook URL: Combine your website domain with the following extension: sponsors/billing/stripe_webhook.php 

    Example: https://yourdomain.com/sponsors/billing/stripe_webhook.php

  5. Select Events:
    • Click Select events.
    • Search for invoice.payment_succeeded, check its box, and click "Add events".
  6. Save the Endpoint: Click Add endpoint to complete the configuration.

Note: If you use add-ons or multiple domains, you will need to create a webhook for each domain.




Conclusion


Integrating Stripe with your eDirectory website allows you to offer a seamless payment experience for your users while maintaining flexible and automated billing processes. If you have questions or require assistance, feel free to contact our support team at support@edirectory.com.