Exemplo n.º 1
0
 protected function _isAvailable()
 {
     $configured = $this->_config->configureSDK();
     if ($configured) {
         $paymentOptionId = $this->_config->getPaymentOptionId($this->_code);
         $list = Paymentmethods::getList();
         if (isset($list[$paymentOptionId])) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 2
0
 public function testGetPaymentMethodsCountry()
 {
     $this->setDummyData();
     \Paynl\Config::setServiceId('SL-1234-5678');
     \Paynl\Config::setApiToken('123456789012345678901234567890');
     $list = \Paynl\Paymentmethods::getList(array('country' => 'NL'));
     $this->assertInternalType('array', $list);
     foreach ($list as $paymentMethod) {
         $this->assertArrayHasKey('id', $paymentMethod);
         $this->assertArrayHasKey('name', $paymentMethod);
         $this->assertArrayHasKey('visibleName', $paymentMethod);
         $this->assertTrue(in_array('ALL', $paymentMethod['countries']) || in_array('NL', $paymentMethod['countries']), 'Returned paymentMethod invalid for this country');
     }
 }
Exemplo n.º 3
0
<?php

/* 
 * Copyright (C) 2015 Andy Pieters <*****@*****.**>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once '../../vendor/autoload.php';
require_once '../config.php';
try {
    $paymentMethods = \Paynl\Paymentmethods::getList();
    var_dump($paymentMethods);
} catch (\Paynl\Error\Error $e) {
    echo "Fout: " . $e->getMessage();
}