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: Go to the Settings tab and select Manage Levels & Pricing, and click on the Payment gateways tab. 

  3. Enable Stripe:

    • Check the Enable Stripe box.
    • Paste the Stripe Secret Key into the API Key field.
  4. Enable Recurring Payments: If you wish to use recurring payments, enable this feature.

  5. Configure Trial Plans:

    • Go to Manage Levels & Pricing.
    • Enable trials for specific plans and define the trial duration in days. 

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 [email protected].