Coder Social home page Coder Social logo

fast_paymax's Introduction

Fast Paymax

🎈 Images 🎈

image

🌱 Example Create Link Paymax 🌱

const paymax = require('fast-paymax');

const data = {
    referer: 'localhost', // Referer Domain example.com
    hash: 'xxxx', // Api Hash Anahtarı
    userName: 'xxxx', // Apı User
    password: 'xxxxxxxxxxx', // Api Key
    shopCode: 'xxx', // Api Mağaza Kodu
    productName: 'productName',
    productData: 'productData',
    productType: 'DIJITAL_URUN',
    productsTotalPrice: 21,
    orderPrice: 20.00,
    currency: 'TRY',
    orderId: '20',
    locale: 'locale',
    conversationId: 'DIJITAL_URUN',
    buyerName: 'buyerName',
    buyerSurName: 'buyerSurName',
    buyerGsmNo: 'buyerGsmNo',
    buyerMail: '[email protected]',
    buyerIp: '124.432.423',
    buyerAdress: 'buyerAdress',
    BuyerCountry: 'BuyerCountry',
    BuyerCity: 'BuyerCity',
    buyerDistrict: 'buyerDistrict',
    callbackOkUrl: 'http://localhost/callbackOkUrl',
    callbackFailUrl: 'http://localhost/callbackFailUrl',
};

paymax.createPaymentLink(data, (err, res) => {
    console.log(err, res);
});

🎏 Example Express Fast-Paymax 🎏

const express = require('express');
const app = express();
const paymax = require('fast-paymax');

app.get('/createPaymentLink', (req, res) => {
    const data = {
        referer: 'localhost', // Referer Domain example.com
        hash: 'xxxx', // Api Hash Anahtarı
        userName: 'xxxx', // Apı User
        password: 'xxxxxxxxxxx', // Api Key
        shopCode: 'xxx', // Api Mağaza Kodu
        productName: 'productName',
        productData: 'productData',
        productType: 'DIJITAL_URUN',
        productsTotalPrice: 21,
        orderPrice: 20.00,
        currency: 'TRY',
        orderId: '20',
        locale: 'locale',
        conversationId: 'DIJITAL_URUN',
        buyerName: 'buyerName',
        buyerSurName: 'buyerSurName',
        buyerGsmNo: 'buyerGsmNo',
        buyerMail: '[email protected]',
        buyerIp: '124.432.423',
        buyerAdress: 'buyerAdress',
        BuyerCountry: 'BuyerCountry',
        BuyerCity: 'BuyerCity',
        buyerDistrict: 'buyerDistrict',
        callbackOkUrl: 'http://localhost/callbackOkUrl',
        callbackFailUrl: 'http://localhost/callbackFailUrl',
    };

    paymax.createPaymentLink(data, (response) => {
        //console.log(response);
        if (response.status === 'error') return res.send(response.message);
        res.redirect(response.url);
    });
});

app.get('/callbackOkUrl', (req, res) => {
    res.send('Ödeme Başarılı');
});

app.get('/callbackFailUrl', (req, res) => {
    res.send('Ödeme Başarısız');
});

app.get('/callback', async (req, res) => {
    let data = {
        status: req.body.status,
        paymentStatus: req.body.paymentStatus,
        hash: req.body.hash,
        paymentAmount: req.body.paymentAmount,
        paymentType: req.body.paymentType,
        conversationId: req.body.conversationId,
        orderId: req.body.orderId,
    };

    if (data.status !== 'success') return res.send('Ödeme Başarısız');

    // Veritabanı işlemleri
    res.send('ok');
});


app.listen(80, () => {
    console.log('Server Started');
});

🌘 Example Response Fast-Paymax 🌘

{
  status: 'success',
  data: {
    status: 'success',
    errorMessage: '',
    payment_page_url: 'https://www.vallet.com.tr/payment-center/en/copay/XXXXXXXXX',
    payment_page_url_domestic_card: 'https://www.vallet.com.tr/payment-center/en/copay/XXXXXXXXX/kredi-karti',
    payment_page_url_bank_transfer_card: 'https://www.vallet.com.tr/payment-center/en/copay/XXXXXXXXX/banka-havale',
    payment_page_url_international_card: 'https://www.vallet.com.tr/payment-center/en/copay/XXXXXXXXX/kredi-karti-dunya',
    ValletOrderNumber: '111111111',
    ValletOrderId: '1111111113',
    conversationId: 'DIJITAL_URUN'
  },
  url: 'https://www.vallet.com.tr/payment-center/en/copay/XXXXXXXXX'
}

🛠️ Installation 🛠️

⛳Tech Stack ⛳

🗄️ Server: Node, Axios, form-data, crypto, buffer


🎯 License 🎯

fast_paymax's People

Contributors

fastuptime avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.