Ejemplo n.º 1
0
 /**
  * getQueryResult()
  * @see fpiapi/gateways/FpiapiGateway::getQueryResult()
  */
 public function getQueryResult()
 {
     $params =& $_REQUEST;
     if (!isset($params['NET_VERSION'])) {
         return null;
     }
     $fields = array($params['NET_VERSION'], $params['NET_SELLER_ID'], $params['NET_RESPCODE'], $params['NET_STAMP'], $params['NET_REF'], $params['NET_DATE'], $params['NET_AMOUNT'], $params['NET_CUR'], $params['NET_PAID'], $this->configuration['privateKey']);
     $fields = $this->filterEmptyFields($fields);
     //print_r($fields);
     $mac = implode('&', $fields) . '&';
     $mac = strtoupper(md5($mac));
     if ($mac != $params['NET_RETURN_MAC']) {
         throw new FpiapiException("MAC mismatch", FPIAPI_EXCEPTION_MAC_ERROR);
     }
     switch ($params['NET_RESPCODE']) {
         case 'NOTFOUND':
             throw new FpiapiException("Payment not found", FPIAPI_EXCEPTION_NOT_FOUND);
         case 'ERROR':
             throw new FpiapiException("Error", FPIAPI_EXCEPTION_ERROR);
     }
     $qr = new QueryResult();
     $qr->setSum($params['NET_AMOUNT']);
     $qr->setUid($params['NET_STAMP']);
     $qr->setReferenceNumber($params['NET_REF']);
     $qr->setDueDate($params['NET_DATE']);
     return $t;
 }
Ejemplo n.º 2
0
 /**
  * getQueryResult()
  * @see fpiapi/gateways/FpiapiGateway::getQueryResult()
  */
 public function getQueryResult()
 {
     $params =& $_REQUEST;
     $fields = array(isset($params["SOLOPMT_VERSION"]) ? $params["SOLOPMT_VERSION"] : NULL, isset($params["SOLOPMT_TIMESTMP"]) ? $params["SOLOPMT_TIMESTMP"] : NULL, isset($params["SOLOPMT_RCV_ID"]) ? $params["SOLOPMT_RCV_ID"] : NULL, isset($params["SOLOPMT_RESPCODE"]) ? $params["SOLOPMT_RESPCODE"] : NULL, isset($params["SOLOPMT_STAMP"]) ? $params["SOLOPMT_STAMP"] : NULL, isset($params["SOLOPMT_REF"]) ? $params["SOLOPMT_REF"] : NULL, isset($params["SOLOPMT_KEYVERS"]) ? $params["SOLOPMT_KEYVERS"] : NULL, isset($params["SOLOPMT_ALG"]) ? $params["SOLOPMT_ALG"] : NULL);
     $fields = $this->filterEmptyFields($fields);
     $mac = implode('&', $fields) . "&" . $this->configuration['privateKey'] . "&";
     $mac = strtoupper(md5($mac));
     if (!isset($params['SOLOPMT_MAC']) || $mac != $params['SOLOPMT_MAC']) {
         throw new FpiapiException("MAC mismatch", FPIAPI_EXCEPTION_MAC_ERROR);
     }
     switch ($params['SOLOPMT_RESPCODE']) {
         case 'Notfound':
             throw new FpiapiException("Payment not found", FPIAPI_EXCEPTION_NOT_FOUND);
         case 'Error':
             throw new FpiapiException("Error", FPIAPI_EXCEPTION_ERROR);
     }
     $qr = new QueryResult();
     $qr->setSum($params['SOLOPMT_AMOUNT']);
     $qr->setUid($params['SOLOPMT_STAMP']);
     $qr->setReferenceNumber($params['SOLOPMT_REF']);
     $qr->setDueDate($params['SOLOPMT_DATE']);
     return $qr;
 }
Ejemplo n.º 3
0
 /**
  * getQueryResult()
  * @see fpiapi/gateways/FpiapiGateway::getQueryResult()
  */
 public function getQueryResult()
 {
     $params =& $_REQUEST;
     if (!isset($params['VERSIO'])) {
         return null;
     }
     $fields = array(isset($params['VERSIO']) ? $params['VERSIO'] : NULL, isset($params['MYYJA']) ? $params['MYYJA'] : NULL, isset($params['KYSELYTUNNUS']) ? $params['KYSELYTUNNUS'] : NULL, isset($params['VASTAUSKOODI']) ? $params['VASTAUSKOODI'] : NULL, isset($params['MAKSUTUNNUS']) ? $params['MAKSUTUNNUS'] : NULL, isset($params['VIITE']) ? $params['VIITE'] : NULL, isset($params['SUMMA']) ? $params['SUMMA'] : NULL, isset($params['VALUUTTALAJI']) ? $params['VALUUTTALAJI'] : NULL, isset($params['ARKISTOINTITUNNUS']) ? $params['ARKISTOINTITUNNUS'] : NULL, isset($params['TARKISTE-VERSIO']) ? $params['TARKISTE-VERSIO'] : NULL, $this->configuration['privateKey']);
     $fields = $this->filterEmptyFields($fields);
     $mac = implode('', $fields);
     $mac = strtoupper(md5($mac));
     if (!isset($params['TARKISTE']) || $mac != $params['TARKISTE']) {
         throw new FpiapiException("MAC mismatch", FPIAPI_EXCEPTION_MAC_ERROR);
     }
     switch (isset($params['VASTAUSKOODI']) ? $params['VASTAUSKOODI'] : NULL) {
         case '0000':
             break;
         case '0001':
             throw new FpiapiException("Payment not found", FPIAPI_EXCEPTION_NOT_FOUND);
         default:
             throw new FpiapiException("Error", FPIAPI_EXCEPTION_ERROR);
     }
     $qr = new QueryResult();
     $qr->setSum($params['SUMMA']);
     $qr->setUid($params['KYSELYTUNNUS']);
     $qr->setReferenceNumber($params['MAKSUTUNNUS']);
     return $t;
 }