Skip to content

Commit

Permalink
#12 added TurtleNode Token as static currency
Browse files Browse the repository at this point in the history
  • Loading branch information
tubbynl committed Apr 20, 2018
1 parent c77f740 commit ae60668
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion includes/class-waves-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct()
$this->has_fields = true;

// assetCode+id if woocommerce_currency is set to Waves-like currency
$this->currencyIsWaves = in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL"));
$this->currencyIsWaves = in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL","TN"));
if($this->currencyIsWaves) {
if (get_woocommerce_currency() == "Waves") {
$this->assetCode = 'Waves';
Expand All @@ -43,6 +43,9 @@ public function __construct()
} else if (get_woocommerce_currency() == "POL") {
$this->assetCode = 'POL';
$this->assetId = 'Fx2rhWK36H1nfXsiD4orNpBm2QG1JrMhx3eUcPVcoZm2';
} else if (get_woocommerce_currency() == "TN") {
$this->assetCode = 'TN';
$this->assetId = 'HxQSdHu1X4ZVXmJs232M6KfZi78FseeWaEXJczY6UxJ3';
}
} else {
$this->assetId = $this->get_option('asset_id');
Expand Down
4 changes: 3 additions & 1 deletion waves-gateway-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function WavesCurrencies( $currencies )
$currencies['WNET'] = __( 'Wavesnode.NET', 'wnet' );
$currencies['ARTcoin'] = __( 'ARTcoin', 'ARTcoin' );
$currencies['POL'] = __( 'POLTOKEN.PL', 'POL' );
$currencies['TN'] = __( 'TurtleNode', 'TN' );
return $currencies;
}

Expand All @@ -123,6 +124,7 @@ public function WavesCurrencySymbols( $currency_symbol, $currency ) {
case 'WNET': $currency_symbol = 'WNET'; break;
case 'ARTcoin': $currency_symbol = 'ARTcoin'; break;
case 'POL': $currency_symbol = 'POL'; break;
case 'TN': $currency_symbol = '$TN'; break;
}
return $currency_symbol;
}
Expand Down Expand Up @@ -157,7 +159,7 @@ public function WavesFilterCartSubtotal($price, $cart_item, $cart_item_key)
private function convertToWavesPrice($price_string, $price)
{
$options = get_option('woocommerce_waves_settings');
if(!in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL")) && $options['show_prices'] == 'yes') {
if(!in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL","TN")) && $options['show_prices'] == 'yes') {
$waves_currency = $options['asset_code'];
if(empty($waves_currency)) {
$waves_currency = 'Waves';
Expand Down

0 comments on commit ae60668

Please sign in to comment.