Skip to content

Instantly share code, notes, and snippets.

@paymill
Created September 12, 2012 09:55
Show Gist options
  • Save paymill/3705660 to your computer and use it in GitHub Desktop.
Save paymill/3705660 to your computer and use it in GitHub Desktop.
request.php
<?php
define('PAYMILL_API_HOST', 'https://api.paymill.de/v1/');
define('PAYMILL_API_KEY', '<DEIN_PRIVATE_KEY >');
set_include_path(implode(PATH_SEPARATOR, array(
realpath(realpath(dirname(__FILE__)) . '/lib'),
get_include_path(),
)));
$token = $_POST['paymillToken'];
if ($token) {
require "Services/Paymill/Transactions.php";
$transactionsObject = new Services_Paymill_Transactions(PAYMILL_API_KEY, PAYMILL_API_HOST);
$params = array(
'amount' => '10',
'currency' => 'eur',
'token' => $token,
'description' => 'Test Transaction'
);
$transaction = $transactionsObject->create($params);
echo "Transaction: ";
print_r($transaction);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment