/**
  * Testing signature generator for authorization announce
  */
 public function testAuthorizationAnnounceSignatureGenerator()
 {
     $data = array('method' => 'authorization-announce', 'pgw_shop_id' => 12345, 'pgw_order_id' => 'order-123', 'pgw_amount' => 195000, 'pgw_authorization_type' => 0, 'pgw_announcement_duration' => '');
     $this->assertEquals('991b82487c5540001a33accd47d9de0023f4c6d0a7ccb0884ec96d6c0609a4625ee5203d358903386247b3ac40a888b66bf248250a3fc4bb21634857e4229795', SignatureGenerator::generateSignatureFromArray('secretkey', $data));
     $data['pgw_announcement_duration'] = 30;
     $this->assertEquals('b6d71c301489d5584ec9e4ec63634ade433a9ad24a09a94874f117f39049307f3c85517e754c1202609479cf803565ab77c7c41078527928e76605fb5286a9e0', SignatureGenerator::generateSignatureFromArray('secretkey', $data));
 }
Пример #2
0
 /**
  * @param int    $pgwAmount
  * @param string $pgwCardNumber
  * @return array
  */
 public function installments($pgwAmount, $pgwCardNumber)
 {
     $data = array('method' => 'installments', 'pgw_shop_id' => $this->shopId, 'pgw_amount' => $pgwAmount, 'pgw_card_number' => $pgwCardNumber);
     $data['pgw_signature'] = SignatureGenerator::generateSignatureFromArray($this->secretKey, $data);
     return $this->doRequest($data);
 }
Пример #3
0
 /**
  * @param array $pgwResponse
  * @return bool
  */
 public function isPgwResponseValid($pgwResponse)
 {
     return $pgwResponse['pgw_signature'] == SignatureGenerator::generateSignatureFromArray($this->secretKey, $pgwResponse);
 }