Back to Documentation

Interactive Testing Guide

Welcome to the hands-on Sir Chargly testing guide! This page lets you interact with the API in real-time using test customers and see live responses.

Test Scenario 1: Standard Fee Calculation

The most common scenario - calculating a convenience fee for a standard transaction in Texas (no restrictions).

Loading...

What to expect:

  • ✅ Fee will be calculated at 2.9% + $0.30
  • compliance.passed will be true
  • ✅ Total = Base Amount + Fee

Test Scenario 2: Blocked Region

What happens when you try to calculate a fee in a region where convenience fees are not permitted?

Loading...

What to expect:

  • ❌ Fee will be $0.00
  • ⚠️ compliance.passed will be false
  • ⚠️ compliance.warnings will explain why

Test Scenario 3: Card Type Restrictions

California allows convenience fees on credit cards but NOT debit cards. Try both!

Credit Card (Allowed):

Loading...

Debit Card (Blocked):

Loading...

What to expect:

  • Credit: ✅ Fee applied, compliance passes
  • Debit: ❌ $0 fee, compliance fails with warning

Test Scenario 4: Fee Adjusted by Regulation

Colorado has a 2% maximum fee cap. Even though the merchant's rate is 2.9%, the fee is capped.

Loading...

What to expect:

  • ✅ Fee capped at 2.0% + $0.30 (not the full 2.9%)
  • compliance.passed is still true
  • ℹ️ fee.appliedRules shows which rules were applied

Create a Real Charge

Now that you've calculated fees, let's create an actual charge with a convenience fee!

Loading...

What happens:

  1. Sir Chargly calculates the fee based on the customer's location
  2. Creates a Stripe charge for (base amount + fee)
  3. Records the fee breakdown for reporting
  4. Returns the charge details

Complete Workflow Example

Here's how your integration would work in production:

Step 1: Show Estimate to Customer

Before charging, always show the customer what they'll pay:

Loading...

Step 2: Create the Charge

Once the customer confirms, create the charge:

Loading...

Testing Checklist

Use these scenarios to verify your integration:

  • ✅ Standard fee calculation works
  • ✅ Blocked regions return $0 fee with warning
  • ✅ Card type restrictions are enforced
  • ✅ Regional caps are applied correctly
  • ✅ Error messages are clear and actionable
  • ✅ Your UI shows fee breakdowns clearly
  • ✅ Customers can see the total before confirming

Need Help?