One API for all payment
gateways
better-payment unifies İyzico, PayTR, and Parampos under a single, type-safe API. Stop rewriting payment logic — write it once, use it everywhere.
Everything you need
Designed to be framework-agnostic and production-ready from day one.
Unified API
One consistent interface across all payment providers. Switch providers without rewriting your integration logic.
Full TypeScript
Complete type definitions out of the box. Catch payment errors at compile time, not in production.
Minimal Footprint
Only requires axios as a dependency. Keep your bundle lean and your dependency tree clean.
Secure by Default
API key and secret key encryption built in. 3D Secure support across all providers from day one.
Recurring Payments
Built-in subscription and recurring payment support. Handle installment inquiries with ease.
Multiple Methods
Standard card, 3D Secure, EFT/IBAN transfer, hosted checkout, and installment options.
Supported providers
Leading Turkish payment gateways, all unified under one API.
İyzico
Turkey's leading payment gateway with extensive feature support.
- V2 Authorization
- Checkout Form
- Subscription Payments
- Installment Inquiry
- 3D Secure
PayTR
PopularFast and reliable payment processing with competitive rates.
- Card Payments
- 3D Secure
- Hosted Checkout
- Installments
- IBAN Transfer
Parampos
Enterprise-grade payment solution with SOAP API and advanced features.
- SOAP API
- 3D Secure
- Installments
- Refund & Cancellation
- Direct API
Up and running in minutes
Three steps to integrate any payment provider.
Install the package
npm install better-paymentConfigure your providers
import { BetterPayment } from "better-payment";
const payment = new BetterPayment({
defaultProvider: "iyzico",
providers: {
iyzico: {
enabled: true,
apiKey: process.env.IYZICO_API_KEY!,
secretKey: process.env.IYZICO_SECRET_KEY!,
baseUrl: "https://sandbox-api.iyzipay.com",
},
paytr: {
enabled: true,
merchantId: process.env.PAYTR_MERCHANT_ID!,
merchantKey: process.env.PAYTR_MERCHANT_KEY!,
merchantSalt: process.env.PAYTR_MERCHANT_SALT!,
},
},
});
export default payment;Create your first payment
import payment from "@/lib/payment";
// Uses the default provider (iyzico)
const result = await payment.createPayment({
price: "100.00",
currency: "TRY",
buyer: {
id: "user-123",
name: "John",
surname: "Doe",
email: "john@example.com",
identityNumber: "11111111111",
ip: "85.34.78.112",
},
basketItems: [
{
id: "item-1",
name: "Premium Plan",
price: "100.00",
category: "Subscription",
},
],
billingAddress: {
contactName: "John Doe",
city: "Istanbul",
country: "Turkey",
address: "Nispetiye Cd. Akmerkez B Blok",
},
});
// Or switch provider on the fly
const result2 = await payment.use("paytr").createPayment({ ... });Ready to simplify payments?
Join developers who stopped duplicating payment logic across providers.