I wish to update values in commerce_payment_transaction entity. I am using such code:
<?php $transaction = commerce_payment_transaction_load(58); $digests = array( 'DIGEST' => '456', 'DIGEST2' => '478' ); $transaction_wrapper = entity_metadata_wrapper('commerce_payment_transaction', $transaction); $transaction_wrapper->payload->set($digests); $transaction_wrapper->field_my_custom_field->set(1458); $transaction_wrapper->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:
<?php $transaction = commerce_payment_transaction_load(58); $digests = array( 'DIGEST' => '456', 'DIGEST2' => '478' ); $transaction->payload = $digests; commerce_payment_transaction_save($transaction); ?>
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?