<?php

require '../src/WolopayApi.php';
$wo = new \Wolopay\WolopayApi('<your_api_client_id>', '<your_api_secret>', true, true);
$data = $wo->createTransaction($gamerId = 'user13', $level = 3, $extraOptions = array('external_store' => 'facebook', 'test' => 1), $autoRedirect = false);
?>
<!DOCTYPE html>
<html>
<head>
    <title>Wolopay shop :P</title>
    <style>
        html, body, .wolo-shop{
            height: 100%;
        }
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

</head>

<body>
<div id="fb-root"></div>

<div class="wolo-shop"></div>
<script src="<?php 
echo $data->url_js;
?>
"></script>

</body>
</html>
<?php

/**
 * This file is part of the wolopay.com (c)
 *
 * Example to create a transaction
 */
$wolopayApi = new \Wolopay\WolopayApi($apiClientId = 'app_54818a4d61253', $apiClientSecret = 'c38a908de00ffb3ef77f1ac52ea3d3a39ae4d1e0', $sandbox = true, $debug = true);
// See the doc to view all optional parameters
$trans = $wolopayApi->createTransaction($gamerId = 'user13', $level = 3, $extraOptions = array('fixed_country' => '1'), $autoRedirect = true);
if (!$trans) {
    die("Request can't be generated");
}
/*
 * If you want to save the new transaction Id, before to redirect.
 *
 * $result = $wolopayApi->createTransaction($gamerId='user13', $level=3)
 * $result->id  have a transactionId
 * header("Location: ".$result->url);
 */