Skip to content
Back to skills

Payment Gateway Integration

ASecurity

Integrate 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
ai-agentsrustbackend

Works with

  • cli

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill payment-gateway-integration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Payment Gateway Integration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Payment Gateway Integration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-payment-gateway-integration/badge)](https://www.skillsdirectory.com/skills/karthikrshet-payment-gateway-integration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.