Skip to content
This repository has been archived by the owner on Aug 6, 2019. It is now read-only.

Commit

Permalink
Fixing issues for testmode and livemode
Browse files Browse the repository at this point in the history
  • Loading branch information
gopinathinnoppl committed Oct 18, 2016
1 parent 825c889 commit 116a84d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions app/code/Bitpay/Core/Block/Iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ public function getCartUrl() {
return $cartUrl;
}

public function isTestMode()
{
return $this->_scopeConfig->getValue('payment/bitpay/fullscreen', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
public function isTestMode() {
$mode = $this -> _scopeConfig -> getValue('payment/bitpay/network', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if ($mode == 'testnet') {
return true;
}
return false;
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
$url = $block->getFrameActionUrl();
$isNotTest = $block->isTestMode();
$isTest = $block->isTestMode();
$parts = parse_url($url);
parse_str($parts['query'], $query);
?>
<div class="sm-12">
<script src="https://bitpay.com/bitpay.min.js"></script>
<script type="text/javascript">
var id = "<?php echo $query['id']; ?>";
<?php if(!$isNotTest): ?>
bitpay.enableTestMode();
<?php if($isTest): ?>
bitpay.enableTestMode();
<?php endif; ?>
bitpay.showInvoice(id);
</script>
Expand Down

0 comments on commit 116a84d

Please sign in to comment.