Example #1
0
 public function testTypesAvailable()
 {
     $o = new Mtgim_Api_Client('testKey', 'testSecret');
     $this->assertEquals(array('A' => 'Vše', 'F' => 'Foilové', 'R' => 'Obyčejné'), $o->typesAvailable());
 }
Example #2
0
 * Simple example of usage mtgim-api-lib.
 * Shows basic usage of Mtgim_Api_Client class. There's not implemented any cacheing of results
 * (you should cache results of method Mtgim_Api_Client::shopsAvailable), nor advanced settings
 * of Adapter. For more information refer to documentation.
 */
// ==========  SETTINGS  =========
// these settings are testing ones - you will get only fake results
// you can change them to your production settings
// if you do not have production setting, contact us
$apiKey = 'testKey';
$secret = 'testSecret';
// ==========  MAGIC =========
// include library
require_once __DIR__ . '/mtgim-api-lib/Client.php';
// instantiate library
$mtgim = new Mtgim_Api_Client($apiKey, $secret);
// get list of available shops
$shops = $mtgim->shopsAvailable();
// get list of available card types
$cardTypes = $mtgim->typesAvailable();
// local variables
$showResults = FALSE;
$message = NULL;
$cardname = '';
$selectedShop = '';
$selectedType = '';
// if form was sent, try to find card results
if (isset($_POST['cardname']) && !empty($_POST['cardname'])) {
    $cardname = $_POST['cardname'];
    $selectedShop = $_POST['shop'];
    $selectedType = $_POST['foil'];