Bussing Payment System - SIMPLIFIED Proof of Concept

Overview

Minimal viable product with just the essentials to prove the concept works.


Part 1: Simplified Table Structure (1-2 Tables)

OPTION A: Single Table (Simplest)

Table Name: Bus Registration (bus_registration)

Column NameData TypeRequiredNotes
Registration IDAuto-numberYesPrimary key
Student NameTextYes
Parent NameTextYes
EmailEmailYes
PhonePhoneYes
GradeTextYese.g., “5” or “K”
AmountCurrencyYesDefault: $200 (or whatever fee)
Payment StatusChoiceYesOptions: Pending, Paid, Failed
Stripe Payment IDTextNoStore payment_intent ID
Payment DateDate and TimeNoWhen paid
Created OnDate and TimeYesAuto-populated

That’s it! Everything in one table for POC.


OPTION B: Two Tables (Slightly Better)

Table 1: Bus Registration

Column NameData TypeRequiredNotes
Registration IDAuto-numberYesPrimary key
Student NameTextYes
Parent NameTextYes
EmailEmailYes
PhonePhoneYes
GradeTextYes
AmountCurrencyYesDefault: $200
Payment StatusChoiceYesPending, Paid, Failed
Created OnDate and TimeYesAuto

Table 2: Payment

Column NameData TypeRequiredNotes
Payment IDAuto-numberYesPrimary key
Bus RegistrationLookupYesLink to registration
Stripe Payment IDTextYespayment_intent_xxx
AmountCurrencyYes
StatusChoiceYesPending, Succeeded, Failed
Payment DateDate and TimeNo

Part 2: Simplified Power Automate Flow

Single Flow: Registration + Payment

Trigger: When a Bus Registration record is created

Steps:

  1. Initialize variable: Stripe Secret Key

    • Name: stripeKey
    • Type: String
    • Value: sk_test_YOUR_KEY_HERE (get from Stripe)
  2. Initialize variable: Amount in Cents

    • Name: amountCents
    • Type: Integer
    • Value: mul(triggerOutputs()?['body/cr123_amount'], 100)
    • (Multiplies $200 by 100 = 20000 cents)
  3. HTTP - Create Stripe Payment Intent

    • Method: POST
    • URI: https://api.stripe.com/v1/payment_intents
    • Headers:
      Authorization: Bearer @{variables('stripeKey')}
      Content-Type: application/x-www-form-urlencoded
      
    • Body:
      amount=@{variables('amountCents')}&currency=usd&metadata[registration_id]=@{triggerOutputs()?['body/cr123_busregistrationid']}&metadata[student_name]=@{triggerOutputs()?['body/cr123_studentname']}&automatic_payment_methods[enabled]=true
      
  4. Parse JSON (from Stripe response)

    • Content: body('HTTP')
    • Schema:
      {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "client_secret": {"type": "string"},
          "amount": {"type": "integer"},
          "status": {"type": "string"}
        }
      }
      
  5. Update Bus Registration record

    • Set Stripe Payment ID = body('Parse_JSON')?['id']
  6. Send Email (Office 365 Outlook connector)

    • To: triggerOutputs()?['body/cr123_email']
    • Subject: “Complete Your Bussing Payment”
    • Body:
      <p>Hi @{triggerOutputs()?['body/cr123_parentname']},</p>
      
      <p>Thanks for registering @{triggerOutputs()?['body/cr123_studentname']} for school bussing.</p>
      
      <p>Amount due: $@{triggerOutputs()?['body/cr123_amount']}</p>
      
      <p><a href="https://yourpowerpage.com/payment?session=@{body('Parse_JSON')?['client_secret']}">Click here to pay now</a></p>
      
      <p>Registration ID: @{triggerOutputs()?['body/cr123_busregistrationid']}</p>
      

That’s your core flow!


Part 3: Simple Power Pages Setup

Page 1: Registration Form (5 minutes to build)

  1. In Power Pages, create new page “Bus Registration”
  2. Add a Form component
  3. Connect to Bus Registration table
  4. Show fields: Student Name, Parent Name, Email, Phone, Grade
  5. Set Amount field to hidden with default value ($200)
  6. Set Payment Status to hidden with default value (Pending)
  7. Success redirect: Show thank you message

Page 2: Payment Page (Basic HTML + Stripe)

Create a simple page with this code:

<!DOCTYPE html>
<html>
<head>
  <script src="https://js.stripe.com/v3/"></script>
  <style>
    #payment-form { max-width: 400px; margin: 50px auto; }
    button { background: #5469d4; color: white; padding: 12px 24px; 
             border: none; border-radius: 4px; cursor: pointer; }
  </style>
</head>
<body>
  <div id="payment-form">
    <h2>Complete Payment</h2>
    <div id="payment-element"></div>
    <button id="submit">Pay Now</button>
    <div id="error-message"></div>
  </div>

  <script>
    // Get client_secret from URL parameter
    const urlParams = new URLSearchParams(window.location.search);
    const clientSecret = urlParams.get('session');

    const stripe = Stripe('pk_test_YOUR_PUBLISHABLE_KEY'); // Replace with your key
    
    const options = { clientSecret: clientSecret };
    const elements = stripe.elements(options);
    const paymentElement = elements.create('payment');
    paymentElement.mount('#payment-element');

    document.getElementById('submit').addEventListener('click', async () => {
      const {error} = await stripe.confirmPayment({
        elements,
        confirmParams: {
          return_url: 'https://yoursite.com/confirmation',
        },
      });

      if (error) {
        document.getElementById('error-message').textContent = error.message;
      }
    });
  </script>
</body>
</html>

Part 4: Stripe Webhook (Optional for POC)

Simple webhook to update payment status:

Trigger: When HTTP request is received

Steps:

  1. Parse JSON (webhook body)

  2. Condition: Check event type

    • If body('Parse_JSON')?['type'] equals payment_intent.succeeded
  3. Get Registration

    • Filter: Stripe Payment ID equals body('Parse_JSON')?['data']?['object']?['id']
  4. Update Registration

    • Payment Status = Paid
    • Payment Date = utcNow()
  5. Send confirmation email

    • “Payment received! Your student is registered.”

Part 5: Quick Start Guide

Step 1: Create Table (5 min)

  1. Go to make.powerapps.com
  2. Click “Tables” → “New table”
  3. Name it “Bus Registration”
  4. Add the columns from Option A above

Step 2: Get Stripe Keys (5 min)

  1. Go to stripe.com/test
  2. Sign up (free)
  3. Get test keys:
    • Publishable key: pk_test_…
    • Secret key: sk_test_…

Step 3: Create Power Automate Flow (10 min)

  1. Create new cloud flow
  2. Trigger: When row is added (Bus Registration table)
  3. Copy the steps from Part 2 above
  4. Replace YOUR_KEY_HERE with your sk_test key

Step 4: Create Power Pages Form (5 min)

  1. Create new Power Pages site (or use existing)
  2. Add form connected to Bus Registration table
  3. Publish

Step 5: Test! (2 min)

  1. Submit registration form
  2. Check email for payment link
  3. Use test card: 4242 4242 4242 4242
  4. Verify status updates to “Paid”

Test Cards (Stripe Test Mode)

Use any future expiry date and any 3-digit CVC.


What This POC Proves

✅ Parents can register online ✅ Payment requests are created automatically ✅ Stripe handles secure payment processing ✅ Payment status updates automatically ✅ Confirmation emails are sent ✅ All data stored in Dataverse


When You’re Ready to Expand

After POC is approved, add:


Estimated POC Cost

Total to test: $0 (using trials)


POC Success Metrics

Can you:

If yes to all = POC SUCCESS! ✅


Next Steps After POC

  1. Demo to stakeholders
  2. Get feedback on user experience
  3. Add webhook for real-time updates
  4. Expand to 2-3 table design
  5. Add admin reporting
  6. Switch to production Stripe keys
  7. Go live!

Quick Troubleshooting

Flow doesn’t trigger:

Payment fails:

Email doesn’t send:


Need help with any specific step? Let me know!