npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

esnekpos

v1.0.0

Published

Node.js entegrasyon paketi - EsnekPOS ödeme sistemi için resmi olmayan istemci

Downloads

78

Readme

EsnekPOS Node.js Entegrasyonu

EsnekPOS ödeme sisteminin Node.js uygulamaları için resmi olmayan istemci kütüphanesi. Bu kütüphane ile EsnekPOS API'lerini kolayca kullanabilirsiniz.

Kurulum

npm install esnekpos

Kullanım

İstemci Oluşturma

const esnekpos = require('esnekpos');

const client = esnekpos.createClient({
  merchant: 'MERCHANT_ID',
  merchantKey: 'MERCHANT_KEY',
  testMode: true // Test ortamı için true, gerçek ortam için false
});

3D Ödeme Alma

async function create3DPayment() {
  try {
    const payment = await client.payment.create3DPayment({
      Config: {
        BACK_URL: 'https://example.com/callback',
        PRICES_CURRENCY: 'TRY',
        ORDER_REF_NUMBER: 'ORDER_12345',
        ORDER_AMOUNT: '100.00'
      },
      CreditCard: {
        CC_NUMBER: '4159562885391991',
        EXP_MONTH: '12',
        EXP_YEAR: '2025',
        CC_CVV: '123',
        CC_OWNER: 'John Doe',
        INSTALLMENT_NUMBER: '1'
      },
      Customer: {
        FIRST_NAME: 'John',
        LAST_NAME: 'Doe',
        MAIL: '[email protected]',
        PHONE: '5321234567',
        CITY: 'Istanbul',
        STATE: 'Kadikoy',
        ADDRESS: 'Test Address',
        CLIENT_IP: '127.0.0.1'
      },
      Product: [
        {
          PRODUCT_ID: '1',
          PRODUCT_NAME: 'Test Product',
          PRODUCT_CATEGORY: 'Electronics',
          PRODUCT_DESCRIPTION: 'Test Description',
          PRODUCT_AMOUNT: '100.00'
        }
      ]
    });
    
    console.log('Ödeme başarıyla başlatıldı:', payment);
    // URL_3DS alanıyla müşteriyi 3D doğrulama sayfasına yönlendirin
    return payment;
  } catch (error) {
    console.error('Ödeme başlatma hatası:', error);
    throw error;
  }
}

Ortak Ödeme Sayfası

async function createCommonPayment() {
  try {
    const payment = await client.payment.createCommonPayment({
      Config: {
        ORDER_REF_NUMBER: 'ORDER_12345',
        ORDER_AMOUNT: '100.00',
        PRICES_CURRENCY: 'TRY',
        BACK_URL: 'https://example.com/callback',
        LOCALE: 'tr'
      },
      Customer: {
        FIRST_NAME: 'John',
        LAST_NAME: 'Doe',
        MAIL: '[email protected]',
        PHONE: '5321234567',
        CITY: 'Istanbul',
        STATE: 'Kadikoy',
        ADDRESS: 'Test Address'
      },
      Product: [
        {
          PRODUCT_ID: '1',
          PRODUCT_NAME: 'Test Product',
          PRODUCT_CATEGORY: 'Electronics',
          PRODUCT_DESCRIPTION: 'Test Description',
          PRODUCT_AMOUNT: '100.00'
        }
      ]
    });
    
    console.log('Ödeme sayfası başarıyla oluşturuldu:', payment);
    // URL_3DS alanıyla müşteriyi ödeme sayfasına yönlendirin
    return payment;
  } catch (error) {
    console.error('Ödeme sayfası oluşturma hatası:', error);
    throw error;
  }
}

İşlem Sorgulama

async function queryTransaction(orderRefNumber) {
  try {
    const result = await client.query.queryTransaction(orderRefNumber);
    console.log('İşlem detayları:', result);
    return result;
  } catch (error) {
    console.error('İşlem sorgulama hatası:', error);
    throw error;
  }
}

İade/İptal İşlemi

async function refundTransaction(orderRefNumber, amount) {
  try {
    const result = await client.refund.refundTransaction({
      orderRefNumber,
      amount,
      syncWithPos: true // Banka ile senkron işlem için true
    });
    console.log('İade sonucu:', result);
    return result;
  } catch (error) {
    console.error('İade işlemi hatası:', error);
    throw error;
  }
}

Desteklenen Özellikler

  • 3D Ödeme İşlemleri
  • Ortak Ödeme Sayfası
  • BKM Express Ödemeleri
  • İşlem Sorgulama ve Listeleme
  • İade/İptal İşlemleri
  • Tekrarlı Ödeme İşlemleri
  • Pazaryeri Entegrasyonu (Alt üye işyeri işlemleri)
  • Fiziksel POS İşlemleri

Test Ortamı

Test ortamında geliştirme yapmak için testMode parametresini true olarak ayarlayın ve EsnekPOS tarafından sağlanan test kartlarını kullanın.

Test Kartı

Kart No: 4159562885391991
Son Kullanma: 12/2025
CVV: 123

Lisans

MIT