function testVerifyInvalidSignatureTest123() { $postData = $this->schemaNotification('transaction_notification.json'); $postData['unique_id'] = '130319cfb3bf65ff3c4a4045487b173e'; $postData['signature'] = 'wrongabed996788efcc049567809484454ee8b17'; $tn = new TransactionNotification($postData); $apiPassword = '******'; $tn->verify($apiPassword); $this->assertFalse($tn->isVerified()); }
/** * @param array $params simply pass $_POST into * @return Hypercharge\TransactionNotification * @throws Hypercharge\Errors\ArgumentError if $params empty or merchant password not set with Config::set() */ static function notification($params) { $tn = new TransactionNotification($params); $passw = Config::getPassword(); if (empty($passw)) { throw new Errors\ArgumentError('password is not configured! See Hypercharge\\Config::set()'); } $tn->verify($passw); return $tn; }