Hi All,
I am using the Advanced Integration Method (*I think*) to send from my checkout form to auth.net which ends up in my inbox at the end as the Merchant Email Receipt.
I am pulling all the order info of course, but I also want to pull email address and phone number. Here's how the integration looks right now and it is working:
transaction = new AuthorizeNetAIM($this->param('apiLogin'), $this->param('apiTransactionKey'));
if(!$this->param('sandbox'))
$transaction->setSandbox(false);
$transaction->amount = $amount;
$transaction->card_num = $this->formWorklet->model->ccnum;
$transaction->card_code = $this->formWorklet->model->cccode;
$transaction->exp_date = $month.'/'.$year;
$transaction->address = $this->formWorklet->model->address;
$transaction->country = $location['country'];
$transaction->state = $location['state'];
$transaction->city = $location['city'];
$transaction->zip = $this->formWorklet->model->zip;
$transaction->first_name = $this->formWorklet->model->firstName;
$transaction->last_name = $this->formWorklet->model->lastName;
I can add fields at the checkout screen for "phone" and "email" but I am unsure of how to pass those through to Auth.net. When I get the Merchant Email Receipt, there are already fields in the email for email and phone but of course they are blank since we're not filling them.
Would it be as simple as adding another $transaction-> line at the bottom for email and then using $this-formWorklet->model->phone to do it? Does it have to be named something specifically (i.e. the bold part of $transaction->last_name = $this->formWorklet->model->lastName;)
Thanks so much in advance!
06-20-2012 02:00 PM
Look at the AIM.markdown file in the doc folder of your SDK, it contains lots of sample code. The short version is that you need to specify phone and email like so:
$transaction->phone = $this->formWorklet->model->phone; $transaction->email = $this->formWorklet->model->email;
I am assuming of course that the phone and email values are in formWorklet->model, which is pretty much implementation-specific stuff and your job to figure out. Yes, the fields should be named phone and email on the Authorize.net side.
06-21-2012 12:22 AM