-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,454 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.0.40 | ||
2.0.41 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ | |
"scripts": { | ||
"test": "vendor/bin/phpunit --colors" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
require_once("config.php"); | ||
|
||
$request = new \Iyzipay\Request\Iyzilink\IyziLinkSaveProductRequest(); | ||
$request->setLocale(\Iyzipay\Model\Locale::TR); | ||
$request->setConversationId(uniqid()); | ||
$request->setName("Sample Integration"); | ||
$request->setDescription("Sample Integration"); | ||
$imagePath = __DIR__ . '/images/sample_image.jpg'; | ||
$request->setBase64EncodedImage(\Iyzipay\Base64FileHelper::encode($imagePath)); | ||
$request->setPrice(1); | ||
$request->setCurrency(\Iyzipay\Model\Currency::TL); | ||
$request->setAddressIgnorable(false); | ||
$request->setSoldLimit(1); | ||
$request->setInstallmentRequest(false); | ||
$response = \Iyzipay\Model\Iyzilink\IyziLinkSaveProduct::create($request, Config::options()); | ||
|
||
print_r($response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once('config.php'); | ||
$request = new \Iyzipay\Request(); | ||
$request->setLocale(\Iyzipay\Model\Locale::TR); | ||
$request->setConversationId("123456789"); | ||
|
||
$response = \Iyzipay\Model\Iyzilink\IyziLinkDeleteProduct::create($request, Config::options(),'AAVbeQ'); | ||
|
||
print_r($response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
require_once('config.php'); | ||
|
||
$request = new \Iyzipay\Request\Iyzilink\IyziLinkRetriveAllPagininRequest(); | ||
$request->setLocale(\Iyzipay\Model\Locale::TR); | ||
$request->setConversationId(uniqid()); | ||
$request->setPage(1); | ||
$request->setCount(2); | ||
$response = \Iyzipay\Model\Iyzilink\IyziLinkRetriveAllProduct::create($request, Config::options()); | ||
|
||
print_r($response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once('config.php'); | ||
|
||
$request = new \Iyzipay\Request(); | ||
$request->setLocale(\Iyzipay\Model\Locale::TR); | ||
$request->setConversationId("123456789"); | ||
$response = \Iyzipay\Model\Iyzilink\IyziLinkRetriveProduct::create($request, Config::options(),'AAVZSw'); | ||
|
||
print_r($response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
require_once('config.php'); | ||
|
||
$request = new \Iyzipay\Request\Iyzilink\IyziLinkSaveProductRequest(); | ||
$request->setLocale(\Iyzipay\Model\Locale::TR); | ||
$request->setConversationId(uniqid()); | ||
$request->setName("Sample Integration"); | ||
$request->setDescription("Sample Integration"); | ||
$imagePath = __DIR__ . '/images/sample_image.jpg'; | ||
$request->setBase64EncodedImage(\Iyzipay\Base64FileHelper::encode($imagePath)); | ||
$request->setPrice(2); | ||
$request->setCurrency(\Iyzipay\Model\Currency::TL); | ||
$request->setAddressIgnorable(false); | ||
$request->setSoldLimit(1); | ||
$request->setInstallmentRequest(false); | ||
$response = \Iyzipay\Model\Iyzilink\IyziLinkUpdateProduct::create($request, Config::options(),'AAVdlw'); | ||
|
||
print_r($response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Iyzipay; | ||
|
||
class Base64FileHelper | ||
{ | ||
public static function encode($filePath) | ||
{ | ||
|
||
$imageBinary = fread(fopen($filePath, "r"), filesize($filePath)); | ||
$base64Binary = base64_encode($imageBinary); | ||
|
||
return $base64Binary; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Iyzipay; | ||
|
||
class IyziAuthV2Generator | ||
{ | ||
public static function generateAuthContent($uri, $apiKey, $secretKey, $randomString, Request $request = null) | ||
{ | ||
$hashStr = "apiKey:" . $apiKey . "&randomKey:" . $randomString ."&signature:" . self::getHmacSHA256Signature($uri, $secretKey, $randomString, $request); | ||
|
||
$hashStr = base64_encode($hashStr); | ||
|
||
return $hashStr; | ||
} | ||
|
||
public static function getHmacSHA256Signature($uri, $secretKey, $randomString, Request $request = null) | ||
{ | ||
$dataToEncrypt = $randomString . self::getPayload($uri, $request); | ||
|
||
$hash = hash_hmac('sha256', $dataToEncrypt, $secretKey, true); | ||
$token = bin2hex($hash); | ||
|
||
return $token; | ||
} | ||
|
||
public static function getPayload($uri, Request $request = null) | ||
{ | ||
|
||
$startNumber = strpos($uri, '/v2'); | ||
$endNumber = strpos($uri, '?'); | ||
$endNumber-= $startNumber; | ||
|
||
$uriPath = substr($uri, $startNumber, $endNumber); | ||
|
||
if (!empty($request) && $request->toJsonString() != '[]') | ||
$uriPath = $uriPath.$request->toJsonString(); | ||
|
||
return $uriPath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\Model\Mapper\Iyzilink\IyziLinkDeleteProductMapper; | ||
use Iyzipay\Options; | ||
use Iyzipay\Request; | ||
use Iyzipay\RequestStringBuilder; | ||
|
||
|
||
class IyziLinkDeleteProduct extends IyziLinkDeleteProductResource | ||
{ | ||
public static function create(Request $request, Options $options, $token) | ||
{ | ||
$uri = $options->getBaseUrl() . "/v2/iyzilink/products/" . $token . RequestStringBuilder::requestToStringQuery($request, null); | ||
$rawResult = parent::httpClient()->delete($uri, parent::getHttpHeadersV2($uri, null, $options)); | ||
return IyziLinkDeleteProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkDeleteProduct(new IyziLinkDeleteProduct()); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Iyzipay/Model/Iyzilink/IyziLinkDeleteProductResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\IyzipayResource; | ||
|
||
class IyziLinkDeleteProductResource extends IyzipayResource | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\Model\Mapper\Iyzilink\IyziLinkRetriveAllProductMapper; | ||
use Iyzipay\Options; | ||
use Iyzipay\Request\Iyzilink\IyziLinkRetriveAllPagininRequest; | ||
use Iyzipay\RequestStringBuilder; | ||
|
||
class IyziLinkRetriveAllProduct extends IyziLinkRetriveAllProductResource | ||
{ | ||
public static function create(IyziLinkRetriveAllPagininRequest $request, Options $options) | ||
{ | ||
$uri = $options->getBaseUrl() . "/v2/iyzilink/products" . RequestStringBuilder::requestToStringQuery($request, 'pages'); | ||
$rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); | ||
return IyziLinkRetriveAllProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkRetriveAllProduct(new IyziLinkRetriveAllProduct()); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/Iyzipay/Model/Iyzilink/IyziLinkRetriveAllProductResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\IyzipayResource; | ||
|
||
class IyziLinkRetriveAllProductResource extends IyzipayResource | ||
{ | ||
private $listingReviewed; | ||
private $totalCount; | ||
private $currentPage; | ||
private $pageCount; | ||
private $items; | ||
|
||
public function getListingReviewed() | ||
{ | ||
return $this->listingReviewed; | ||
} | ||
|
||
public function setListingReviewed($listingReviewed) | ||
{ | ||
$this->listingReviewed = $listingReviewed; | ||
} | ||
|
||
public function getTotalCount() | ||
{ | ||
return $this->totalCount; | ||
} | ||
|
||
public function setTotalCount($totalCount) | ||
{ | ||
$this->totalCount = $totalCount; | ||
} | ||
|
||
public function getCurrentPage() | ||
{ | ||
return $this->currentPage; | ||
} | ||
|
||
public function setCurrentPage($currentPage) | ||
{ | ||
$this->currentPage = $currentPage; | ||
} | ||
|
||
public function getPageCount() | ||
{ | ||
return $this->pageCount; | ||
} | ||
|
||
public function setPageCount($pageCount) | ||
{ | ||
$this->pageCount = $pageCount; | ||
} | ||
|
||
public function getItems() | ||
{ | ||
return $this->items; | ||
} | ||
|
||
public function setItems($items) | ||
{ | ||
$this->items = $items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\Model\Mapper\Iyzilink\IyziLinkRetriveProductMapper; | ||
use Iyzipay\Options; | ||
use Iyzipay\Request; | ||
use Iyzipay\RequestStringBuilder; | ||
|
||
class IyziLinkRetriveProduct extends IyziLinkRetriveProductResource | ||
{ | ||
public static function create(Request $request, Options $options, $token) | ||
{ | ||
$uri = $options->getBaseUrl() . "/v2/iyzilink/products/" . $token. RequestStringBuilder::requestToStringQuery($request, null); | ||
$rawResult = parent::httpClient()->getV2($uri, parent::getHttpHeadersV2($uri, null, $options)); | ||
return IyziLinkRetriveProductMapper::create($rawResult)->jsonDecode()->mapIyziLinkRetriveProduct(new IyziLinkRetriveProduct()); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Iyzipay/Model/Iyzilink/IyziLinkRetriveProductResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Iyzilink; | ||
|
||
use Iyzipay\IyzipayResource; | ||
|
||
class IyziLinkRetriveProductResource extends IyzipayResource | ||
{ | ||
private $item; | ||
|
||
public function getItem() | ||
{ | ||
return $this->item; | ||
} | ||
|
||
public function setItem($item) | ||
{ | ||
$this->item = $item; | ||
} | ||
} |
Oops, something went wrong.