PHP code example of umuttaymaz / paratika-php

1. Go to this page and download the library: Download umuttaymaz/paratika-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

umuttaymaz / paratika-php example snippets



I kullanıcı bilgileri girilir
$account = new \Umuttaymaz\ParatikaPhp\Models\Account(
    '10000000', //Merchant
    '[email protected]', //MerchantUser
    'Pluto321`', //MerchantPassword
    true // testMode
);

//Paratika sınıfı oluşturulur
$paratika = new \Umuttaymaz\ParatikaPhp\Gateway\Paratika($account);

//Kredi Kartı sınıfı oluşturulur
$card = new \Umuttaymaz\ParatikaPhp\Models\Card(
    'Aydonat Aydınlar', //CardHolderName
    '4022774022774026', //CardNumber
    '2030', //CardExpirationYear
    '12', //CardExpirationMonth
    '000' //CardCVV
);

//Müşteri sınıfı oluşturulur
$customer = new \Umuttaymaz\ParatikaPhp\Models\Customer(
    uniqid('Cust-', true), //Customer ID
    'Aydonat Aydınlar', //Customer Name
    '[email protected]', //Customer Email
    '127.0.0.1', //Customer IP
    '+903120000011', //Customer Phone
);

//Sipariş Sınıfı Oluşturulur
$order = new \Umuttaymaz\ParatikaPhp\Models\Order(
    uniqid('MPID-', true), //Order ID
    '1000', //Amount
    'TRY', //Currency
    '1', //Installment
    'https://test.paratika.com.tr/merchant/index.jsp' //returnURL
);

//Sipariş İçerisine Ürünler Eklenir
$order->addOrderItem(
    'T00D3AITCC', //Code
    'Galaxy S8+', //Name
    'The Samsung Galaxy S8 is Android smartphone produced by Samsung Electronics as part of the Samsung Galaxy S series.', //Description
    '1', //Quantity
    '1000' //Amount
);

//Paratika sınıfı içerisinde Order, Card ve Customer sınıfları girilerek hazırlanır
$paratika->prepare('SALE', $order, $card, $customer);

//Redirect edilmesi beklenen değerler geri dönülür
$formData = $paratika->get3DFormData();
bash
composer