public function testAdvancedAIM() { $auth = new Request(); $auth->amount = "45.00"; // Use eCheck: $auth->setECheck('121042882', '123456789123', 'CHECKING', 'Bank of Earth', 'Jane Doe', 'WEB'); // Set multiple line items: $auth->addLineItem('item1', 'Golf tees', 'Blue tees', '2', '5.00', 'N'); $auth->addLineItem('item2', 'Golf shirt', 'XL', '1', '40.00', 'N'); // Set Invoice Number: $auth->invoice_num = time(); // Set a Merchant Defined Field: $auth->setCustomField("entrance_source", "Search Engine"); // Authorize Only: $response = $auth->authorizeOnly(); $this->assertTrue($response->approved); if ($response->approved) { $auth_code = $response->transaction_id; // Now capture: $capture = new Request(); $capture_response = $capture->priorAuthCapture($auth_code); $this->assertTrue($capture_response->approved); // Now void: $void = new Request(); $void_response = $void->void($capture_response->transaction_id); $this->assertTrue($void_response->approved); } }