How to update non-property value with entity_metadata_wrapper? I wish to update values in commerce_payment_transaction entity. I am using such code:

&lt;?php
$transaction = commerce_payment_transaction_load(58);
 $digests = array(
'DIGEST' =&gt; '456',
'DIGEST2' =&gt; '478'
);

$transaction_wrapper = entity_metadata_wrapper('commerce_payment_transaction', $transaction);
$transaction_wrapper-&gt;payload-&gt;set($digests);
$transaction_wrapper-&gt;field_my_custom_field-&gt;set(1458);
$transaction_wrapper-&gt;save();


The problem is, that such code throws me error, that payload is not property of commerce_payment_transaction entity. Although "payload" is column in database table of this entity type. But it is not set as property.

When I don't use entity_metadata_wrapper, this code works for me:

&lt;?php
$transaction = commerce_payment_transaction_load(58);
$digests = array(
'DIGEST' =&gt; '456',
'DIGEST2' =&gt; '478'
);
$transaction-&gt;payload = $digests;
commerce_payment_transaction_save($transaction);
?&gt;


But is it possible to use also entity_metadata_wrapper to update data of entity, that are neither properties nor fields, like payload in commerce_payment_transaction?
The payload column is a property of the commerce payment transaction type already (property is a Drupal core term for any base fields on an entity), but for whatever reason the authors of the module have chosen not to expose it to the Entity API module through commerce_payment_entity_property_info().

Fortunately you can just use hook_entity_property_info_alter() in a custom module to provide the metadata on its behalf. See hook_entity_property_info() for details of the options available.