Hello
I had AIM working fine on my site but am now swithing to CIM.
I am processing in steps in which I first create the customer profile with the following.
$request = new AuthorizeNetCIM; // Create new customer profile
$customerProfile = new AuthorizeNetCustomer;
$customerProfile->description = "Guest ID:$GuestIDnum Customer profile for $SiteTITLE";
$customerProfile->merchantCustomerId= $GuestIDnum;
$customerProfile->email = $_POST['x_email'];
$response = $request->createCustomerProfile($customerProfile);
if ($response->isOk()) {
$customerProfileId = $response->getCustomerProfileId();
}
This is working and $customerProfileId is saved to DB user table and to SESSION during this registration process. The next step shows the CC form and I'm processing with this code, but I get the "white screen of death" and can't find where I've gone wrong with this code. Can anyone spot the problem?
$request = new AuthorizeNetCIM;
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->customerType = "individual";
$paymentProfile->payment->creditCard->cardNumber = "{$_POST['x_card_num']}";
$paymentProfile->payment->creditCard->expirationDate = "{$_POST['x_exp_year']}-{$_POST['x_exp_month']}";
$response = $request->createCustomerPaymentProfile($customerProfileId, $paymentProfile);
$this->assertTrue($response->isOk());
$paymentProfileId = $response->getPaymentProfileId();
Thank you for any help.
03-12-2013 02:09 PM
I changed the expiration date section in case it was being handled as MATH. Still No GO.
$expirationDate = "{$_POST['x_exp_year']}"."-"."{$_POST['x_exp_month']}";
// Create customer payment profile
$request = new AuthorizeNetCIM;
$paymentProfile = new AuthorizeNetPaymentProfile;
$paymentProfile->customerType = "individual";
$paymentProfile->payment->creditCard->cardNumber = "{$_POST['x_card_num']}";
$paymentProfile->payment->creditCard->expirationDate = $expirationDate;
$response = $request->createCustomerPaymentProfile($customerProfileId, $paymentProfile);
$this->assertTrue($response->isOk());
$paymentProfileId = $response->getPaymentProfileId();
03-12-2013 02:21 PM
Well after days of fighting with AuthorizeNet.php, I switched to AuthnetXML.class and at least have CIM working. Still need to find out how to apply refund using transaction_id. Have not found that feature in AuthnetXML.class yet. If anyone knows the best way to refund a transaction, please let me know, thanks.
03-13-2013 09:06 PM