-
Notifications
You must be signed in to change notification settings - Fork 106
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
mustapayev
committed
Dec 28, 2024
1 parent
9152706
commit 89e038d
Showing
36 changed files
with
1,924 additions
and
1 deletion.
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
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,22 @@ | ||
<?php | ||
|
||
use Mews\Pos\PosInterface; | ||
|
||
require '../_payment_config.php'; | ||
|
||
$baseUrl = $bankTestsUrl.'/3d-host/'; | ||
//account bilgileri kendi account bilgilerinizle degistiriniz | ||
$account = \Mews\Pos\Factory\AccountFactory::createAkbankPosAccount( | ||
'akbank-pos', | ||
'2023090417500272654BD9A49CF07574', | ||
'2023090417500284633D137A249DBBEB', | ||
'3230323330393034313735303032363031353172675f357637355f3273387373745f7233725f73323333383737335f323272383774767276327672323531355f', | ||
PosInterface::LANG_TR | ||
); | ||
|
||
$pos = getGateway($account, $eventDispatcher); | ||
|
||
$transaction = PosInterface::TX_TYPE_PAY_AUTH; | ||
|
||
$templateTitle = '3D Host Model Payment'; | ||
$paymentModel = PosInterface::MODEL_3D_HOST; |
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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d-host/index.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,3 @@ | ||
<?php | ||
|
||
require '../../_templates/_payment_secure_response.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,22 @@ | ||
<?php | ||
|
||
use Mews\Pos\PosInterface; | ||
|
||
require '../_payment_config.php'; | ||
|
||
$baseUrl = $bankTestsUrl.'/3d-pay/'; | ||
//account bilgileri kendi account bilgilerinizle degistiriniz | ||
$account = \Mews\Pos\Factory\AccountFactory::createAkbankPosAccount( | ||
'akbank-pos', | ||
'2023090417500272654BD9A49CF07574', | ||
'2023090417500284633D137A249DBBEB', | ||
'3230323330393034313735303032363031353172675f357637355f3273387373745f7233725f73323333383737335f323272383774767276327672323531355f', | ||
PosInterface::LANG_TR | ||
); | ||
|
||
$pos = getGateway($account, $eventDispatcher); | ||
|
||
$transaction = $session->get('tx', PosInterface::TX_TYPE_PAY_AUTH); | ||
|
||
$templateTitle = '3D Pay Model Payment'; | ||
$paymentModel = PosInterface::MODEL_3D_PAY; |
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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d/form.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d/index.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,3 @@ | ||
<?php | ||
|
||
require '../../_templates/_payment_secure_response.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,22 @@ | ||
<?php | ||
|
||
use Mews\Pos\PosInterface; | ||
|
||
require '../_payment_config.php'; | ||
|
||
$baseUrl = $bankTestsUrl.'/3d/'; | ||
//account bilgileri kendi account bilgilerinizle degistiriniz | ||
$account = \Mews\Pos\Factory\AccountFactory::createParamPosAccount( | ||
'param-pos', | ||
10738, | ||
'Test', | ||
'Test', | ||
'0c13d406-873b-403b-9c09-a5766840d98c' | ||
); | ||
|
||
$pos = getGateway($account, $eventDispatcher); | ||
|
||
$transaction = $session->get('tx', PosInterface::TX_TYPE_PAY_AUTH); | ||
|
||
$templateTitle = '3D Model Payment'; | ||
$paymentModel = PosInterface::MODEL_3D_SECURE; |
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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d/form.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d/index.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,3 @@ | ||
<?php | ||
|
||
require '../../_templates/_payment_secure_response.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,17 @@ | ||
<?php | ||
|
||
require __DIR__.'/../_main_config.php'; | ||
|
||
$bankTestsUrl = $hostUrl.'/parampos'; | ||
$posClass = \Mews\Pos\Gateways\ParamPos::class; | ||
|
||
$testCards = [ | ||
'visa1' => [ | ||
// OTP 123456 | ||
'number' => '4446763125813623', | ||
'year' => '26', | ||
'month' => '12', | ||
'cvv' => '000', | ||
'name' => 'John Doe', | ||
], | ||
]; |
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,6 @@ | ||
<?php | ||
|
||
$templateTitle = 'Param POS'; | ||
require './_payment_config.php'; | ||
require '../_templates/_header.php'; | ||
require '../_templates/_footer.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 | ||
|
||
use Mews\Pos\PosInterface; | ||
|
||
require '../_payment_config.php'; | ||
|
||
$baseUrl = $bankTestsUrl.'/regular/'; | ||
//account bilgileri kendi account bilgilerinizle degistiriniz | ||
$account = \Mews\Pos\Factory\AccountFactory::createAkbankPosAccount( | ||
'akbank-pos', | ||
'2023090417500272654BD9A49CF07574', | ||
'2023090417500284633D137A249DBBEB', | ||
'3230323330393034313735303032363031353172675f357637355f3273387373745f7233725f73323333383737335f323272383774767276327672323531355f', | ||
PosInterface::LANG_TR | ||
); | ||
|
||
$pos = getGateway($account, $eventDispatcher); | ||
|
||
$templateTitle = 'Regular Payment'; | ||
$paymentModel = PosInterface::MODEL_NON_SECURE; |
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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/cancel.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,27 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/custom_query.php'; | ||
|
||
function getCustomRequestData(): array | ||
{ | ||
return [ | ||
[ | ||
'txnCode' => '1020', | ||
'order' => [ | ||
'orderTrackId' => 'ae15a6c8-467e-45de-b24c-b98821a42667', | ||
], | ||
'payByLink' => [ | ||
'linkTxnCode' => '3000', | ||
'linkTransferType' => 'SMS', | ||
'mobilePhoneNumber' => '5321234567', | ||
], | ||
'transaction' => [ | ||
'amount' => 1.00, | ||
'currencyCode' => 949, | ||
'motoInd' => 0, | ||
'installCount' => 1, | ||
], | ||
], | ||
null, | ||
]; | ||
} |
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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/form.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/history.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/3d/index.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/order_history.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/post-auth.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,3 @@ | ||
<?php | ||
|
||
require '../../_common-codes/regular/refund.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,84 @@ | ||
<?php | ||
|
||
/** | ||
* @license MIT | ||
*/ | ||
|
||
namespace Mews\Pos\Crypt; | ||
|
||
use Mews\Pos\Entity\Account\AbstractPosAccount; | ||
use Mews\Pos\Exceptions\NotImplementedException; | ||
|
||
class ParamPosCrypt extends AbstractCrypt | ||
{ | ||
/** | ||
* todo remove? | ||
* {@inheritDoc} | ||
*/ | ||
public function create3DHash(AbstractPosAccount $posAccount, array $formInputs): string | ||
{ | ||
$hashData = [ | ||
$formInputs['clientid'], | ||
$formInputs['oid'], | ||
$formInputs['amount'], | ||
$formInputs['okUrl'], | ||
$formInputs['failUrl'], | ||
$formInputs['islemtipi'], | ||
$formInputs['taksit'], | ||
$formInputs['rnd'], | ||
$posAccount->getStoreKey(), | ||
]; | ||
|
||
$hashStr = \implode(static::HASH_SEPARATOR, $hashData); | ||
|
||
return $this->hashString($hashStr); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function check3DHash(AbstractPosAccount $posAccount, array $data): bool | ||
{ | ||
if (null === $posAccount->getStoreKey()) { | ||
throw new \LogicException('Account storeKey eksik!'); | ||
} | ||
|
||
$actualHash = $this->hashFromParams($posAccount->getStoreKey(), $data, 'HASHPARAMS', ':'); | ||
|
||
if ($data['HASH'] === $actualHash) { | ||
$this->logger->debug('hash check is successful'); | ||
|
||
return true; | ||
} | ||
|
||
$this->logger->error('hash check failed', [ | ||
'data' => $data, | ||
'generated_hash' => $actualHash, | ||
'expected_hash' => $data['HASH'], | ||
]); | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function createHash(AbstractPosAccount $posAccount, array $requestData): string | ||
{ | ||
$map = [ | ||
$requestData['G']['CLIENT_CODE'], | ||
$requestData['GUID'], | ||
$requestData['Taksit'] ?? '', | ||
$requestData['Islem_Tutar'], | ||
$requestData['Toplam_Tutar'], | ||
$requestData['Siparis_ID'], | ||
$requestData['Hata_URL'] ?? '', | ||
$requestData['Basarili_URL'] ?? '', | ||
]; | ||
|
||
$hashStr = \implode(static::HASH_SEPARATOR, $map); | ||
$hashStr = mb_convert_encoding($hashStr, 'ISO-8859-9'); | ||
|
||
return $this->hashString($hashStr, self::HASH_ALGORITHM); | ||
} | ||
} |
Oops, something went wrong.