public function ajaxValidateSecretApiKey() { $this->includeSecureSubmitSDK(); $config = new HpsServicesConfig(); $config->secretApiKey = rgpost('key'); $config->developerId = '002914'; $config->versionNumber = '1916'; $service = new HpsCreditService($config); $is_valid = true; try { $service->get('1'); } catch (HpsAuthenticationException $e) { $is_valid = false; } catch (HpsException $e) { // Transaction was authenticated, but failed for another reason } $response = $is_valid ? 'valid' : 'invalid'; die($response); }
/** * Creates a get transaction through the HpsCreditService */ public function execute() { parent::execute(); $getSvc = new HpsCreditService($this->service->servicesConfig()); return $getSvc->get($this->transactionId); }