I'm currently developing a payment method and things are working quite well.
Just one thing: The customer enters some information along the payment method and through debugging I can see that it gets written into the InfoInstance via Mage_Payment_Model_Method_Abstract::assignData() Unfortunately, I can't read that data when I'm in the capture()-Method. I retrieve the InfoInstance and try to read the information, but it's not set.
assignData() method:
public function assignData($data) {
if (!($data instanceof Varien_Object)) {
$data = new Varien_Object($data);
}
$info = $this->getInfoInstance();
$info->setEtixType($data->getEtixType());
return $this;
}
capture() method:
public function capture(Varien_Object $payment, $amount) {
// ...
$info = $this->getInfoInstance();
Mage::log('etix_type: '.$info->getEtixType()); //I expect something like "etix_type: cc"
// ...
}
Any help is appreciated. I'm sure I missed something.
Found it,
Assigning veriables directly to the InfoInstance
works, but it does not persist through the whole checkout process. Instead, you have to set it on the additional_data:
$info = $this->getInfoInstance();
$info->setAdditionalInformation('etix_type', $data->getEtixType());
And later you can read it via:
$info = $this->getInfoInstance();
$etix_type = $info->getAdditionalInformation('etix_type');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With