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

shopier

v1.0.4

Published

Shopier Payment API Gateway for Node.js

Readme

Shopier Node.js

Shopier ödeme sistemi için Node.js/TypeScript kütüphanesi.

Kurulum

npm install shopier

Kullanım

CommonJS

const { 
  Shopier, 
  Buyer, 
  Address, 
  ProductType, 
  WebsiteIndex,
  ShopierButtonRenderer 
} = require('shopier');

// Shopier instance oluştur
const shopier = new Shopier('API_KEY', 'API_SECRET');

// Alıcı bilgilerini oluştur
const buyer = new Buyer({
  id: '101',
  name: 'Ahmet',
  surname: 'Yılmaz',
  email: '[email protected]',
  phone: '5551234567',
});

// Adres bilgilerini oluştur
const address = new Address({
  address: 'Atatürk Caddesi No: 123',
  city: 'İstanbul',
  country: 'Türkiye',
  postcode: '34000',
});

// Parametreleri ayarla
const params = shopier.getParams();
params.setWebsiteIndex(WebsiteIndex.SITE_1);
params.setBuyer(buyer);
params.setAddress(address);
params.setOrderData('ORDER-12345', '150.00');
params.setProductData('Premium Üyelik', ProductType.DOWNLOADABLE_VIRTUAL);

// HTML çıktısını al
const renderer = new ShopierButtonRenderer(shopier);
const html = shopier.goWith(renderer);

ES Modules / TypeScript

import { 
  Shopier, 
  Buyer, 
  Address, 
  ProductType, 
  WebsiteIndex,
  ShopierButtonRenderer 
} from 'shopier';

### Express.js ile Kullanım

```typescript
import express from 'express';
import { Shopier, ShopierResponse, Buyer, Address } from 'shopier';

const app = express();
app.use(express.urlencoded({ extended: true }));

// Ödeme sayfası
app.get('/payment', (req, res) => {
  const shopier = new Shopier('API_KEY', 'API_SECRET');
  
  // ... parametreleri ayarla
  
  const html = shopier.go();
  res.send(html);
});

// Callback endpoint
app.post('/payment/callback', (req, res) => {
  const response = ShopierResponse.fromPostData(req.body);
  
  if (response.hasValidSignature('API_SECRET')) {
    // Ödeme başarılı
    console.log('Sipariş ID:', response.getPlatformOrderId());
  } else {
    // Geçersiz imza
    res.status(400).send('Invalid signature');
  }
});

Renderer Tipleri

ShopierButtonRenderer

Shopier temalı buton ile ödeme formu.

const renderer = new ShopierButtonRenderer(shopier);
renderer.setName('Öde'); // Buton metnini değiştir

AutoSubmitFormRenderer

Sayfa yüklendiğinde otomatik olarak ödeme sayfasına yönlendirir.

const renderer = new AutoSubmitFormRenderer(shopier);

IframeRenderer

Ödeme formunu iframe içinde gösterir.

const renderer = new IframeRenderer(shopier);
renderer.setWidth(600).setHeight(750).setCenter(true);

FormRenderer

Basit form render'ı.

const renderer = new FormRenderer(shopier);

Para Birimleri

import { Currency } from 'shopier';

params.setCurrency(Currency.TL);   // Türk Lirası
params.setCurrency(Currency.USD);  // Amerikan Doları
params.setCurrency(Currency.EUR);  // Euro

Dil Seçenekleri

import { Language } from 'shopier';

params.setCurrentLanguage(Language.TR);  // Türkçe
params.setCurrentLanguage(Language.EN);  // İngilizce

Ürün Tipleri

import { ProductType } from 'shopier';

params.setProductData('Ürün', ProductType.REAL);                 // Fiziksel ürün
params.setProductData('Ürün', ProductType.DOWNLOADABLE_VIRTUAL); // Dijital ürün
params.setProductData('Ürün', ProductType.DEFAULT_TYPE);         // Varsayılan

API Referansı

Shopier

| Metod | Açıklama | |-------|----------| | getParams() | ShopierParams instance'ını döndürür | | go() | Otomatik submit HTML'i döndürür | | goWith(renderer) | Renderer ile HTML döndürür | | validateResponse(data) | Yanıt imzasını doğrular | | calculateSignature() | İmzayı hesaplar |

ShopierParams

| Metod | Açıklama | |-------|----------| | setBuyer(buyer) | Alıcı bilgilerini ayarlar | | setAddress(address) | Hem fatura hem kargo adresini ayarlar | | setBillingAddress(address) | Fatura adresini ayarlar | | setShippingAddress(address) | Kargo adresini ayarlar | | setOrderData(orderId, total, callback?) | Sipariş bilgilerini ayarlar | | setProductData(name, type?) | Ürün bilgilerini ayarlar | | setCurrency(currency) | Para birimini ayarlar | | setCurrentLanguage(language) | Dili ayarlar | | setWebsiteIndex(index) | Website indexini ayarlar |

ShopierResponse

| Metod | Açıklama | |-------|----------| | fromPostData(data) | POST verisinden instance oluşturur | | hasValidSignature(secret) | İmzayı doğrular | | isSuccess() | Ödeme başarılı mı? | | getPlatformOrderId() | Sipariş ID'sini döndürür | | getPaymentId() | Ödeme ID'sini döndürür | | getInstallment() | Taksit sayısını döndürür |

Lisans

MIT