- Home
- Skills
- APIs & Backend
- Paid Right: PayFast Signatures and ITN Checks
More screenshots
Works with the AI Agents you already use
Paid Right: PayFast Signatures and ITN Checks
Find out why PayFast rejects your signatures or why paying customers never get upgraded. Covers all three signing rules, the full ITN checks and checkout blocks, with a script that tests a signature offline.
$9
Paid Right: PayFast Signatures and ITN Checks
Example session with this skill installed
Please review this PayFast ITN handler before we go live, and list what must change.
app.post('/itn', async (req, res) => {
const ip = req.headers['x-forwarded-for'].split(',')[0];
if (!VALID_IPS.includes(ip)) return res.status(400).send('bad ip');
if (!verifySignature(req.body)) return res.status(400).send('bad sig');
if (Math.abs(+req.body.amount_gross - plan.price) > 0.01) return res.status(400).send('bad amount');
await upgradeAccount(req.body.custom_str1);
res.send('ok');
});
- Read your context and instructions
- Compiled the paid right
Result
Not ready to go live. This handler has nine problems, and the first three are the most serious:
- A cancelled payment still upgrades the account.
- Nothing confirms the payment with PayFast's server.
- Anyone can fake the source IP this code checks.
The other six are a hardcoded IP list that goes stale, a response code that makes PayFast keep re-sending, no protection against crediting twice, an amount check that passes on bad input, a failure path that leaves the request hanging, and a test request the handler would mishandle.
What the answer covers
The fix for each problem, the signature rules your verifySignature has to follow, and the one test to run before launch.
The skill gives your agent each fix.
Connects securely to your tools. The creator never sees your data.
About this skill
PayFast uses three different signing rules. Getting one right tells you nothing about the others, and applying the payment rule everywhere can block every real payment.
| Scheme | Blank fields | Order | Passphrase |
|---|---|---|---|
| Payment request | Omit | Documented order | Last |
| ITN | Keep | As received | Last |
| API | Omit | Alphabetical | Sorted in |
Your agent will
- Review your ITN handler for all five checks, including
payment_statusand the serverVALIDcall - Find checkout buttons blocked by CSP
- Replace hardcoded PayFast IPs with the published hostnames
- Run a bundled script that tests a signature offline and names the mistake behind a mismatch
How it was tested
The script's hashes match a working production PayFast integration on the same inputs, and the rules were checked against PayFast's developer documentation. Nothing in this skill makes a payment.
Some test behaviours, such as HTTP 500 when you pay yourself, come from one integration and are marked that way.
Make one real low-value payment before going live. No offline check replaces it.
Code samples are short. The rules apply to any language.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 8 days ago
Requires
Permissions
File Scopes
The script reads local files only and makes no network calls. It never prints the passphrase.