WalletBit/API/Send

From Bitcoin Wiki
Revision as of 15:59, 6 April 2014 by Imsaguy (talk | contribs) (Add disclaimer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
The following information may no longer be true, WalletBit service was suspended
See https://bitcointalk.org/index.php?topic=249751.new

The article is kept only as historic documentation.

Send to Email or Bitcoin address

$fields = array(
  'merchant' => 'owner@example.com',
  'customer_email' => 'johnsmith@example.com',
  'address' => '',
  'amount' => 0.01000000,
  'details' => 'You got Bitcoins!'
);
$fields['encrypted'] = strtoupper(hash('sha256', $fields['merchant'] . ':' . $fields['customer_email'] . ':' . $fields['amount'] . ':' . 'API Key'));

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://walletbit.com/api');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
$response = curl_exec($ch);
curl_close($ch);

if ($response == '1')
{

}

If 'customer_email' is not on WalletBit, it will try to send to the defined bitcoin address.