-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from sudiptpa/fix/adding-emv-3dsc
Added EMV 3DSC
- Loading branch information
Showing
8 changed files
with
161 additions
and
15 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
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,20 @@ | ||
<?php | ||
|
||
namespace Omnipay\NABTransact\Enums; | ||
|
||
class TransactionType | ||
{ | ||
const NORMAL_PAYMENT = 0; | ||
const NORMAL_PREAUTH = 1; | ||
|
||
const PAYMENT_RISK_MANAGEMENT = 2; | ||
const PREAUTH_RISK_MANAGEMENT = 3; | ||
|
||
const PAYMENT_3DS_EMV3DS = 4; | ||
const PREAUTH_3DS_EMV3DS = 5; | ||
|
||
const PAYMENT_RISK_MANAGEMENT_3DS_EMV3DS = 6; | ||
const PREAUTH_RISK_MANAGEMENT_3DS_EMV3DS = 7; | ||
|
||
const STORE_ONLY = 8; | ||
} |
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,50 @@ | ||
<?php | ||
|
||
namespace Omnipay\NABTransact\Message; | ||
|
||
class DirectPostWebhookRequest extends DirectPostAbstractRequest | ||
{ | ||
private $data = []; | ||
|
||
public function __construct($data = []) | ||
{ | ||
$this->data = $data; | ||
} | ||
|
||
public function generateResponseFingerprint($data) | ||
{ | ||
$hashable = [ | ||
$data['merchant'], | ||
$data['txn_password'], | ||
$data['refid'], | ||
$data['amount'], | ||
$data['timestamp'], | ||
$data['summarycode'], | ||
]; | ||
|
||
$hash = implode('|', $hashable); | ||
|
||
return hash_hmac('sha256', $hash, $data['txn_password']); | ||
} | ||
|
||
public function vefiyFingerPrint($fingerprint) | ||
{ | ||
$data = $this->data; | ||
|
||
if ($fingerprint !== $this->generateResponseFingerprint($data)) { | ||
$data['restext'] = $data['restext'].', Invalid fingerprint.'; | ||
$data['summarycode'] = 3; | ||
} | ||
|
||
return new DirectPostCompletePurchaseResponse($this, $data); | ||
} | ||
|
||
public function getData() | ||
{ | ||
return $this->data; | ||
} | ||
|
||
public function sendData($data) | ||
{ | ||
} | ||
} |
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