/** * Validates the structure of the request * @param array $notification * @return boolean */ private function isStructureValid($notification) { $isValid = !empty($notification) && isset($notification['event']['event_type']) && isset($notification['event']['event_resource']['transaction']['id']); $this->logging->log('validate structure for request', var_export($isValid, true)); return $isValid; }
/** * Validates the response array given by the create call of a refund object * * @param $refund * * @return bool */ private function _validateRefundResponse($refund) { $loggingManager = new Shopware_Plugins_Frontend_PaymPaymentCreditcard_Components_LoggingManager(); $responseCodeOK = false; if (isset($refund['id']) && isset($refund['response_code'])) { $responseCodeOK = $refund['response_code'] === 20000; } if ($responseCodeOK) { $loggingManager->log("Refund created.", $refund['id']); } else { $loggingManager->log("No Refund created.", var_export($refund, true)); } return $responseCodeOK; }