Hey developers ![]()
We’re sharing a sample Node.js Maya Checkout integration… BUT something isn’t quite right.
The implementation looks mostly correct, yet the Checkout request still fails unexpectedly.
Your mission: Find what’s wrong in the implementation
- Debug the integration
- Identify up to 5 subtle bugs
- Explain what’s wrong and how you would fix it
This challenge is designed to simulate real-world integration debugging where everything looks correct… until it isn’t.
Starter Code
.env
MAYA_CHECKOUT_URL=https://pg-sandbox.paymaya.com/checkout/v1/checkouts
MAYA_PUBLIC_API_KEY=pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah
REDIRECT_URL=http://localhost:3000/checkout/success
app.ts
import fetch from "node-fetch"
import dotenv from "dotenv"
import { v4 as uuidv4 } from "uuid"
dotenv.config()
const MAYA_CHECKOUT_URL = process.env.MAYA_CHECKOUT_URL
const PUB_KEY = process.env.MAYA_PUBLIC_API_KEY
const SEC_KEY = process.env.MAYA_SECRET_API_KEY
export const createCheckout = async (cart, buyer) => {
const requestReferenceNumber = uuidv4()
// Generate auth token
const authToken = Buffer
.from(`${PUB_KEY}:${SEC_KEY}`, "base64")
.toString("utf8")
const payload = {
totalAmount: {
currency: "PHP",
value: cart.total
},
items: cart.items.map(item => ({
name: item.name,
quantity: item.qty,
amount: {
value: item.price
}
})),
buyer: {
firstName: buyer.firstName,
lastName: buyer.lastName,
contact: {
email: buyer.email
}
},
redirectUrl: process.env.REDIRECT_URL,
requestReferenceNumber
}
const response = await fetch(`${MAYA_CHECKOUT_URL}/checkouts`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${authToken}`,
"X-Request-Id": requestReferenceNumber
},
body: JSON.stringify(payload)
})
return response.json()
}
Challenge Mechanics
- There are multiple hidden bugs in the implementation.
- To keep the discussion collaborative, each developer may only claim and explain ONE bug per reply/comment.
- Before posting, check if another developer has already identified the same issue
- If your bug was already mentioned, try:
- finding another hidden issue
- challenging the proposed fix
- or suggesting a different/improved approach to solving it
- Bonus points for:
- explaining why the issue happens
- suggesting production-ready fixes
- identifying edge cases or long-term risks
- sharing debugging techniques or tooling used
This isn’t just about spotting bugs, it’s also about discussing how different developers approach integration problems in real-world scenarios
What to Reply
Reply with:
- Bugs you found
- Why they’re problematic
- How to fix them
- (Optional) improved working implementation
Community Goal
Let’s see how different developers approach debugging the same integration.