Skip to content

Instantly share code, notes, and snippets.

@yazinsai
Last active August 29, 2015 14:14
Show Gist options
  • Save yazinsai/75302b283ff3a4a3dd75 to your computer and use it in GitHub Desktop.
Save yazinsai/75302b283ff3a4a3dd75 to your computer and use it in GitHub Desktop.
Bill a token -- John
# From https://whitepayments.com/docs/api/#create-a-new-charge
<?php
require_once('./lib/White.php');
White::setApiKey("test_sec_k_886a1e89b2c0abce479bf"); # Your secret API key
White_Charge::create(array(
"amount" => 1000, // 10.00
"currency" => "aed",
"card" => "tok_38951a48cd3859d2dcf62957e1c9", # The token from White.js
"email" => "john@doe.com",
"ip" => $_SERVER['REMOTE_ADDR'],
"description" => "Two widgets (test@example.com)"
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment