public function testAmountAccessors() { $refund = new Refund(); $refund->setAmount(new Money(5000.0, 'JPY')); $this->assertEquals(new Money(5000.0, 'JPY'), $refund->getAmount()); $refund->setAmount(300.5, 'USD'); $this->assertEquals(new Money(300.5, 'USD'), $refund->getAmount()); }
/** * {@inheritdoc} */ public function create(array $data) { $refund = new Refund(); $refund->setCreated($this->dateTimeUtil->createDateTimeByUnixTime($data['created']))->setAmount(new Money(floatval($data['amount']), $data['currency'])); return $refund; }