LMS Integration with Payment Systems (Course Sales) Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

LMS Payment System Integration Setup (Course Sales)

LMS monetization is not just a "Buy" button. Full payment system integration includes one-time purchases, subscriptions, coupons, installments, refunds, and correct transaction accounting.

Payment System Selection

System Regions Features
Stripe Worldwide Best API, built-in subscriptions, Stripe Checkout
PayPal Worldwide Wide user trust, PayPal Express
YooKassa Russia/CIS Russian cards, RNKO, QR code
LiqPay Ukraine Privat24, widely known
Paddle SaaS products Merchant of Record, handles VAT

For international LMS — Stripe as the base + regional gateways for specific markets.

Stripe: Basic Integration

// Backend: create Checkout Session
async function createCheckoutSession(userId, courseId, priceId, couponId = null) {
  const user = await db.users.findByPk(userId);
  const course = await db.courses.findByPk(courseId);

  const session = await stripe.checkout.sessions.create({
    customer_email: user.email,
    client_reference_id: `${userId}:${courseId}`,  // Link in webhook
    line_items: [{
      price: priceId,  // Stripe Price ID
      quantity: 1,
    }],
    discounts: couponId ? [{ coupon: couponId }] : [],
    mode: 'payment',  // Or 'subscription' for subscriptions
    success_url: `${process.env.APP_URL}/courses/${courseId}?payment=success&session_id={CHECKOUT_SESSION_ID}`,
    cancel_url: `${process.env.APP_URL}/courses/${courseId}?payment=cancelled`,
    metadata: {
      userId,
      courseId,
    },
    payment_intent_data: {
      metadata: { userId, courseId },
    },
  });

  return session.url;
}

Webhook Handler

Don't rely on success_url for payment confirmation — users can fake it. Always use webhooks:

app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), async (req, res) => {
  const sig = req.headers['stripe-signature'];
  let event;

  try {
    event = stripe.webhooks.constructEvent(req.body, sig, process.env.STRIPE_WEBHOOK_SECRET);
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }

  switch (event.type) {
    case 'checkout.session.completed': {
      const session = event.data.object;
      if (session.payment_status === 'paid') {
        const { userId, courseId } = session.metadata;
        await enrollStudentAfterPayment(userId, courseId, session.id);
      }
      break;
    }
    case 'charge.refunded': {
      await handleRefund(event.data.object);
      break;
    }
    case 'customer.subscription.deleted': {
      await revokeSubscriptionAccess(event.data.object.customer);
      break;
    }
  }

  res.json({ received: true });
});

Monetization Models

One-time Purchase — standard Stripe Payment. Student pays once, gets access forever (or for N months).

Subscription — Stripe Subscriptions. Access to all courses while subscription is active. On cancellation — revoke access via customer.subscription.deleted webhook.

Installments — multiple payments via Stripe payment_intent with installment_plan or manually via scheduled invoices.

Corporate Licenses — purchase N seats for a team. In DB: licenses table → license_seats → user bindings.

Promo Codes

// Create promo code
const coupon = await stripe.coupons.create({
  name: 'SUMMER2026',
  percent_off: 30,          // Or amount_off in kopecks
  duration: 'once',
  redeem_by: Math.floor(new Date('2026-09-01').getTime() / 1000),
  max_redemptions: 500,
});

const promotionCode = await stripe.promotionCodes.create({
  coupon: coupon.id,
  code: 'SUMMER2026',
  restrictions: {
    first_time_transaction: false,
  },
});

On the frontend — promo code input field with validation via Stripe API before checkout.

YooKassa for Russian Users

use YooKassa\Client;

$client = new Client();
$client->setAuth(SHOP_ID, SECRET_KEY);

$payment = $client->createPayment([
    'amount' => ['value' => '3900.00', 'currency' => 'RUB'],
    'capture' => true,
    'confirmation' => [
        'type' => 'redirect',
        'return_url' => env('APP_URL') . '/payment/return',
    ],
    'description' => "Course: {$course->title}",
    'metadata' => ['user_id' => $userId, 'course_id' => $courseId],
], uniqid('', true));

return $payment->getConfirmation()->getConfirmationUrl();

Transaction Accounting

CREATE TABLE transactions (
  id                  UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id             UUID REFERENCES users(id),
  course_id           UUID REFERENCES courses(id),
  provider            VARCHAR(50),  -- 'stripe', 'yookassa', 'paypal'
  provider_payment_id VARCHAR(200) UNIQUE,
  amount              NUMERIC(10,2),
  currency            VARCHAR(3),
  status              VARCHAR(50),  -- 'pending', 'succeeded', 'failed', 'refunded'
  coupon_code         VARCHAR(100),
  discount_amount     NUMERIC(10,2) DEFAULT 0,
  created_at          TIMESTAMPTZ DEFAULT NOW()
);

Timeframes

Stripe integration with one-time purchase, webhook, course enrollment, and promo codes — 4–5 days. Subscription model — additional 2–3 days. YooKassa — 2–3 days. Corporate licenses — 3–4 days.