public function testAuthCaptureSetECheckMethod() { if (MERCHANT_LIVE_API_LOGIN_ID) { // $this->markTestIncomplete('Depends on whether eChecks is enabled'); $sale = new Request(MERCHANT_LIVE_API_LOGIN_ID, MERCHANT_LIVE_TRANSACTION_KEY); $sale->setSandbox(false); $sale->test_request = 'TRUE'; $sale->amount = "4.99"; $sale->setECheck('121042882', '123456789123', 'CHECKING', 'Bank of Earth', 'Jane Doe', 'WEB'); $response = $sale->authorizeAndCapture(); $this->assertEquals("ECHECK", $response->method); $this->assertEquals("18", $response->response_reason_code); // $this->assertTrue($response->approved); } }
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); } }