/** * Creates a void transaction through the HpsCheckService */ public function execute() { parent::execute(); $voidSvc = new HpsCheckService($this->service->servicesConfig()); return $voidSvc->void($this->transactionId, $this->clientTransactionId); }
/** * Creates an override transaction through the HpsCheckService */ public function execute() { parent::execute(); $saleSvc = new HpsCheckService($this->service->servicesConfig()); return $saleSvc->override($this->check, $this->amount, $this->clientTransactionId); }
$address->zip = $_POST['holder_address_zip']; $holder = new HpsCheckHolder(); $holder->address = $address; $holder->dlNumber = $_POST['holder_dlnumber']; $holder->dlState = $_POST['holder_dlstate']; $holder->firstName = $_POST['holder_firstname']; $holder->lastName = $_POST['holder_lastname']; $holder->phone = $_POST['holder_phone']; $holder->dobYear = $_POST['holder_dobyear']; $holder->ssl4 = $_POST['holder_ssl4']; $check = new HpsCheck(); $check->accountNumber = $_POST['check_accountnumber']; $check->routingNumber = $_POST['check_routingnumber']; $check->checkType = HpsCheckType::PERSONAL; $check->secCode = HpsSECCode::PPD; $check->accountType = HpsAccountType::CHECKING; $check->dataEntryMode = HpsDataEntryMode::MANUAL; $check->checkHolder = $holder; $config = new HpsServicesConfig(); $config->secretApiKey = 'skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A'; $config->versionNumber = '0000'; $config->developerId = '000000'; try { $service = new HpsCheckService($config); $amount = $_POST['payment_amount']; $saleResponse = $service->sale($check, $amount); printf('Success! Transaction ID: %s', $saleResponse->transactionId); } catch (HpsException $e) { printf('Error running check sale: %s', $e->getMessage()); printf('<pre><code>%s</code></pre>', print_r($e, true)); }
public function testEBronzeVerify40SavingsBusiness() { $check = TestCheck::certification(); $check->secCode = HpsSECCode::EBRONZE; $check->checkType = HpsCheckType::BUSINESS; $check->accountType = HpsAccountType::SAVINGS; $checkService = new HpsCheckService(TestServicesConfig::ValidMultiUseConfig()); $response = $checkService->sale($check, 1); $this->assertNotNull($response, 'Response is null'); $this->assertEquals('0', $response->responseCode); $this->assertEquals('Transaction Approved', $response->responseText); }
public function testACHDebitCorporate8SavingsBusiness() { $check = TestCheck::certification(); $check->accountType = 'savings'; $check->checkType = 'business'; $check->secCode = 'ccd'; $checkService = new HpsCheckService(TestServicesConfig::CertServicesConfigWithDescriptor()); $response = $checkService->sale('SALE', $check, 18.0); $this->assertNotNull($response, 'Response is null'); $this->assertEquals('0', $response->responseCode); $this->assertEquals('Transaction Approved', $response->responseText); }