public function testRemove() { $data = new ExtendedData(); $this->assertFalse($data->has('foo')); $data->set('foo', 'foo', false); $this->assertTrue($data->has('foo')); $data->remove('foo'); $this->assertFalse($data->has('foo')); }
/** * @param \JMS\Payment\CoreBundle\Entity\ExtendedData $data * * @return string|null */ public function getBackUrl(ExtendedData $data) { return $data->has('backUrl') ? $data->get('backUrl') : $this->backUrl; }
/** * @param \JMS\Payment\CoreBundle\Entity\ExtendedData $data * * @return string|null */ public function getLogo(ExtendedData $data) { return $data->has('logo') ? $data->get('logo') : $this->logo; }
/** * Check that the extended data contains the needed values * before approving and depositing the transation * * @param ExtendedData $data * * @throws BlockedException */ protected function checkExtendedDataBeforeApproveAndDeposit(ExtendedData $data) { if (!$data->has('t_status') || !$data->has('t_id') || !$data->has('amount')) { // if these data are missing, we should wait the response from DotPay // and the transaction should stay in pending state throw new BlockedException("Awaiting extended data from DotPay"); } }