An easy way to buy, send, and accept bitcoin through the Cubits API.
This library supports API key authentication method
require_once("/path/to/cubits-php/lib/Cubits.php");
Start by enabling an API Key on your account.
Next, configure the Cubits library via Cubits::configure
method and create an instance of the client using the Cubits::withApiKey
method:
Cubits::configure("https://pay.cubits.com/api/v1/",true);
$cubits = Cubits::withApiKey($_ENV['Cubits_API_KEY'], $_ENV['Cubits_API_SECRET'])
$response = $cubits->createInvoice("Your Order #1234", "42.95", "EUR", array(
"description" => "1 widget at EUR 42.95",
"reference" => "my custom tracking code for this order"
));
$response = $cubits->getInvoice("ef73a6ed61a8c97427eaae2073b9127b");
$response = $cubits->sendMoney("3Pj4mJfK62n9mjMRcHYs96nd15UQLHHhPS","0.25120521");
$response = $cubits->listAccounts();
$response = $cubits->requestQuote("buy","EUR","10","BTC");
$response = $cubits->buy("EUR","10");
$response = $cubits->sell("0.150","EUR");
$response = $cubits->createChannel("EUR");
$cubits->getChannel("7ff31a5843887cbaffb9adb3fcb2aebd");
$response = $cubits->updateChannel("7ff31a5843887cbaffb9adb3fcb2aebd", "EUR", "Alpaca underwear");
If someone gains access to your API Key they will have complete control of your Cubits account. This includes the abillity to send all of your bitcoins elsewhere.
For this reason, API access is disabled on all Cubits accounts by default. If you decide to enable API key access you should take precautions to store your API key securely in your application. How to do this is application specific, but it's something you should research if you have never done this before.