/** * Zruseni opakovani plateb * * @param float $paymentSessionId - identifikator platby * @param float $targetGoId - identifikator prijemnce - GoId * @param string $secureKey - kryptovaci klic prideleny GoPay * @throws \Exception */ public static function voidRecurrentPayment($paymentSessionId, $targetGoId, $secureKey) { try { //inicializace WS ini_set("soap.wsdl_cache_enabled", "0"); $go_client = GopayConfig::createSoapClient(); $hash = GopayHelper::hash(GopayHelper::concatPaymentSession((double) $targetGoId, (double) $paymentSessionId, $secureKey)); $sessionEncryptedSignature = GopayHelper::encrypt($hash, $secureKey); $paymentSession = array("targetGoId" => (double) $targetGoId, "paymentSessionId" => (double) $paymentSessionId, "encryptedSignature" => $sessionEncryptedSignature); $paymentResult = $go_client->__call('voidRecurrentPayment', array('sessionInfo' => $paymentSession)); if ($paymentResult->result == GopayHelper::CALL_RESULT_FAILED) { throw new \Exception("void recurrency failed [" . $paymentResult->resultDescription . "]"); } else { if ($paymentResult->result == GopayHelper::CALL_RESULT_ACCEPTED) { //zruseni opakovani platby bylo zarazeno ke zpracovani throw new \Exception(GopayHelper::CALL_RESULT_ACCEPTED); } } //Overeni podpisu GopayHelper::checkPaymentResult($paymentResult->paymentSessionId, $paymentResult->encryptedSignature, $paymentResult->result, $paymentSessionId, $secureKey); } catch (\SoapFault $f) { /* * Chyba v komunikaci s GoPay serverem */ throw new \Exception("SOAP error"); } }