FODUBU Payment Flow
How Pi moves from the farmer's wallet to FODUBU — step by step
FODUBU Shared Destination Wallet
This single Stellar wallet receives ALL payments from all three DApps automatically.
Fee Split Example — $50,000 Tractor (GCV Rate)
Why two separate fees?
Pi Foundation (1%): Pi Network Ventures Foundation charges a service fee for using their blockchain and SDK. This is deducted automatically per Pi's terms of service.
FODUBU fee (2%): This covers platform operations, tractor maintenance coordination, satellite monitoring, and branch expansion costs.
Both fees are shown to the farmer BEFORE they approve — full transparency.
Step-by-Step: What Happens When a Farmer Pays
The farmer opens the app inside the Pi Browser on their phone. Pi Browser automatically loads the Pi SDK and knows the farmer's Pi wallet address.
For a product purchase the farmer taps the Pay button. For daily loan deductions the system calls initiatePayment() automatically on the scheduled day. The farmer sees the full fee breakdown BEFORE confirming.
Pi Browser presents its own built-in payment screen showing: amount, memo, and destination app. The farmer taps Approve. This is the CONSENT step — no money moves yet.
Pi Network calls our /api/pi/payment endpoint. The server verifies the paymentId is legitimate, confirms the destination wallet matches GBHOWFFJ...MNJOSC, then calls Pi Network API to approve. Requires PI_API_KEY in your environment variables.
Pi Network executes the Stellar transaction. Funds move from the farmer's wallet to the FODUBU shared wallet on-chain. A transaction ID (txid) is generated as proof.
Pi Network calls /api/pi/payment/complete with the txid. Our server confirms, records the fee split (1% Pi Foundation + 2% FODUBU) to MongoDB, and notifies the unified FODUBU backend so SeTra and FODUBU Main also see the record.
The net Pi (after Pi Network's internal fee handling) lands in wallet GBHOWFFJ...MNJOSC. The 2% FODUBU fee is already tracked in MongoDB for your accounting. You can check your balance on any Stellar explorer using the full wallet address.
Automatic Deductions (Loan Payments)
For daily tractor loan repayments, the system calls initiatePayment() automatically each day.
The Pi Browser will show the farmer a notification asking them to approve the daily amount.
The farmer must approve each deduction inside Pi Browser — Pi Network does NOT allow silent background deductions for user protection.
FODUBU can use A2U (App-to-User) payments for large cooperative accounts once that Pi feature becomes available.
What You Need to Go Fully Live
Get this from the Pi Developer Portal (develop.pi in the Pi Browser). Navigate to your app's dashboard, locate the API Keys / Backend settings section, and generate or copy your secret key. This is strictly required to securely approve and complete payments on your server.
Already set: GBHOWFFJ...MNJOSC — all 3 DApps route here.
Live in code — 1% Pi + 2% FODUBU separated automatically.