Bonaventure OgetoBy Bonaventure Ogeto|

Build a Church Contributions Mobile App

Build a church contributions app by creating named giving categories (tithe, offering, building fund, missions), collecting each contribution via Paystack with the category in the metadata, storing contributions per member per category, sending a PDF receipt on charge.success, and providing the treasurer with a real-time reporting dashboard showing totals by category, date range, and member.

Giving Categories and Contribution Collection

Tables: giving_categories (name, description, is_recurring_enabled), contributions (member_id, category_id, amount, is_anonymous, paystack_ref, receipt_url, given_at), members (name, phone, email, cell_group).

var GIVING_CATEGORIES = {
  tithe:        { id: 1, name: 'Tithe', description: '10% of your income' },
  offering:     { id: 2, name: 'Offering', description: 'General offering' },
  building_fund: { id: 3, name: 'Building Fund', description: 'New sanctuary construction' },
  missions:     { id: 4, name: 'Missions & Outreach', description: 'Support our mission work' },
  special:      { id: 5, name: 'Special Appeal', description: '' }, // updated per campaign
};

async function give(memberEmail, memberId, categoryId, amount, isAnonymous) {
  var category = await db.givingCategories.findById(categoryId);
  var reference = 'GIVE-' + categoryId + '-' + Date.now();

  var contribution = await db.contributions.create({
    member_id: isAnonymous ? null : memberId,
    category_id: categoryId,
    amount,
    is_anonymous: isAnonymous,
    paystack_ref: reference,
  });

  var res = await fetch('https://api.paystack.co/transaction/initialize', {
    method: 'POST',
    headers: { Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: memberEmail, amount, currency: 'NGN', reference,
      metadata: {
        contribution_id: contribution.id,
        member_id: isAnonymous ? null : memberId,
        category: category.name,
        is_anonymous: isAnonymous,
      },
    }),
  });
  return (await res.json()).data.authorization_url;
}

// Webhook: record contribution and send receipt
if (event.event === 'charge.success') {
  var meta = event.data.metadata;
  if (!meta.contribution_id) return res.sendStatus(200);

  await db.contributions.update(meta.contribution_id, { given_at: new Date() });

  if (!meta.is_anonymous && meta.member_id) {
    var receiptUrl = await generateContributionReceipt(meta.contribution_id, event.data);
    await db.contributions.update(meta.contribution_id, { receipt_url: receiptUrl });
    var member = await db.members.findById(meta.member_id);
    await sendReceiptEmail(member.email, member.name, meta.category, event.data.amount / 100, receiptUrl);
  }
}

Recurring Pledges and Treasurer Reporting

// Set up monthly giving pledge
async function setupRecurringPledge(memberEmail, memberId, categoryId, monthlyAmount) {
  var category = await db.givingCategories.findById(categoryId);
  if (!category.is_recurring_enabled) throw new Error('Recurring giving not available for this category');

  // Use Paystack Plans for recurring giving
  var plan = await getOrCreatePlan(category.name + ' - NGN ' + (monthlyAmount / 100) + '/month', monthlyAmount);

  var res = await fetch('https://api.paystack.co/transaction/initialize', {
    method: 'POST',
    headers: { Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: memberEmail, amount: monthlyAmount,
      plan: plan.plan_code,
      metadata: { member_id: memberId, category_id: categoryId, pledge_type: 'recurring' },
    }),
  });
  return (await res.json()).data.authorization_url;
}

// Treasurer: get contribution report
async function getTreasurerReport(startDate, endDate, categoryId) {
  var query = { given_at_gte: startDate, given_at_lte: endDate };
  if (categoryId) query.category_id = categoryId;

  var contributions = await db.contributions.findAll(query);
  var totalByCategory = {};

  for (var c of contributions) {
    var cat = await db.givingCategories.findById(c.category_id);
    if (!totalByCategory[cat.name]) totalByCategory[cat.name] = 0;
    totalByCategory[cat.name] += c.amount;
  }

  return {
    period: { start: startDate, end: endDate },
    total: contributions.reduce(function(sum, c) { return sum + c.amount; }, 0),
    count: contributions.length,
    by_category: totalByCategory,
    average_per_contributor: contributions.length > 0 ?
      contributions.reduce(function(sum, c) { return sum + c.amount; }, 0) / contributions.length : 0,
  };
}

// Top contributors report (for stewardship recognition, if members consent)
async function getTopContributors(startDate, endDate, limit) {
  return await db.contributions.findTopContributors(startDate, endDate, limit, false /* exclude anonymous */);
}

Learn More

See build a group contribution app for a related group money collection pattern applied to chamas and community savings groups.

Sign up for the McTaba newsletter

Key Takeaways

  • Tag each contribution to a named category (tithe, offering, building fund) in Paystack metadata.
  • Send a PDF receipt to the giver immediately after charge.success — churches are often required to issue receipts.
  • Support recurring pledges using Paystack Plans — monthly giving is more predictable than one-time donations.
  • Provide a treasurer dashboard with totals by category, member, and date range.
  • Allow anonymous giving but provide an option for members to link contributions to their member profile.

Frequently Asked Questions

Is digital tithing via an app accepted in Nigerian and Kenyan churches?
Yes, widely. Many Nigerian Pentecostal churches (RCCG, Winners Chapel, Daystar) and Kenyan churches (PCEA, CITAM, Nairobi Chapel) have adopted digital giving. Digital platforms increase giving by making it convenient for members who do not carry cash — they can give during the service from their phone. Pastors often announce the app and show QR codes on the screen during offering time.
How do I handle tithe calculations for members who want help with the math?
Add a tithe calculator on the giving screen: the member enters their income, the app calculates 10% and pre-fills the amount field. Members can adjust the amount before paying. Some apps connect to payroll systems for automatic tithe deduction with member consent, but this requires deeper integration than a basic giving app.
Does the church need a Paystack merchant account, or can it use a personal one?
Churches are legal entities (NGOs, trusts, or incorporated associations) and should have a business/organizational Paystack account registered in the church's legal name. Using a personal account for organizational funds creates tax, audit, and governance problems. The church's treasurer or accountant should be the Paystack account holder, with appropriate signatories per the church's constitution.

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon