/** * Test directDebitCreateACHEFTCustomerCode. */ public function testCustomerLinkdirectDebitCreateACHEFTCustomerCode() { // Test only valid for UK clients. $iats = new CustomerLink(self::$agentCode, self::$password, 'UK'); // Begin date must be more than 12 days from current date. $beginTime = mktime(0, 0, 0, date('n'), date('j') + 13, date('Y')); $endTime = mktime(0, 0, 0, date('n'), date('j'), date('Y') + 10); // Create and populate the request object. $request = array('customerIPAddress' => '', 'customerCode' => '', 'ACHEFTReferenceNum' => 'UDDDA14D86', 'firstName' => 'Test', 'lastName' => 'Account', 'companyName' => 'Test Co.', 'address' => '1234 Any Street', 'city' => 'Schenectady', 'state' => 'NY', 'zipCode' => '12345', 'phone' => '555-555-1234', 'fax' => '555-555-4321', 'alternatePhone' => '555-555-5555', 'email' => '*****@*****.**', 'comment' => 'Direct debit customer code creation test.', 'recurring' => FALSE, 'amount' => '5', 'beginDate' => $iats->getFormattedDate($beginTime), 'endDate' => $iats->getFormattedDate($endTime), 'scheduleType' => 'Annually', 'scheduleDate' => '', 'accountCustomerName' => 'Test Account', 'accountNum' => '999999999', 'accountType' => 'CHECKING'); $response = $iats->directDebitCreateACHEFTCustomerCode($request); // API responded correctly. $this->assertEquals('OK', $response['AUTHORIZATIONRESULT']); self::$directDebitACHEFTCustomerCode = $response['CUSTOMERCODE']; self::$directDebitACHEFTReferenceNum = $response['ACHEFTREFERENCENUM']; }
/** * Test createACHEFTCustomerCode. */ public function testCustomerLinkcreateACHEFTCustomerCode() { $iats = new CustomerLink(self::$agentCode, self::$password, 'NA'); $beginTime = strtotime('+1 day'); $endTime = mktime(0, 0, 0, date('n'), date('j'), date('Y') + 10); // Create and populate the request object. $request = array('customerIPAddress' => '', 'customerCode' => '', 'firstName' => 'Test', 'lastName' => 'Account', 'companyName' => 'Test Co.', 'address' => '1234 Any Street', 'city' => 'Schenectady', 'state' => 'NY', 'zipCode' => '12345', 'phone' => '555-555-1234', 'fax' => '555-555-4321', 'alternatePhone' => '555-555-5555', 'email' => '*****@*****.**', 'comment' => 'Customer code update test.', 'recurring' => FALSE, 'amount' => '5', 'beginDate' => $iats->getFormattedDate($beginTime), 'endDate' => $iats->getFormattedDate($endTime), 'scheduleType' => 'Annually', 'scheduleDate' => '', 'accountCustomerName' => 'Test Account', 'accountNum' => '999999999', 'accountType' => 'Checking'); $response = $iats->createACHEFTCustomerCode($request); $this->assertEquals('OK', $response['AUTHORIZATIONRESULT']); self::$ACHEFTCustomerCode = $response['CUSTOMERCODE']; }