コード例 #1
0
 /**
  * @test
  */
 public function SignerVerifierDoesNotThrowExceptionOnSuccess()
 {
     $params = array('sph-testi1' => 'arvo1', 'sph-testi2' => 'arvo2', 'sph-testi3' => 'arvo3', 'sph-testi4' => 'arvo4');
     $signer = new SecureSigner(self::$KEYID, self::$KEY);
     $valid = $signer->createSignature("GET", "", $params, "");
     $this->assertRegExp('/^SPH1 \\w+ [0-9a-z]+/', $valid);
     $params["signature"] = $valid;
     $signer->validateFormRedirect($params);
 }
コード例 #2
0
 /**
  * @param string $uri
  * @param array $sphNameValuePairs
  * @return string formatted signature
  */
 private function createSecureSign($uri, $sphNameValuePairs = array())
 {
     $parsedSphParameters = PaymentHighwayUtility::parseSphParameters($sphNameValuePairs);
     $secureSigner = new SecureSigner($this->signatureKeyId, $this->signatureSecret);
     return $secureSigner->createSignature($this->method, $uri, $parsedSphParameters);
 }