Fee Structure

How donation fees are calculated, what rates apply, and how the total charged amount is derived.

Source files: app/Services/FeeCalculator.php · config/fees.php


Fee Rates

FeeMagpie
Convenience fee1.5%
System fee1.5%

Environment Variables

# .env

APP_SERVICE_FEE_RATE=0.015        # platform system fee

MAGPIE_CONVENIENCE_RATE=0.015

Usage

// app/Services/FeeCalculator.php

$fees = FeeCalculator::calculate('magpie', 1000.00);
// Returns:
// [
//   'convenience_fee' => 15.00,
//   'system_fee'      => 15.00,
//   'total_amount'    => 1030.00,
// ]

Worked Examples

Magpie — ₱1,000 donation

ComponentCalculationAmount
Base amount₱1,000.00
Convenience fee₱1,000 × 1.5%₱15.00
System fee₱1,000 × 1.5%₱15.00
Total charged₱1,030.00

What Gets Sent to Magpie

The total_amount (in cents) is sent to the Magpie Checkout or charge API:

'amount' => (int) round($fees['total_amount'] * 100), // e.g. 103000

What Gets Credited to the Campaign

Campaign balances are incremented by the base donation amount only — fees are excluded:

$donation->campaign->increment('raised_amount', $donation->amount);   // base amount
$donation->campaign->increment('available_amount', $donation->amount); // base amount

The convenience_fee and system_fee stored on the Donation record represent what the donor paid on top of their intended contribution.


Donation Record Fields

FieldValue
amountBase donation (what the donor intended to give)
convenience_feeGateway processing fee
system_feePlatform service fee
total_amountamount + convenience_fee + system_fee (what was charged)

Was this page helpful?