Hi:
I am trying to create an eCheck process using PHP.
I have the system running fine in the Sandbox when I only input Routing Number, Account Number, Bank Name, Name on Account, and Payment Amount. However, I would like the user to be able to enter Name, Company Name, Address, etc.
I have been scouring the PHP API code and have found that "Company" is an attribute of the NameAndAddressType class. But I can't figure out what class the attribute "NameAndAddressType" belongs to. Ive tried "billTo", "shipTo", etc and I can't get this working. What am I missing? my current code looks like this:
// Create the payment data for a Bank Account $bankAccount = new AnetAPI\BankAccountType(); $bankAccount->setAccountType('CHECKING'); $bankAccount->setEcheckType('WEB'); $bankAccount->setRoutingNumber($routing_num); $bankAccount->setAccountNumber($account_num); $bankAccount->setNameOnAccount($name_on_account); $bankAccount->setBankName($bank_name); $paymentBank= new AnetAPI\PaymentType(); $paymentBank->setBankAccount($bankAccount); //create a debit card Bank transaction $NameAndAddress = new AnetAPI\NameAndAddressType(); $NameAndAddress->setCompany("Company Name"); $paymentBillTo = new AnetAPI\billTo(); $paymentBillTo->setBillTo($NameAndAddress); $transactionRequestType = new AnetAPI\TransactionRequestType(); $transactionRequestType->setTransactionType( "authCaptureTransaction"); $transactionRequestType->setAmount($amount); $transactionRequestType->setPayment($paymentBank); $transactionRequestType->setBillTo($NameAndAddress); $request = new AnetAPI\CreateTransactionRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId( $refId); $request->setTransactionRequest($transactionRequestType); //$request->setCustomerDetails($customerDetails); $controller = new AnetController\CreateTransactionController($request); $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
07-19-2016 03:32 AM
Hello @SeanF
It looks like this is missing from the PHP sample code. I would suggest opening a ticket on GitHub and inquire about adding this to the sample so others could benefit. This will notify our developers to take a look.
Richard
07-19-2016 11:57 AM