Skip to main content

Supported Payment Gateways

TelemanAI supports multiple payment gateways for subscription billing and pay-as-you-go services. Choose the gateway that best fits your region and business needs.

Available Payment Gateways

Stripe

International credit card processing

PayPal

Global payment platform

Razorpay

India’s leading payment gateway

Flutterwave

African payment solutions

Paystack

African payment infrastructure

Instamojo

Indian payment solution

Braintree

PayPal-owned gateway

Mollie

European payment methods

Square

All-in-one payment solution

SSLCommerz

Bangladesh payment gateway

Squad

Nigerian payment processing

Gateway Comparison

GatewayBest ForCurrenciesTest ModeIntegration
StripeGlobal135+ currenciesYesAPI-based
PayPalGlobal25+ currenciesSandboxOAuth/API
RazorpayIndiaINRYesAPI-based
FlutterwaveAfricaMultipleYesAPI-based
PaystackAfricaNGN, ZAR, GHSYesAPI-based
InstamojoIndiaINRYesAPI-based
BraintreeGlobalMultipleYesSDK
MollieEuropeEUR, GBP, USDYesAPI-based
SquareUS, UK, CanadaMultipleSandboxOAuth/API
SSLCommerzBangladeshBDTSandboxAPI-based
SquadNigeriaNGN, USDSandboxAPI-based

Configuration Overview

All payment gateways are configured through environment variables in the .env file.

Environment Variables by Gateway

Stripe

STRIPE="YES"
STRIPE_ENVIRONMENT="sandbox"
STRIPE_KEY="pk_test_..."
STRIPE_SECRET="sk_test_..."

PayPal

PAYPAL="YES"
PAYPAL_SANDBOX=true
PAYPAL_CLIENT_ID="..."
PAYPAL_CLIENT_SECRET="..."
PAYPAL_CURRENCY="USD"

Razorpay

RAZORPAY="YES"
RAZORPAY_KEY="rzp_test_..."
RAZORPAY_SECRET="..."

Flutterwave

FLUTTERWAVE="YES"
FLW_PUBLIC_KEY="FLWPUBK_TEST-..."
FLW_SECRET_KEY="FLWSECK_TEST-..."
FLW_SECRET_HASH="..."
FLW_CURRENCY="NGN"

Paystack

PAYSTACK="YES"
PAYSTACK_PUBLIC_KEY="pk_test_..."
PAYSTACK_SECRET_KEY="sk_test_..."
PAYSTACK_PAYMENT_URL="https://api.paystack.co"
MERCHANT_EMAIL="..."
MERCHANT_CURRENCY="ZAR"

Instamojo

INSTAMOJO="YES"
IM_API_KEY="test_..."
IM_AUTH_TOKEN="test_..."
IM_URL="https://test.instamojo.com/api/1.1/"

Braintree

BRAINTREE="YES"
BT_ENVIRONMENT="sandbox"
BT_MERCHANT_ID="..."
BT_PUBLIC_KEY="..."
BT_PRIVATE_KEY="..."

Mollie

MOLLIE="YES"
MOLLIE_KEY="test_..."
MOLLIE_CURRENCY="EUR"

Square

SQUARE="YES"
SQUARE_ACCESS_TOKEN="..."
SQUARE_APPLICATION_ID="sandbox-..."
SQUARE_LOCATION_ID="..."
SQUARE_CURRENCY="USD"
SQUARE_REDIRECT_URL="${APP_URL}/square/callback"

SSLCommerz

SSL_COMMERZ="YES"
API_DOMAIN_URL="https://sandbox.sslcommerz.com"
STORE_ID="..."
STORE_PASSWORD="..."

Squad

SQUAD="YES"
SQUAD_PUBLIC_KEY="sandbox_pk_..."
SQUAD_SECRET_KEY="sandbox_sk_..."
SQUAD_CURRENCY="NGN"
SQUAD_API_URL="https://sandbox-api-d.squadco.com"

Choosing a Payment Gateway

1

Consider Your Region

Choose a gateway with strong presence in your target market:
  • North America/Europe: Stripe, PayPal, Braintree
  • Africa: Flutterwave, Paystack, Squad
  • India: Razorpay, Instamojo
  • Bangladesh: SSLCommerz
  • Europe: Mollie, Stripe
2

Check Currency Support

Ensure the gateway supports your required currencies:
  • Multi-currency: Stripe, PayPal, Braintree
  • Local currency focused: Razorpay (INR), Paystack (NGN, ZAR)
3

Evaluate Fees

Compare transaction fees and setup costs:
  • Stripe: ~2.9% + $0.30 per transaction
  • PayPal: ~2.9% + $0.30 per transaction
  • Razorpay: ~2% per transaction (India)
  • Flutterwave: ~3.8% per transaction (Africa)
4

Test Integration

Most gateways provide sandbox/test modes:
  • Always test in sandbox mode first
  • Verify webhook delivery
  • Test failed payment scenarios
  • Confirm refund functionality

Enabling a Gateway

1

Update Environment Variables

Add the gateway credentials to your .env file:
STRIPE="YES"
STRIPE_KEY="your_key_here"
STRIPE_SECRET="your_secret_here"
2

Configure in Dashboard

  1. Log in to TelemanAI admin panel
  2. Navigate to SettingsPayment Gateways
  3. Select the gateway you want to enable
  4. Enter your credentials
  5. Choose test or production mode
  6. Click Save Configuration
3

Test the Integration

  1. Go to Pricing page
  2. Select a subscription plan
  3. Proceed to checkout
  4. Complete a test payment
  5. Verify the subscription is activated

Payment Flow

TelemanAI follows a standard payment flow:

Webhook Configuration

Most gateways require webhook endpoints for payment notifications:
GatewayWebhook URLEvents
Stripe/api/stripe/webhookpayment_intent.succeeded
PayPal/api/paypal/webhookPAYMENT.CAPTURE.COMPLETED
Razorpay/api/razorpay/webhookpayment.captured
Flutterwave/api/flutterwave/webhookcharge.completed
Paystack/api/paystack/webhookcharge.success
Replace /api/ with your actual TelemanAI installation URL.

Database Schema

Payment transactions are stored in the payment_histories table:
CREATE TABLE payment_histories (
    id BIGINT PRIMARY KEY,
    user_id BIGINT,
    subscription_id BIGINT,
    package_id BIGINT,
    invoice VARCHAR(50),
    amount DECIMAL(10,2),
    payment_gateway VARCHAR(50),
    payment_status VARCHAR(20),
    transaction_id VARCHAR(100),
    created_at TIMESTAMP,
    updated_at TIMESTAMP
);

Testing Payments

Test Cards by Gateway

Stripe:
  • Success: 4242 4242 4242 4242
  • Decline: 4000 0000 0000 0002
  • CVV: Any 3 digits
  • Expiry: Any future date
PayPal:
  • Use PayPal Sandbox accounts
  • Create test buyer/seller accounts at developer.paypal.com
Razorpay:
  • Card: 4111 1111 1111 1111
  • CVV: Any 3 digits
  • Expiry: Any future date
Flutterwave:
  • Card: 5531 8866 5214 2950
  • CVV: 564
  • Expiry: 09/32
  • OTP: 12345

Security Best Practices

Critical Security Measures:
  • Never commit payment credentials to version control
  • Use environment variables for all API keys
  • Always use HTTPS in production
  • Validate webhook signatures
  • Implement rate limiting on payment endpoints
  • Log all payment transactions
  • Use test mode during development
  • Rotate API keys periodically

PCI Compliance

TelemanAI is designed to minimize PCI compliance requirements:
  • Credit card data never touches your server
  • Payments processed directly on gateway
  • No card storage in your database
  • Tokens used for recurring payments
Most integrations use hosted payment pages or client-side tokenization to maintain PCI compliance.

Troubleshooting

Problem: Gateway doesn’t show on checkout pageSolution:
  • Ensure the gateway is enabled: STRIPE="YES"
  • Check credentials are correctly configured
  • Verify the gateway is activated in settings
  • Clear application cache: php artisan cache:clear
Problem: Payment always failsSolution:
  • Check you’re using test credentials in test mode
  • Verify API keys are correct (no extra spaces)
  • Test with known working test cards
  • Check gateway status page for outages
  • Review gateway dashboard for specific errors
Problem: Payment succeeds but subscription not activatedSolution:
  • Verify webhook URL is publicly accessible
  • Check webhook endpoint in gateway settings
  • Ensure SSL certificate is valid
  • Review webhook logs in gateway dashboard
  • Test webhook with gateway’s testing tool
Problem: Wrong currency displayedSolution:
  • Check STRIPE_CURRENCY or similar environment variable
  • Ensure package prices match the currency
  • Verify gateway supports the currency
  • Update currency settings in admin panel

Multiple Gateway Setup

You can enable multiple gateways simultaneously:
# Enable multiple gateways
STRIPE="YES"
PAYPAL="YES"
RAZORPAY="YES"
Users will see all enabled gateways on the checkout page and can choose their preferred method.

API Reference

Payment gateway services implement the PaymentGatewayInterface:
interface PaymentGatewayInterface
{
    /**
     * Process a payment
     * @param array $paymentData
     * @return mixed
     */
    public function pay(array $paymentData);
}
See:
  • StripeGateway.php - Stripe implementation
  • PayPalGateway.php - PayPal implementation
  • RazorpayGateway.php - Razorpay implementation

Next Steps

Stripe Setup

Configure Stripe payment gateway

PayPal Setup

Configure PayPal payment gateway

Razorpay Setup

Configure Razorpay payment gateway

Subscription Plans

Configure subscription plans and pricing

Build docs developers (and LLMs) love