1) Sign in
Sign in with phone (OTP) or anonymous for demo.
2) Send & Receive (QR)
Share this QR so others can scan and pay you.
3) Manual Transfer
No transactions yet
4) USSD Activation (for remote 2G/3G areas)
This section shows how to activate a USSD code with a telco partner. In production you will integrate with the telco USSD gateway / SMPP provider or use a cloud partner. The app provides a backend endpoint that the USSD gateway calls to perform balance checks and transactions.
You must arrange with a network operator (Telikom PNG, Digicel PNG) for a USSD short code and HTTP/S callbacks or an SMPP gateway. See the backend sample in the documentation block below.
Developer Notes
Below is infor that would be called by the telco USSD gateway or by the web app to create a transaction. This is a sample only — secure it, add authentication, rate-limiting and logging in production.
// SAMPLE Firebase Cloud Function (Node.js) - USSD / Transaction endpoint
// exports.ussdHandler = functions.https.onRequest(async (req, res) => {
// // req.body will contain the USSD message parameters from the telco
// const { msisdn, text, sessionId } = req.body;
// // parse text for menu selections and inputs
// // call Firestore to read/update balances
// // respond with next USSD menu or final message
// });
// SAMPLE transaction logic (secure & validate in production)
// async function transfer(fromUid, toUid, amount, note) {
// const db = admin.firestore();
// return db.runTransaction(async t => {
// const fromRef = db.collection('accounts').doc(fromUid);
// const toRef = db.collection('accounts').doc(toUid);
// const fromSnap = await t.get(fromRef);
// const toSnap = await t.get(toRef);
// const fromBal = fromSnap.data().balance || 0;
// if(fromBal < amount) throw new Error('Insufficient funds');
// t.update(fromRef, { balance: fromBal - amount });
// t.update(toRef, { balance: (toSnap.data().balance||0) + amount });
// const txRef = db.collection('transactions').doc();
// t.set(txRef, { fromUid, toUid, amount, note, createdAt: admin.firestore.FieldValue.serverTimestamp() });
// });
// }