Ejemplo n.º 1
0
namespace Coinfide\Example;

use Coinfide\Client;
use Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
$dotenv = new Dotenv(__DIR__);
$dotenv->load();
if ($_ENV['COINFIDE_USER'] == 'yourapiusername') {
    die('Please copy .env.example file to .env and fill in your Coinfide credentials');
}
\Symfony\Component\Debug\Debug::enable();
/*
 * Configure this values in your Dashboard,
 * Profile - Business details - API username and API secret key
 */
$client = new Client();
$client->setMode($_ENV['COINFIDE_MODE']);
$client->setCredentials($_ENV['COINFIDE_USER'], $_ENV['COINFIDE_PASSWORD']);
$orders = $client->orderList('20160101000000', '20161231000000');
print 'Dumping all orders (' . count($orders->getOrderList()) . '):' . PHP_EOL;
print json_encode($orders->toArray(), JSON_PRETTY_PRINT) . PHP_EOL;
if (!count($orders->getOrderList())) {
    print 'Please provide at least some orders to continue' . PHP_EOL;
} else {
    print 'Fetching order by uid' . PHP_EOL;
    $order = $client->orderDetailsByUid($orders->getOrderList()[0]->getUid());
    print json_encode($order->toArray(), JSON_PRETTY_PRINT) . PHP_EOL;
    $externalFound = false;
    foreach ($orders->getOrderList() as $order) {
        if ($order->getExternalOrderId()) {
            $externalFound = true;
Ejemplo n.º 2
0
use Coinfide\Entity\Account;
use Coinfide\Entity\Order;
use Coinfide\Entity\OrderItem;
use Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
$dotenv = new Dotenv(__DIR__);
$dotenv->load();
if ($_ENV['COINFIDE_USER'] == 'yourapiusername') {
    die('Please copy .env.example file to .env and fill in your Coinfide credentials');
}
\Symfony\Component\Debug\Debug::enable();
/*
 * Configure this values in your Dashboard,
 * Profile - Business details - API username and API secret key
 */
$client = new Client();
$client->setMode($_ENV['COINFIDE_MODE']);
$client->setCredentials($_ENV['COINFIDE_USER'], $_ENV['COINFIDE_PASSWORD']);
/*
 * Create order; this is a minimal amount of values needed to submit an order. For full example, consult order methods
 * or test/SerializationTest
 */
$order = new Order();
$seller = new Account();
//important!! change this to your actual e-mail, or the example will not work
$seller->setEmail('*****@*****.**');
$order->setSeller($seller);
$buyer = new Account();
$buyer->setEmail('*****@*****.**');
$order->setBuyer($buyer);
$order->setCurrencyCode('EUR');
Ejemplo n.º 3
0
use Coinfide\Entity\Order;
use Coinfide\Entity\OrderItem;
use Coinfide\Entity\Phone;
use Dotenv\Dotenv;
require __DIR__ . '/../../vendor/autoload.php';
$dotenv = new Dotenv(__DIR__ . '/../../');
$dotenv->load();
if ($_ENV['COINFIDE_USER'] == 'yourapiusername') {
    die('Please copy .env.example file to .env and fill in your Coinfide credentials');
}
\Symfony\Component\Debug\Debug::enable();
/*
 * Configure this values in your Dashboard,
 * Profile - Business details - API username and API secret key
 */
$client = new Client(array('trace' => true));
$client->setMode($_ENV['COINFIDE_MODE']);
$client->setCredentials($_ENV['COINFIDE_USER'], $_ENV['COINFIDE_PASSWORD']);
/* test full phone */
$order = new Order();
$phone = new Phone();
$phone->setFullNumber('37121234567');
$seller = new Account();
//important!! change this to your actual e-mail, or the example will not work
$seller->setEmail('*****@*****.**');
$order->setSeller($seller);
$buyer = new Account();
$buyer->setEmail('*****@*****.**');
$buyer->setPhone($phone);
$order->setBuyer($buyer);
$order->setCurrencyCode('EUR');
Ejemplo n.º 4
0
use Coinfide\Entity\Account;
use Coinfide\Entity\Order;
use Coinfide\Entity\OrderItem;
use Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
$dotenv = new Dotenv(__DIR__);
$dotenv->load();
if ($_ENV['COINFIDE_USER'] == 'yourapiusername') {
    die('Please copy .env.example file to .env and fill in your Coinfide credentials');
}
\Symfony\Component\Debug\Debug::enable();
/*
 * Configure this values in your Dashboard,
 * Profile - Business details - API username and API secret key
 */
$client = new Client(array('trace' => true));
$client->setMode($_ENV['COINFIDE_MODE']);
$client->setCredentials($_ENV['COINFIDE_USER'], $_ENV['COINFIDE_PASSWORD']);
/*
 * Create order; this is a minimal amount of values needed to submit an order. For full example, consult order methods
 * or test/SerializationTest
 */
$order = new Order();
$seller = new Account();
//important!! change this to your actual e-mail, or the example will not work
$seller->setEmail('*****@*****.**');
$order->setSeller($seller);
$buyer = new Account();
$buyer->setEmail('*****@*****.**');
$order->setBuyer($buyer);
$order->setCurrencyCode('EUR');