<?php
require_once 'allopass-apikit-php5/api/AllopassAPI.php';
$api = new AllopassAPI();
/*
$response = $api->createDiscreteButton(array(
 'site_id' => 283167, 
 'product_name' => 'test product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '20.99', 
 'reference_currency' => 'EUR', 
 'price_mode' => 'price', 
 'price_policy' => 'high-preferred',
 'category' => array('direct-debit'),
 'country' => array('UK'),
 'currency' => 'GBP'
));
 
 echo $response->getBuyUrl(), "\n-----\n" . '<br/>';
 echo $response->getCheckoutButton();
 */
$response = $api->prepareTransaction(array(
 'site_id' => 286385, 
 'pricepoint_id' => 1034, 
 'product_name' => 'test GBP product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '10', 
 'reference_currency' => 'EUR', 
 //'data' => 'bla blab bla',
 //'merchant_transaction_id' => 'TRANS765',
 //'country' => 'US'
 //'type' => array('premium-calling')
));
//echo $response; 
$url = $response->getBuyUrl();

//echo $url;
echo '<br><a href="'.$url . '" >10 GBP</a>';

$response2 = $api->prepareTransaction(array(
 'site_id' => 286385, 
 'pricepoint_id' => 1034, 
 'product_name' => 'test GBP product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '5', 
 'reference_currency' => 'EUR', 
 //'data' => 'bla blab bla',
 //'merchant_transaction_id' => 'TRANS765',
 //'country' => 'US'
 //'type' => array('premium-calling')
));
//echo $response; 
$url2 = $response2->getBuyUrl();

//echo $url;
echo '<br><a href="'.$url2 . '" >5 GBP</a>';

$response3 = $api->prepareTransaction(array(
 'site_id' => 286385, 
 'pricepoint_id' => 1034, 
 'product_name' => 'test GBP product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '3', 
 'reference_currency' => 'EUR', 
 //'data' => 'bla blab bla',
 //'merchant_transaction_id' => 'TRANS765',
 //'country' => 'US'
 //'type' => array('premium-calling')
));
//echo $response; 
$url3 = $response3->getBuyUrl();

//echo $url;
echo '<br><a href="'.$url3 . '" >3 GBP</a>';

$response4 = $api->createDiscreteButton(array(
'site_id' => 286385, 
 'product_name' => 'test product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '107.88', 
 'currency' => 'EUR',
 'reference_currency' => 'USD', 
 'price_mode' => 'price', 
 'price_policy' => 'nearest',
'category' => array('direct-debit'),
'country' => array('DE')
));

$url4 = $response4->getBuyUrl();

//echo $url;
echo '<br><a href="'.$url4 . '" >DIRECT DEBIT</a>';

$response5 = $api->createDiscreteButton(array(
'site_id' => 286385, 
 'product_name' => 'test product', 
 'forward_url'=> 'http://rift.trionworlds.com/success', 
 'amount' => '107.88', 
 'currency' => 'EUR',
 'reference_currency' => 'USD', 
 'price_mode' => 'price', 
 'price_policy' => 'nearest',
'category' => array('paysafecard'),
'country' => array('DE')
));

$url5 = $response5->getBuyUrl();

//echo $url;
echo '<br><a href="'.$url5 . '" >Paysafe</a>';
