public function testAuthCaptureSetECheckMethod()
 {
     if (MERCHANT_LIVE_API_LOGIN_ID) {
         // $this->markTestIncomplete('Depends on whether eChecks is enabled');
         $sale = new AuthorizeNetAIM(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);
     }
 }
Exemple #2
0
 //		$donation->test_request
 //		$donation->tran_key
 //		$donation->trans_id
 //		$donation->type
 //		$donation->version
 if ($dep_Type == "CreditCard") {
     $donation->card_num = $creditCard;
     $donation->exp_date = $expMonth . "/" . $expYear;
 } else {
     // check payment info if supplied...
     // Use eCheck:
     $donation->bank_acct_name = $firstName . ' ' . $lastName;
     $donation->bank_acct_num = $account;
     $donation->bank_acct_type = 'CHECKING';
     $donation->bank_name = $bankName;
     $donation->setECheck($route, $account, 'CHECKING', $bankName, $firstName . ' ' . $lastName, 'WEB');
 }
 $response = $donation->authorizeAndCapture();
 if ($response->approved) {
     $transaction_id = $response->transaction_id;
 }
 if ($response->approved) {
     // Push the authorized transaction date forward by the interval
     $sSQL = "UPDATE autopayment_aut SET aut_NextPayDate=DATE_ADD('" . $authDate . "', INTERVAL " . $aut_Interval . " MONTH) WHERE aut_ID = " . $aut_ID . " AND aut_Amount = " . $plg_amount;
     RunQuery($sSQL);
     // Update the serial number in any case, even if this is not the scheduled payment
     $sSQL = "UPDATE autopayment_aut SET aut_Serial=aut_Serial+1 WHERE aut_ID = " . $aut_ID;
     RunQuery($sSQL);
 }
 if (!$response->approved) {
     $response->approved = 0;