Example #1
0
 public function validate($response)
 {
     if ($response->getReferrer() !== self::$validReferrer) {
         throw new Exceptions\InvalidReferrerException();
     }
     $sig = Signature::generateSignature($this->merchantKey, $response->getMerchantCode(), $response->getPaymentId(), $response->getRefNo(), preg_replace('/[\\.\\,]/', '', $response->getAmount()), $response->getCurrency(), $response->getStatus());
     if ($response->getSignature() !== $sig) {
         throw new Exceptions\InvalidSignatureException();
     }
     return true;
 }