GithubHelp home page GithubHelp logo

garantipos's Introduction

GarantiPos

Garanti Bankası sanal pos entegrasyonu için kullanımı kolay PHP sınıfı.
Kartlı ödeme ve GarantiPay ile ödeme için kullanılabilir.

Örnek pos konfigürasyonu

<?php 
//Sipariş ve ödeme bilgilerini buraya gireceksiniz
$paymentType = "garantipay"; //Kredi kartı için: "creditcard", GarantiPay için: "garantipay"
$params      = [
    'companyName'      => "XXXXX", //Firmanızın adı
    'orderNo'          => uniqid(), //Her sipariş için oluşturulan benzersiz sipariş numarası
    'amount'           => "1.20", //Sipariş toplam tutarı, örnek format: 1234 TL için 1234.00 şeklinde girilmelidir
    'installmentCount' => "", //Taksit sayısı, taksit olmayacaksa boş bırakılabilir
    'currencyCode'     => "949", //Ödenecek tutarın döviz cinsinden kodu: TRY=949, USD=840, EUR=978, GBP=826, JPY=392
    'customerIP'       => "127.0.0.1", //Satınalan müşterinin IP adresi
    'customerEmail'    => "[email protected]", //Satınalan müşterinin e-mail adresi
];


//Sadece kredi kartı ile ödeme yapıldığında kart bilgileri alınıyor
if($paymentType=="creditcard"){
    $params['cardName']         = "XXX XXX"; //(opsiyonel) Kart üzerindeki ad soyad
    $params['cardNumber']       = "XXXXXXXXXXXXXXXX"; //Kart numarası, girilen kart numarası Garanti TEST kartıdır
    $params['cardExpiredMonth'] = "XX"; //Kart geçerlilik tarihi ay
    $params['cardExpiredYear']  = "XX"; //Kart geçerlilik tarihi yıl
    $params['cardCvv']          = "XXX"; //Kartın arka yüzündeki son 3 numara(CVV kodu)
}

require_once("GarantiPos.php");
$garantiPos = new GarantiPos($params);

$garantiPos->debugUrlUse                = false; //true/false
$garantiPos->mode                       = "TEST"; //Test ortamı "TEST", gerçek ortam için "PROD"
$garantiPos->terminalMerchantID         = "XXXXX"; //Üye işyeri numarası
$garantiPos->terminalID                 = "XXXXX"; //Terminal numarası
$garantiPos->terminalID_                = "0".$garantiPos->terminalID; //Başına 0 eklenerek 9 digite tamamlanmalıdır
$garantiPos->provUserID                 = "PROVAUT"; //Terminal prov kullanıcı adı
$garantiPos->provUserPassword           = "XXXXX"; //Terminal prov kullanıcı şifresi
$garantiPos->garantiPayProvUserID       = "PROVOOS"; //(GarantiPay kullanılmayacaksa boş bırakılabilir) GarantiPay için prov kullanıcı adı
$garantiPos->garantiPayProvUserPassword = "XXXXX"; //(GarantiPay kullanılmayacaksa boş bırakabilir) GarantiPay için prov kullanıcı şifresi
$garantiPos->storeKey                   = "XXXXX"; //24byte hex 3D secure anahtarı
$garantiPos->successUrl                 = "https://127.0.0.1/garantipos/example.php?action=success"; //3D başarıyla sonuçlandığında provizyon çekmek için yönlendirilecek adres
$garantiPos->errorUrl                   = "https://127.0.0.1/garantipos/example.php?action=error"; //3D başarısız olduğunda yönlenecek sayfa
?>

Örnek kullanım

Yukarıdaki konfigürasyon yapıldıktan sonra

<?php
$action = isset($_GET['action']) ? $_GET['action'] : false;
if($action){
    $garantiPos->debugMode = false;

    $result = $garantiPos->callback($action, $paymentType);
    if($result=="success"){
        echo "başarılı ödeme";
        unset($_SESSION['orderNumber']); //sipariş başarıyla tamamlandığı durumda session siliniyor
    }
    else{
        echo $result['message'];
    }
}
else{
    $garantiPos->debugMode = false;

    $garantiPos->pay($paymentType); //bankaya yönlendirme yapılıyor
}
?>

garantipos's People

Contributors

bsevgin 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.