
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A comprehensive Node.js integration module for PayTR payment gateway. Supports all PayTR payment APIs including iFrame API, Direct API, and Link API.
Türkçe açıklamalar için aşağıya bakın
npm install paytr-node
const PayTR = require('paytr-node');
const paytr = new PayTR({
merchantId: 'YOUR_MERCHANT_ID',
merchantKey: 'YOUR_MERCHANT_KEY',
merchantSalt: 'YOUR_MERCHANT_SALT',
testMode: true // true for test mode, false for live mode
});
const token = await paytr.iframe.createToken({
userIp: '192.168.1.1',
merchantOid: 'ORDER_123',
email: 'customer@example.com',
paymentAmount: '10000', // 100.00 TL = 10000
userName: 'John Doe',
userAddress: 'Customer Address',
userPhone: '05001234567',
merchantOkUrl: 'https://yoursite.com/success',
merchantFailUrl: 'https://yoursite.com/fail',
userBasket: [
['Product 1', '5000', 1], // Product name, price (50.00 TL), quantity
['Product 2', '5000', 1]
]
});
// Use token.token to show the payment page
HTML iframe usage:
<script src="https://www.paytr.com/js/iframeResizer.min.js"></script>
<iframe src="https://www.paytr.com/odeme/guvenli/<?php echo $token['token']; ?>" id="paytriframe" frameborder="0" scrolling="no" style="width:100%;"></iframe>
<script>iFrameResize({}, '#paytriframe');</script>
const result = await paytr.direct.createPayment({
userIp: '192.168.1.1',
merchantOid: 'ORDER_123',
email: 'customer@example.com',
paymentAmount: '10000', // 100.00 TL = 10000
cardOwner: 'John Doe',
cardNumber: '4355084355084358',
cardExpireMonth: '12',
cardExpireYear: '30',
cardCvc: '000',
installmentCount: '0', // Single payment
userName: 'John Doe',
userAddress: 'Customer Address',
userPhone: '05001234567',
merchantOkUrl: 'https://yoursite.com/success',
merchantFailUrl: 'https://yoursite.com/fail',
userBasket: [
['Product 1', '5000', 1],
['Product 2', '5000', 1]
]
});
// Process payment result
const express = require('express');
const bodyParser = require('body-parser');
const PayTR = require('paytr-node');
const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
// PayTR configuration
const paytr = new PayTR({
merchantId: 'YOUR_MERCHANT_ID',
merchantKey: 'YOUR_MERCHANT_KEY',
merchantSalt: 'YOUR_MERCHANT_SALT',
testMode: true
});
// Create payment page
app.post('/create-payment', async (req, res) => {
try {
const merchantOid = `ORDER_${Date.now()}`;
const userIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
const result = await paytr.iframe.createToken({
userIp: userIp,
merchantOid: merchantOid,
email: req.body.email || 'customer@example.com',
paymentAmount: req.body.amount || '10000',
userName: req.body.name || 'John Doe',
userAddress: req.body.address || 'Customer Address',
userPhone: req.body.phone || '05001234567',
merchantOkUrl: `${req.protocol}://${req.get('host')}/success`,
merchantFailUrl: `${req.protocol}://${req.get('host')}/fail`,
userBasket: [
[req.body.productName || 'Product', req.body.amount || '10000', 1]
]
});
res.send(`
<html>
<head>
<title>PayTR Payment</title>
<script src="https://www.paytr.com/js/iframeResizer.min.js"></script>
</head>
<body>
<h1>Payment Page</h1>
<iframe src="https://www.paytr.com/odeme/guvenli/${result.token}" id="paytriframe" frameborder="0" scrolling="no" style="width: 100%;"></iframe>
<script>iFrameResize({}, '#paytriframe');</script>
</body>
</html>
`);
} catch (error) {
res.status(500).send(`Error: ${error.message}`);
}
});
// Payment callback handler
app.post('/payment-callback', (req, res) => {
try {
const isValid = paytr.iframe.validateHash(req.body);
if (isValid) {
const { merchant_oid, status } = req.body;
if (status === 'success') {
console.log(`Order confirmed: ${merchant_oid}`);
// Update order in database
} else {
console.log(`Order rejected: ${merchant_oid}`);
// Cancel order in database
}
res.send('OK');
} else {
res.status(400).send('Invalid hash');
}
} catch (error) {
res.status(500).send('Error');
}
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
For detailed documentation of all features, visit our GitHub repository.
MIT License
PayTR ödeme geçidi için kapsamlı bir Node.js entegrasyon modülüdür. iFrame API, Direct API ve Link API dahil olmak üzere PayTR'nin tüm ödeme API'lerini destekler.
npm install paytr-node
const PayTR = require('paytr-node');
const paytr = new PayTR({
merchantId: 'MERCHANT_ID',
merchantKey: 'MERCHANT_KEY',
merchantSalt: 'MERCHANT_SALT',
testMode: true // Test modu için true, canlı mod için false
});
const token = await paytr.iframe.createToken({
userIp: '192.168.1.1',
merchantOid: 'SIPARIS_123',
email: 'musteri@example.com',
paymentAmount: '10000', // 100.00 TL = 10000
userName: 'Ahmet Yılmaz',
userAddress: 'Müşteri Adresi',
userPhone: '05001234567',
merchantOkUrl: 'https://siteniz.com/basarili',
merchantFailUrl: 'https://siteniz.com/basarisiz',
userBasket: [
['Ürün 1', '5000', 1], // Ürün adı, fiyat (50.00 TL), adet
['Ürün 2', '5000', 1]
]
});
// token.token kullanılarak ödeme sayfası gösterilir
HTML iframe kullanımı:
<script src="https://www.paytr.com/js/iframeResizer.min.js"></script>
<iframe src="https://www.paytr.com/odeme/guvenli/<?php echo $token['token']; ?>" id="paytriframe" frameborder="0" scrolling="no" style="width:100%;"></iframe>
<script>iFrameResize({}, '#paytriframe');</script>
const result = await paytr.direct.createPayment({
userIp: '192.168.1.1',
merchantOid: 'SIPARIS_123',
email: 'musteri@example.com',
paymentAmount: '10000', // 100.00 TL = 10000
cardOwner: 'Ahmet Yılmaz',
cardNumber: '4355084355084358',
cardExpireMonth: '12',
cardExpireYear: '30',
cardCvc: '000',
installmentCount: '0', // Tek çekim
userName: 'Ahmet Yılmaz',
userAddress: 'Müşteri Adresi',
userPhone: '05001234567',
merchantOkUrl: 'https://siteniz.com/basarili',
merchantFailUrl: 'https://siteniz.com/basarisiz',
userBasket: [
['Ürün 1', '5000', 1],
['Ürün 2', '5000', 1]
]
});
// result ile ödeme sonucu işlenir
const express = require('express');
const bodyParser = require('body-parser');
const PayTR = require('paytr-node');
const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
// PayTR yapılandırması
const paytr = new PayTR({
merchantId: 'MERCHANT_ID',
merchantKey: 'MERCHANT_KEY',
merchantSalt: 'MERCHANT_SALT',
testMode: true
});
// Ödeme sayfası oluştur
app.post('/odeme-olustur', async (req, res) => {
try {
const merchantOid = `SIPARIS_${Date.now()}`;
const userIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
const result = await paytr.iframe.createToken({
userIp: userIp,
merchantOid: merchantOid,
email: req.body.email || 'musteri@example.com',
paymentAmount: req.body.tutar || '10000',
userName: req.body.isim || 'Ahmet Yılmaz',
userAddress: req.body.adres || 'Müşteri Adresi',
userPhone: req.body.telefon || '05001234567',
merchantOkUrl: `${req.protocol}://${req.get('host')}/basarili`,
merchantFailUrl: `${req.protocol}://${req.get('host')}/basarisiz`,
userBasket: [
[req.body.urunAdi || 'Ürün', req.body.tutar || '10000', 1]
]
});
res.send(`
<html>
<head>
<title>PayTR Ödeme</title>
<script src="https://www.paytr.com/js/iframeResizer.min.js"></script>
</head>
<body>
<h1>Ödeme Sayfası</h1>
<iframe src="https://www.paytr.com/odeme/guvenli/${result.token}" id="paytriframe" frameborder="0" scrolling="no" style="width: 100%;"></iframe>
<script>iFrameResize({}, '#paytriframe');</script>
</body>
</html>
`);
} catch (error) {
res.status(500).send(`Hata: ${error.message}`);
}
});
// Ödeme bildirimi işleyici
app.post('/odeme-bildirimi', (req, res) => {
try {
const isValid = paytr.iframe.validateHash(req.body);
if (isValid) {
const { merchant_oid, status } = req.body;
if (status === 'success') {
console.log(`Sipariş onaylandı: ${merchant_oid}`);
// Siparişi veritabanında güncelle
} else {
console.log(`Sipariş reddedildi: ${merchant_oid}`);
// Siparişi veritabanında iptal et
}
res.send('OK');
} else {
res.status(400).send('Geçersiz hash');
}
} catch (error) {
res.status(500).send('Hata');
}
});
app.listen(3000, () => {
console.log('Sunucu 3000 portunda çalışıyor');
});
Tüm özelliklerin detaylı dökümentasyonu için GitHub repomuzu ziyaret edin.
MIT Lisansı
FAQs
Node.js integration for PayTR payment gateway
The npm package paytr-node receives a total of 13 weekly downloads. As such, paytr-node popularity was classified as not popular.
We found that paytr-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.