yasinkuyu/omnipay-paycell-sdk

Turkcell Paycell SDK gateway for Omnipay payment processing library

1.0.6 2025-01-28 14:01 UTC

This package is auto-updated.

Last update: 2025-01-29 10:26:06 UTC


README

Turkcell Paycell SDK gateway for Omnipay payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 8.1.x. This package implements Turkcell Paycell SDK support for Omnipay.

Important Notes

  • Please review Paycell SDK Documentation before starting integration
  • Check "Service Access and General Information" section for critical integration points
  • This package uses RESTful JSON service examples
  • For integration support: paycelldev@paycell.com.tr

Installation

composer require league/omnipay yasinkuyu/omnipay-paycell-sdk

Required additional dependencies:

composer require php-http/curl-client guzzlehttp/psr7 php-http/message

Test Mode

To enable test mode, set the following in your initialization:

$gateway->setTestMode(true); // For test environment
$gateway->setTestMode(false); // For production environment

Test mode uses different endpoints and credentials:

Test Environment Credentials

  • Application name: PAYCELLTEST
  • Application password: PaycellTestPassword
  • Secure code: PAYCELL12345
  • Eulaid: 17
  • Merchant Code: 9998
  • Terminal Code: [Get from Paycell]

Basic Usage

  1. Navigate to example directory:
cd /YOUR-COMPOSER-PATH/vendor/yasinkuyu/omnipay-paycell-sdk/example
  1. Copy init.php.example to init.php

  2. Start test server:

php -S localhost:8000
  1. Open test page in browser: http://localhost:8000/purchase.php

Initialize Gateway

use Omnipay\Omnipay;

$gateway = Omnipay::create('PaycellSDK');
$gateway->setTestMode(true); // Enable test mode
$gateway->setApplicationName('PAYCELLTEST');
$gateway->setApplicationPwd('PaycellTestPassword');
$gateway->setSecureCode('PAYCELL12345');
$gateway->setEulaID(17);
$gateway->setMerchantCode(9998);
$gateway->setTerminalCode('XXXXXXXXX');

Process Purchase

$transactionDateTime = date('YmdHis') . substr(microtime(), 2, 3);

$gateway->setReferenceNumber($transactionDateTime);
$gateway->setHostAccount("customer@email.com");
$gateway->setPaymentSecurity("NON_THREED_SECURE"); // or "THREED_SECURE"
$gateway->setLanguage("tr");

$response = $gateway->purchase([
    'amount' => '10.00',
    'currency' => 'TRY',
])->send();

if ($response->isSuccessful()) {
    echo "Payment successful!";
    // Get tracking URL for redirect
    $trackingUrl = $response->getTrackingUrl();
}

Query Transaction Status

$response = $gateway->query([
    'originalPaymentReferenceNumber' => $paymentReferenceNumber,
])->send();

if ($response->isSuccessful()) {
    echo "Transaction status: " . $response->getMessage();
}

Process Refund

$response = $gateway->refund([
    'amount' => '10.00',
    'currency' => 'TRY',
    'originalPaymentReferenceNumber' => $paymentReferenceNumber,
])->send();

Process Reverse (Cancel)

$response = $gateway->reverse([
    'originalPaymentReferenceNumber' => $paymentReferenceNumber,
])->send();

Supported Methods

  • Purchase (Regular and 3D Secure)
  • Query Transaction Status
  • Refund
  • Reverse (Cancel)

Test Cards

For test credit cards, visit: https://paycell.com.tr/test-kredi-kartlari

System Requirements

  • PHP >= 8.1.0
  • Composer
  • PHP cURL extension

Support

Documentation

For detailed integration information and API documentation, please visit Paycell SDK Documentation.

License

The MIT License (MIT). Please see License File for more information.

Other Omnipay Packages

Here are some other Omnipay payment gateway implementations developed by the same author:

  • Omnipay: NestPay
    NestPay (İş Bankası, Akbank, Finansbank, Denizbank, Kuveyt Türk, Halkbank, Anadolubank, ING Bank, Citibank, Cardplus, Ziraat Bankası, Tekstilbank, Şekerbank, Türk Ekonomi Bankası) gateway for Omnipay payment processing library.

  • Omnipay: Paycell API
    Turkcell Paycell API gateway for Omnipay payment processing library.

  • Omnipay: Iyzico
    Iyzico payment gateway for Omnipay payment processing library.

  • Omnipay: Paratika
    Paratika (Asseco) payment gateway for Omnipay payment processing library.

  • Omnipay: Posnet
    Yapı Kredi Posnet payment gateway for Omnipay payment processing library.

  • Omnipay: GVP
    Garanti Virtual POS (GVP) payment gateway for Omnipay payment processing library.

  • Omnipay: BKM Express
    BKM Express payment gateway for Omnipay payment processing library.

  • Omnipay: PayTR
    PayTR payment gateway for Omnipay payment processing library.

For more information and documentation, visit the respective GitHub repositories.