Pass On Fee

Does PayMongo support Pass On Fees?

Overview

The Pass On Fee feature allows merchants to automatically include transaction fees in the total selling price. This ensures that the customer covers the additional processing costs, preventing revenue loss for the merchant.

📘

Availability

  • PayMongo Pages: Pass On Fees can be configured for your PayMongo Page. Simply send an email to [email protected] along with your Page URL.
  • API: This document will cover how to implement Pass On Fees via API.

⚠️

Heads-up for API Integrations:

Merchants should first test the Pass On Fee implementation using their test API keys, as PayMongo does not validate this on our end. This ensures the correct calculation and application of the fee before going live. For assistance in locating your test keys, refer to this help center article: How do I test the PayMongo API?

Important Context Before Using Pass On Fee

Before implementing Pass On Fees, it's important to understand the basic workflows for both Payment Intent Payment Method Workflow (PIPM) and Checkout API.

  1. PIPM Workflow
    The PIPM Workflow allows merchants to accept various payment methods by creating a Payment Intent, attaching a Payment Method, and handling authentication (if needed).
    Read more about the PIPM Workflow.
  2. Checkout API Implementation
    The Checkout API is the easiest way to integrate PayMongo into your website or app. Building an integration with the Checkout API involves two actions: creating a Checkout Session and redirecting the customer to the Checkout Session.
    Read more about the Checkout Implementation.

Pass on Fee via API

When integrating Pass On Fees via API, the merchant is responsible for calculating the updated selling price (SP) before sending the transaction request. This ensures that the transaction amount covers processing fees.

How it Works

  1. Compute the SP using the Pass On Fee formula:

    Where:

    • SP = Updated Selling Price
    • OP = Original Selling Price
    • MDR = Merchant Discount Rate (e.g., 3.5% = 0.035)
    • Fixed Fee = Flat fee per transaction

    Adjust for Foreign Fee (FF) if applicable:

    If the transaction involves a foreign card, the foreign fee is calculated as 1% (0.01) of the Selling Price (SP). To factor this in, you need to adjust the formula so that the foreign fee is accounted for in the final selling price.

    • FF = Foreign Fee (1% = 0.01)

    Thus, the formula for SP when the foreign fee applies becomes:


    🚧

    Important Note:

    MDR and Fixed Fee vary per payment method (e.g., card payments, e-wallets, DOB). Make sure to apply the correct MDR and fixed fee for the selected payment method. For more details, please refer to transaction fees, rates, and charges.

  2. Use the calculated SP as the final amount in your API request.


Example Implementation

Here's how you can calculate SP and integrate it into the PayMongo API request:

Step 1: Calculate

def calculate_pass_on_fee(op, fixed_fee, mdr):
    return round((op + fixed_fee) / (1 - mdr), 2)

# Example for Card Payments
payment_method = "card"
fees = {"card": {"mdr": 0.035, "fixed": 15}}

op = 3000
sp = calculate_pass_on_fee(op, fees[payment_method]["fixed"], fees[payment_method]["mdr"])
function calculatePassOnFee(op, fixedFee, mdr) {
    return (op + fixedFee) / (1 - mdr);
}

// Example for Card Payments
const paymentMethod = "card";
const fees = { card: { mdr: 0.035, fixed: 15 } };

const op = 3000;
const sp = calculatePassOnFee(op, fees[paymentMethod].fixed, fees[paymentMethod].mdr);
function calculatePassOnFee($op, $fixedFee, $mdr) {
    return round(($op + $fixedFee) / (1 - $mdr), 2);
}

// Example for Card Payments
$paymentMethod = "card";
$fees = ["card" => ["mdr" => 0.035, "fixed" => 15]];

$op = 3000;
$sp = calculatePassOnFee($op, $fees[$paymentMethod]["fixed"], $fees[$paymentMethod]["mdr"]);

Step 2: Send Payment Request with Updated SP

{
  "data": {
    "attributes": {
      "amount": 312435,  // Updated SP in centavos
      "payment_method_allowed": [
        "card"
      ],
      "payment_method_options": {
        "card": {
          "request_three_d_secure": "any"
        }
      },
      "currency": "PHP",
      "capture_type": "automatic"
    }
  }
}
{
  "data": {
    "attributes": {
      "send_email_receipt": false,
      "show_description": true,
      "show_line_items": true,
      "description": "test",
      "line_items": [
        {
          "currency": "PHP",
          "amount": 300000,
          "name": "Item",
          "quantity": 1
        },
        {
          "currency": "PHP",
          "amount": 12435,
          "name": "Pass On Fee",
          "quantity": 1
        }
      ],
      "payment_method_types": [
        "card"
      ]
    }
  }
}

👍

Key Notes

  • Amount Values: All amounts should be in centavos (PHP multiplied by 100).
  • For both Checkout API and PIPM workflow, only one payment method should be added under "payment_method_types". This ensures the correct MDR is applied. You can change it as needed, but always keep it to a single method.
  • Line Items Breakdown: In the Checkout API, the Pass On Fee is shown as a separate line item alongside the original price (OP). This allows customers to see a breakdown of the total cost, including the processing fee.