Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename IyzicoGateway as Gateway to fix omnipay integration #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ composer install
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -96,10 +96,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -135,10 +135,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -169,10 +169,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -204,10 +204,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -238,10 +238,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down Expand Up @@ -272,10 +272,10 @@ try {
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/cancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/completePurchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/installmentInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/purchase3d.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/purchaseInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
$loader = require __DIR__ . '/vendor/autoload.php';
$loader->addPsr4('Examples\\', __DIR__);

use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Examples\Helper;

$gateway = new IyzicoGateway();
$gateway = new Gateway();
$helper = new Helper();

try {
Expand Down
8 changes: 4 additions & 4 deletions src/IyzicoGateway.php → src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @method RequestInterface void(array $options = array())
* @method RequestInterface updateCard(array $options = array())
*/
class IyzicoGateway extends AbstractGateway
class Gateway extends AbstractGateway
{

/**
Expand Down Expand Up @@ -68,17 +68,17 @@ public function getBaseUrl()
return $this->getParameter('baseUrl');
}

public function setApiKey($apiKey): IyzicoGateway
public function setApiKey($apiKey): Gateway
{
return $this->setParameter('apiKey', $apiKey);
}

public function setSecretKey($apiSecret): IyzicoGateway
public function setSecretKey($apiSecret): Gateway
{
return $this->setParameter('secretKey', $apiSecret);
}

public function setBaseUrl($baseUrl): IyzicoGateway
public function setBaseUrl($baseUrl): Gateway
{
return $this->setParameter('baseUrl', $baseUrl);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/IyzicoGatewayTest.php → tests/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
namespace OmnipayTest\Iyzico;

use Omnipay\Common\Message\RequestInterface;
use Omnipay\Iyzico\IyzicoGateway;
use Omnipay\Iyzico\Gateway;
use Omnipay\Iyzico\Messages\AuthorizeRequest;
use Omnipay\Iyzico\Messages\CompletePurchaseRequest;
use Omnipay\Iyzico\Messages\Purchase3dRequest;
use Omnipay\Iyzico\Messages\PurchaseRequest;
use Omnipay\Tests\GatewayTestCase;

class IyzicoGatewayTest extends GatewayTestCase
class GatewayTest extends GatewayTestCase
{
public function setUp(): void
{
$this->gateway = new IyzicoGateway($this->getHttpClient(), $this->getHttpRequest());
$this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest());
}

public function testSupportsPurchase(): void
Expand Down Expand Up @@ -81,4 +81,4 @@ public function testCompletePurchase(): void
self::assertInstanceOf(CompletePurchaseRequest::class, $request);
self::assertSame('12568440', $request->getPaymentId());
}
}
}