Skip to content

Commit

Permalink
Move API key getting to function
Browse files Browse the repository at this point in the history
  • Loading branch information
jusasiiv committed Dec 17, 2017
1 parent 97d390a commit 72cc921
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions modules/gateways/Blockonomics/Blockonomics.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@ private function generateCallbackSecret() {
}

/*
* Get new address from Blockonomics Api
* Get user configured API key from database
*/
public function getNewBitcoinAddress() {
$api_key = Capsule::table('tblpaymentgateways')
public function getApiKey() {
return Capsule::table('tblpaymentgateways')
->where('gateway', 'blockonomics')
->where('setting', 'ApiKey')
->value('value');
}

/*
* Get new address from Blockonomics Api
*/
public function getNewBitcoinAddress() {
$api_key = $this->getApiKey();
$secret = $this->getCallbackSecret();

// Secret is formatted http://url.com?secret=abc123,
Expand Down
1 change: 0 additions & 1 deletion payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
/***********************************************
* PRICE GENERATION
*/

$btc_amount = $blockonomics->getBitcoinAmount($fiat_amount, $currency) / 1.0e8;

$ca->assign('btc_amount', $btc_amount);
Expand Down

0 comments on commit 72cc921

Please sign in to comment.