/**
  * Warms up the cache.
  *
  * @param string $cacheDir The cache directory
  */
 public function warmUp($cacheDir)
 {
     try {
         if (!in_array($this->environment, ['dev', 'test'])) {
             $issuers = $this->gateway->fetchIssuers()->send()->getIssuers();
         } else {
             $issuers = array(new Issuer('ideal_TESTNL99', 'TBM Bank', 'ideal'));
         }
         $cacheFile = "<?php return array(" . PHP_EOL;
         foreach ($issuers as $issuer) {
             $cacheFile .= sprintf('new \\Omnipay\\Common\\Issuer(%s, %s, %s),' . PHP_EOL, var_export($issuer->getId(), true), var_export($issuer->getName(), true), var_export($issuer->getPaymentMethod(), true));
         }
         $cacheFile .= ");";
         $this->writeCacheFile($cacheDir . '/ruudk_payment_mollie_issuers.php', $cacheFile);
     } catch (\Exception $exception) {
         throw new \RuntimeException($exception->getMessage());
     }
 }
Example #2
0
 public function testFetchIssuers()
 {
     $request = $this->gateway->fetchIssuers();
     $this->assertInstanceOf('Omnipay\\Mollie\\Message\\FetchIssuersRequest', $request);
 }