I understand that this is above and beyond, but if you can offer any help, it would be greatly appreciated.
Can you offer any insight in getting this code to work. Thank You, thank you, thank you.
// MY CIM TEST
private function createCustomerPaymentProfile($customerProfileId, $paymentProfile, $validationMode = "none"){
$customerProfileId = self::get_cim(self::get_local_api_settings($config));
$paymentProfile = self::get_cim(self::get_local_api_settings($config));
$customerProfileId = new AuthorizeNetCustomer;
$customerProfileId->description = $form_data["form_title"];
$customerProfileId->merchantCustomerId = $form_data["email"];
$customerProfileId->email = $form_data["email"];
$paymentProfile->card_num = $form_data["card_number"];
$exp_date = str_pad($form_data["expiration_date"][0], 2, "0", STR_PAD_LEFT) . "-" . $form_data["expiration_date"][1];
$paymentProfile->exp_date = $exp_date;
$paymentProfile->card_code = $form_data["security_code"];
$paymentProfile->first_name = $form_data["first_name"];
$paymentProfile->last_name = $form_data["last_name"];
$paymentProfile->address = trim($form_data["address1"] . " " . $form_data["address2"]);
$paymentProfile->city = $form_data["city"];
$paymentProfile->state = $form_data["state"];
$paymentProfile->zip = $form_data["zip"];
$paymentProfile->country = $form_data["country"];
$paymentProfile->email = $form_data["email"];
$customerProfileId->paymentProfiles[] = $paymentProfile;
$request = new AuthorizeNetCIM;
$response = $request->createCustomerProfile($customerProfileId);
foreach($form_data["line_items"] as $line_item)
$paymentProfile->addLineItem($line_item["item_id"], self::truncate($line_item["item_name"], 31), self::truncate($line_item["item_description"], 255), $line_item["item_quantity"], GFCommon::to_number($line_item["item_unit_price"]), $line_item["item_taxable"]);
foreach($form_data["line_items"] as $line_item)
$customerProfileId->addLineItem($line_item["item_id"], self::truncate($line_item["item_name"], 31), self::truncate($line_item["item_description"], 255), $line_item["item_quantity"], GFCommon::to_number($line_item["item_unit_price"]), $line_item["item_taxable"]);
return $transaction;
}
// END OF CIM TEST
Posted 11 years ago on Friday June 14, 2013 |
Permalink