Hello,
I'm trying to display information, but its not displaying. Can someone help me figure this one out? I know its not a good idea to display information, but I'm doing this because it will help me understand how this SDK works.
Thanks
require_once 'anet_php_sdk/AuthorizeNet.php'; define("AUTHORIZENET_API_LOGIN_ID", "LOGIN_ID"); define("AUTHORIZENET_TRANSACTION_KEY", "TRANSACTION_KEY"); $request = new AuthorizeNetCIM; // Create new customer profile //echo $_SESSION['user_id']; $customerProfile = new AuthorizeNetCustomer; $customerProfile->description = "Description of customer"; $customerProfile->merchantCustomerId= time(); $customerProfile->email = "test@domain.com"; $customerProfile->cardNumber = '4111111111111111'; $customerProfile->expirationDate = "2021-04"; //$customerProfile->cardCode = $cvv; $response = $request->createCustomerProfile($customerProfile); if ($response->isOk()) { $customerProfileId = $response->getCustomerProfileId(); echo $customerProfileId; } $customerProfileId = $response->getCustomerProfileId(); echo $customerProfileId;
Solved! Go to Solution.
07-20-2011 08:02 PM
The way you add a payment profile is wrong.
define('AUTHORIZENET_API_LOGIN_ID', 'LOGIN_ID'); define('AUTHORIZENET_TRANSACTION_KEY', 'TRANSACTION_KEY'); // Let's create a payment profile first. $paymentProfile = new AuthorizeNetPaymentProfile(); $creditCard = $paymentProfile->payment->creditCard; $creditCard->cardNumber = '4111111111111111'; $creditCard->expirationDate = '2021-04'; //$creditCard->cardCode = $cvv; // Customer profile comes next. $customerProfile = new AuthorizeNetCustomer(); $customerProfile->description = 'Description of customer'; $customerProfile->merchantCustomerId = time(); $customerProfile->email = 'test@domain.com'; $customerProfile->paymentProfiles[] = $paymentProfile; // Off it goes. $request = new AuthorizeNetCIM(); $response = $request->createCustomerProfile($customerProfile); if($response->isOk()) { $customerProfileId = $response->getCustomerProfileId(); echo $customerProfileId; } else { echo $response->getErrorMessage(); }
07-22-2011 01:21 AM
anyone have CIM experience?
Thanks
07-21-2011 07:02 PM
The way you add a payment profile is wrong.
define('AUTHORIZENET_API_LOGIN_ID', 'LOGIN_ID'); define('AUTHORIZENET_TRANSACTION_KEY', 'TRANSACTION_KEY'); // Let's create a payment profile first. $paymentProfile = new AuthorizeNetPaymentProfile(); $creditCard = $paymentProfile->payment->creditCard; $creditCard->cardNumber = '4111111111111111'; $creditCard->expirationDate = '2021-04'; //$creditCard->cardCode = $cvv; // Customer profile comes next. $customerProfile = new AuthorizeNetCustomer(); $customerProfile->description = 'Description of customer'; $customerProfile->merchantCustomerId = time(); $customerProfile->email = 'test@domain.com'; $customerProfile->paymentProfiles[] = $paymentProfile; // Off it goes. $request = new AuthorizeNetCIM(); $response = $request->createCustomerProfile($customerProfile); if($response->isOk()) { $customerProfileId = $response->getCustomerProfileId(); echo $customerProfileId; } else { echo $response->getErrorMessage(); }
07-22-2011 01:21 AM
Amazing! Thank you!
07-23-2011 10:14 AM
So essentially, I can just call out that profileId and get those credit card information and Display it to the user?
07-23-2011 10:35 AM