Back to skills
SKILL.md
Payment Gateway Integration
ASecurityIntegrate payment gateways (Razorpay, Stripe, PhonePe, Cashfree, PayU) safely: server-side orders, signature verification, webhooks as source of truth.
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added December 2, 2026
Works with
Security analysis
100/100npx -y skills add karthikrshet/saarthi --skill payment-gateway-integration --agent claude-codeAre you the author of Payment Gateway Integration?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/karthikrshet-payment-gateway-integration)---
name: payment-gateway-integration
description: "Integrate payment gateways (Razorpay, Stripe, PhonePe, Cashfree, PayU) safely: server-side orders, signature verification, webhooks as source of truth."
tags: [payments, backend]
---
# Payment Gateway Integration
## When to use
- Checkout, subscriptions, payouts
## Procedure
1. Create orders server-side with integer amounts in paise/cents
2. Pass an idempotency key/receipt
3. Verify signatures server-side
4. Treat webhooks as the source of truth
5. Model payment state as a state machine
6. Reconcile against settlements daily
## Example
```ts
// Razorpay: verify checkout signature (server-side)
const expected = crypto.createHmac('sha256', process.env.RAZORPAY_KEY_SECRET!)
.update(`${orderId}|${paymentId}`).digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) throw new InvalidSignature();
```
## Checklist
- [ ] Keys from env
- [ ] Duplicate webhooks harmless
- [ ] Client success callback never trusted alone
## Anti-patterns
- Floating-point amounts
- Marking orders paid from the browser redirect
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.