Reply
Highlighted
Contributor
Posts: 15
Registered: ‎03-15-2011

Help with erorr - CIM Transaction using PHP SDK

I am using the sample code from the CIM SDK and getting the following error


Notice: Undefined variable: request
Fatal error: Call to a member function createCustomerProfileTransaction() on a non-object


My code is as follows

// Create Auth & Capture Transaction
$transaction = new AuthorizeNetTransaction;
$transaction->amount = $cost;
$transaction->customerProfileId = $profileId;
$transaction->customerPaymentProfileId = $paymentProfileId;	

$response = $request->createCustomerProfileTransaction("AuthCapture", $transaction);
$transactionResponse = $response->getTransactionResponse();
$CIMrespCode 	= $transactionResponse->response_code;
$CIMrespReason 	= $transactionResponse->response_reason_code;
$CIMrespText 	= $transactionResponse->response_reason_text;
$CIMrespTextDB 	= sanitize($CIMrespText);
$CIMauthType 	= "AUTH_CAPTURE";
$CIMtransId = $transactionResponse->transaction_id;

if ($transactionResponse->approved) {...


What am I missing

Highlighted
Contributor
Posts: 15
Registered: ‎03-15-2011

Re: Help with erorr - CIM Transaction using PHP SDK

Nevermind. I am an idiot... forgot $request = new AuthorizeNetCIM;