コード例 #1
0
ファイル: GetCurrencyAction.php プロジェクト: eamador/Payum
 /**
  * {@inheritDoc}
  *
  * @param GetCurrency $request
  */
 public function execute($request)
 {
     RequestNotSupportedException::assertSupports($this, $request);
     $currency = is_numeric($request->code) ? $this->iso4217->findByNumeric($request->code) : $this->iso4217->findByAlpha3($request->code);
     $request->alpha3 = $currency->getAlpha3();
     $request->country = $currency->getCountry();
     $request->exp = $currency->getExp();
     $request->name = $currency->getName();
     $request->numeric = $currency->getNumeric();
 }
コード例 #2
0
ファイル: ISO4217Test.php プロジェクト: PetsFundation/Pets
 public function testFindAll()
 {
     $iso4217 = new ISO4217();
     $currencies = $iso4217->findAll();
     $this->assertInternalType('array', $currencies);
     $this->assertCount(157, $currencies);
     $this->assertContainsOnly('Payum\\ISO4217\\Currency', $currencies);
 }