I added a new custom attribute for Customer using below code.
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "stripe_customer_id", array(
"type" => "varchar",
"backend" => "",
"label" => "Stripe ID",
"input" => "text",
"source" => "",
"visible" => true,
"required" => false,
"default" => "",
"frontend" => "",
"unique" => false,
));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "stripe_customer_id");
$setup->addAttributeToGroup(
$entityTypeId, $attributeSetId, $attributeGroupId, 'stripe_customer_id', '999' //sort_order
);
$used_in_forms = array();
$used_in_forms[] = "adminhtml_customer";
$attribute->setData("used_in_forms", $used_in_forms)
->setData("is_used_for_customer_segment", true)
->setData("is_system", 0)
->setData("is_user_defined", 1)
->setData("is_visible", 1)
->setData("sort_order", 100)
;
$attribute->save();
$installer->endSetup();
I can see the new attribute field in Magento admin.

Now when I try to update the custom attribute on checkout using below code
$order = $payment->getOrder();
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->setStripeCustomerId('887475748');
try {
$customer->save();
print('Saved: '.$customer->getStripeCustomerId());
} catch (Exception $ex) {
Mage::throwException($ex->getMessage());
}
Above code prints 'Saved: 887475748' and never throws any exception. That means the customer is saving without any error, but when I see the info on admin panel there is nothing in the field.
Note: I refreshed Magento cache several time, flushed cache storage and flushed Magento cache, but no success.
Can someone please help me if I'm missing something here?
var/cachedirectory. Sometimes Magento's DDL cache stays behind, and when Magento saves the model, it doesn't "know" about the new attribute. Also, make sure that your customer is a valid customer before saving (check$customer->getId()after loading it).