2

I have a site that I need to import Authorize.net CIM tokens into. Specifically the authnetcim_profile_id and the authnetcim_payment_profile_id. I have had a very hard time figure out how to get these tokens into magento but I was able to find an attribute attached to customers called authnetcim_profile_id. So I have successfully imported all of the profile ids with the following.

$row = 0;
while (($values = fgetcsv($handle, 1000, ",")) !== FALSE) {
    if ($row != 0){

        $customer = Mage::getModel("customer/customer")->getCollection()
            ->addAttributeToSelect('*')
            ->addFieldToFilter(array(
                array('attribute'=>'oldSystemId','eq'=>$values[0]),
            ))
            ->getFirstItem();

        $customer->setData('authnetcim_profile_id', $values[49]);
        $customer->save();
    }
    $row++;
}

However, when I click on a customer I know I have imported a profile id for, a box shows up and says "Missing or invalid token". I was unable to find anyway to import the payment profile id.

So my questions are:

  1. Is the lack of payment profile ids causing the tokens to appear as invalid?
  2. Does anyone know how I can get the payment profile id into magento and how to set it as default for its related profile?
  3. Does anyone have any other advice about transferring Auth.net CIM creds from one system to another?

Notes:

  1. I am using my own authorize.net API Login ID and Transaction Key for the sandbox as opposed to using the API Login ID and Transaction Key that was being used when these tokens were generated. Could this be part of the problem?
  2. I have tried this for the payment profile id and it did not fare well.

    $customer->setData('authnetcim_payment_profile_id', $values[50]);
    $customer->save();
    
Cœur
  • 37,241
  • 25
  • 195
  • 267
Nick
  • 21
  • 4

0 Answers0