Changeset 2972696
- Timestamp:
- 09/28/2023 03:05:09 PM (3 years ago)
- Location:
- cryptocurrency-payment-gateway
- Files:
-
- 16 edited
- 1 copied
-
tags/1.4.8 (copied) (copied from cryptocurrency-payment-gateway/trunk)
-
tags/1.4.8/admin/options-init.php (modified) (14 diffs)
-
tags/1.4.8/changelog (modified) (1 diff)
-
tags/1.4.8/cryptocurrency-payment-gateway.php (modified) (5 diffs)
-
tags/1.4.8/includes/class.exchange-rates.php (modified) (1 diff)
-
tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-blockchaincom.php (modified) (2 diffs)
-
tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-okcoin.php (modified) (3 diffs)
-
tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-poloniex.php (modified) (5 diffs)
-
tags/1.4.8/readme.txt (modified) (2 diffs)
-
trunk/admin/options-init.php (modified) (14 diffs)
-
trunk/changelog (modified) (1 diff)
-
trunk/cryptocurrency-payment-gateway.php (modified) (5 diffs)
-
trunk/includes/class.exchange-rates.php (modified) (1 diff)
-
trunk/includes/pricing/exchanges/class-cw-exchange-blockchaincom.php (modified) (2 diffs)
-
trunk/includes/pricing/exchanges/class-cw-exchange-okcoin.php (modified) (3 diffs)
-
trunk/includes/pricing/exchanges/class-cw-exchange-poloniex.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cryptocurrency-payment-gateway/tags/1.4.8/admin/options-init.php
r2877204 r2972696 941 941 'blockchaincom' => 'Blockchain.com', 942 942 'blockio' => 'Block.io (Enter API keys in "Wallet Settings")', 943 'bitcoinaverage' => 'BitcoinAverage',943 // 'bitcoinaverage' => 'BitcoinAverage', TODO: Add back with API requirement. 944 944 'bitpay' => 'BitPay', 945 945 'bitstamp' => 'Bitstamp', … … 954 954 'kraken' => 'Kraken', 955 955 'gemini' => 'Gemini', 956 'livecoin' => 'Livecoin',957 'coinflex' => 'CoinFLEX',958 956 ); 959 957 … … 1255 1253 'kraken' => array( 'EUR', 'GBP', 'USD', 'CAD' ), 1256 1254 'gemini' => array( 'USD', 'EUR', 'GBP', 'SGD' ), 1257 'livecoin' => array( 'EUR', 'USD' ),1258 'coinflex' => array( 'USD' ),1259 1255 ); 1260 1256 … … 4476 4472 'options' => array( 4477 4473 'coingecko' => 'CoinGecko', 4478 'blockchaincom' => 'Blockchain.com',4474 // 'blockchaincom' => 'Blockchain.com', TODO: Add back when calculation via fiat is possible, the BCH_BTC pair is closed. 4479 4475 'binance' => 'Binance', 4480 4476 'coinbase' => 'Coinbase', 4481 4477 'kraken' => 'Kraken', 4482 4478 'gemini' => 'Gemini', 4483 'bittrex' => 'Bittrex',4484 4479 'poloniex' => 'Poloniex', 4485 4480 // 'bitfinex' => 'Bitfinex', TODO: Add bitfinex, only the pair BCHN:USD is supported. 4486 4481 'bitstamp' => 'Bitstamp', 4487 4482 'bitpay' => 'BitPay', 4488 'shapeshift' => 'ShapeShift', 4489 'livecoin' => 'Livecoin', 4490 'okcoin' => 'OKCoin.com', 4491 'coinflex' => 'CoinFLEX', 4483 'hitbtc' => 'HitBTC', 4484 'fmfw' => 'FMFW', 4485 'kucoin' => 'KuCoin', 4492 4486 ), 4493 4487 'default' => 'coingecko', … … 4510 4504 'options' => array( 4511 4505 'coingecko' => 'CoinGecko', 4506 'binance' => 'Binance', 4507 'coinbase' => 'Coinbase', 4512 4508 // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com. 4513 4509 'kraken' => 'Kraken', … … 4515 4511 'blockio' => 'Block.io (Enter API keys in "Wallet Settings")', 4516 4512 'dogecoinaverage' => 'DogecoinAverage.com', 4517 'shapeshift' => 'ShapeShift',4518 4513 'poloniex' => 'Poloniex', 4519 'bittrex' => 'Bittrex', 4520 'coinflex' => 'CoinFLEX', 4514 //'hitbtc' => 'HitBTC', erroneous price, differs largely from global prices! 4515 'fmfw' => 'FMFW', 4516 'kucoin' => 'KuCoin', 4521 4517 ), 4522 4518 'default' => 'coingecko', … … 4536 4532 'options' => array( 4537 4533 'coingecko' => 'CoinGecko', 4534 'binance' => 'Binance', 4535 'coinbase' => 'Coinbase', 4538 4536 // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com. 4539 4537 'kraken' => 'Kraken', … … 4542 4540 //'btc_e' => 'BTC-e', 4543 4541 'bitfinex' => 'Bitfinex', 4544 'shapeshift' => 'ShapeShift',4545 4542 'poloniex' => 'Poloniex', 4546 'bittrex' => 'Bittrex', 4547 'binance' => 'Binance', 4548 'coinflex' => 'CoinFLEX', 4543 'bitstamp' => 'Bitstamp', 4544 'bitpay' => 'BitPay', 4545 'hitbtc' => 'HitBTC', 4546 'fmfw' => 'FMFW', 4547 'kucoin' => 'KuCoin', 4549 4548 ), 4550 4549 'default' => 'coingecko', … … 4563 4562 ), 4564 4563 'options' => array( 4565 'coingecko' => 'CoinGecko', 4566 'shapeshift' => 'ShapeShift', 4567 'poloniex' => 'Poloniex', 4568 'bittrex' => 'Bittrex', 4564 'coingecko' => 'CoinGecko', 4569 4565 ), 4570 4566 'default' => 'coingecko', … … 4596 4592 'desc' => '', 4597 4593 'options' => array( 4594 1 => '1', 4598 4595 2 => '2', 4596 3 => '3', 4599 4597 4 => '4', 4598 5 => '5', 4600 4599 6 => '6', 4600 7 => '7', 4601 4601 8 => '8', 4602 4602 ), … … 4617 4617 ), 4618 4618 'options' => array( 4619 1 => '1', 4619 4620 2 => '2', 4621 3 => '3', 4620 4622 4 => '4', 4623 5 => '5', 4621 4624 6 => '6', 4625 7 => '7', 4622 4626 8 => '8', 4623 4627 ), … … 4632 4636 'desc' => '', 4633 4637 'options' => array( 4638 1 => '1', 4634 4639 2 => '2', 4640 3 => '3', 4635 4641 4 => '4', 4642 5 => '5', 4636 4643 6 => '6', 4644 7 => '7', 4637 4645 8 => '8', 4638 4646 ), … … 4647 4655 'desc' => '', 4648 4656 'options' => array( 4649 0 => '0',4657 1 => '1', 4650 4658 2 => '2', 4659 3 => '3', 4651 4660 4 => '4', 4661 5 => '5', 4652 4662 6 => '6', 4663 7 => '7', 4653 4664 8 => '8', 4654 4665 ), … … 4663 4674 'desc' => '', 4664 4675 'options' => array( 4665 0 => '0',4676 1 => '1', 4666 4677 2 => '2', 4678 3 => '3', 4667 4679 4 => '4', 4680 5 => '5', 4668 4681 6 => '6', 4682 7 => '7', 4669 4683 8 => '8', 4670 4684 ), -
cryptocurrency-payment-gateway/tags/1.4.8/changelog
r2947271 r2972696 1 = 1.4.7 2023-08-03 1 =1.4.8 2023-09-28 = 2 WooCommerce tested up to 8.2 3 Fix reattempt exchange rate if missing during checkout 4 Remove unused redux extension redux-vendor-support 5 Fix Poloniex price api 6 Add decimals options 1, 3, 5 and 7 7 Add check if the data in blockchain.com exchange api is stale 8 Fix issue getting price from Okcoin for Bitcoin 9 Add HitBTC price api for bitcoin cash and litecoin 10 Add FMFW price api for bitcoin cash, dogecoin and litecoin 11 Add KuCoin price api for bitcoin cash, dogecoin and litecoin 12 Add Binance price api for dogecoin 13 Add Coinbase price api for dogecoin and litecoin 14 Add Bitstamp price api for litecoin 15 Add BitPay price api for litecoin 16 Remove Livecoin price api for bitcoin and bitcoin cash 17 Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin 18 Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin 19 Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin 20 Remove Poloniex price api for BlackCoin 21 Disable bitcoinaverage price api for bitcoin until we support required api key 22 Disable blockchain.com price api for bitcoin cash 23 24 = 1.4.7 2023-08-03 = 2 25 WordPress tested up to 6.3 3 26 WooCommerce tested up to 8.0 -
cryptocurrency-payment-gateway/tags/1.4.8/cryptocurrency-payment-gateway.php
r2947271 r2972696 7 7 * Plugin URI: https://www.cryptowoo.com/ 8 8 * Description: Digital Currency Payment Gateway for WooCommerce 9 * Version: 1.4. 79 * Version: 1.4.8 10 10 * Author: CryptoWoo AS 11 11 * Author URI: https://www.cryptowoo.com … … 16 16 * 17 17 * Tested up to: 6.3 18 * WC tested up to: 8. 018 * WC tested up to: 8.2 19 19 * WC requires at least: 3.0 20 20 * … … 45 45 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 46 */ 47 define( 'CWOO_VERSION', '1.4. 7' );47 define( 'CWOO_VERSION', '1.4.8' ); 48 48 define( 'CWOO_FILE', 'cryptocurrency-payment-gateway/cryptocurrency-payment-gateway.php' ); 49 49 define( 'CWOO_PLUGIN_PATH', plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) . '/' ); … … 943 943 $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], false, $order->get_currency() ); 944 944 945 // If exchange rate is zero at this point we must re-attempt. 946 if ( empty( $price ) ) { 947 CW_AdminMain::cryptowoo_log_data( 0, __FUNCTION__, date( 'Y-m-d H:i:s' ) . ' Exchange rate is empty, the value is: ' . var_export( $price, true ) . ', retrying to get exchange rate now, Status: ' . var_export( $payment_details, true ), 'error' ); 948 $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], true, $order->get_currency() ); 949 } 950 945 951 // Aelia currency switcher: Get the order amount in the active currency 946 952 if ( CW_ExchangeRates::tools()->currency_is_fiat( $currency ) && cw_get_woocommerce_default_currency() !== $currency ) { … … 951 957 $price = apply_filters( 'wcml_raw_price_amount', $price, $order->get_currency() ); 952 958 953 // If exchange rate is zero at this point we must re-attempt.954 if ( empty( $price ) ) {955 CW_AdminMain::cryptowoo_log_data( 0, __FUNCTION__, date( 'Y-m-d H:i:s' ) . ' Exchange rate is empty, the value is: ' . var_export( $price, true ) . ', retrying to get exchange rate now, Status: ' . var_export( $payment_details, true ), 'error' );956 CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], true, $order->get_currency() );957 }958 959 // If the exchange rate is still empty we must redirect to cart and show an error to the user. 959 960 if ( empty( $price ) ) { -
cryptocurrency-payment-gateway/tags/1.4.8/includes/class.exchange-rates.php
r2634120 r2972696 26 26 * - OKCoin.cn 27 27 * - Kraken 28 * - Livecoin.net29 28 * 30 29 * Some functions modified from "Bitcoin Payments for WooCommerce" -
cryptocurrency-payment-gateway/tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-blockchaincom.php
r2730993 r2972696 54 54 /** 55 55 * 56 * Get the stale index in exchange result. 57 * Default is '' (no stale index in result) 58 * 59 * @return string 60 */ 61 protected function get_exchange_stale_index() : string { 62 return 'has_no_volume'; 63 } 64 65 /** 66 * 56 67 * Is the exchange rate search pair uppercase or lowercase in the api url? 57 68 * … … 61 72 return true; 62 73 } 74 75 /** 76 * 77 * Format the price data from exchange result to default data format 78 * 79 * @param stdClass $price_data Json decoded result from exchange api call. 80 * 81 * @return stdClass 82 */ 83 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 84 $price_data->{$this->get_exchange_stale_index()} = empty( $price_data->volume_24h ); 85 86 return $price_data; 87 } 63 88 } -
cryptocurrency-payment-gateway/tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-okcoin.php
r2634120 r2972696 23 23 */ 24 24 protected function get_exchange_url_format() : string { 25 return 'https://www.okcoin.com/api/v 1/ticker.do?symbol=%s';25 return 'https://www.okcoin.com/api/v5/market/ticker?instId=%s'; 26 26 } 27 27 … … 43 43 */ 44 44 protected function get_pair_format() : string { 45 return '%2$s_%1$s'; 45 return '%2$s-%1$s'; 46 } 47 48 /** 49 * 50 * Is the exchange rate search pair uppercase or lowercase in the api url? 51 * Default is lower case. 52 * 53 * @return bool 54 */ 55 protected function search_pair_is_uppercase(): bool { 56 return true; 46 57 } 47 58 … … 55 66 */ 56 67 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 57 if ( isset( $price_data->ticker ) && $price_data->ticker instanceof stdClass ) { 58 if ( isset( $price_data->date ) ) { 59 $price_data->ticker->timestamp = $price_data->date; 68 if ( isset( $price_data->data ) && is_array( $price_data->data ) ) { 69 $data = current( $price_data->data ); 70 if ( $data instanceof stdClass ) { 71 if ( isset( $data->ts ) ) { 72 $data->timestamp = $data->ts; 73 } 74 75 return $data; 60 76 } 61 62 return $price_data->ticker;63 77 } 64 78 -
cryptocurrency-payment-gateway/tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-poloniex.php
r2634120 r2972696 23 23 */ 24 24 protected function get_exchange_url_format() : string { 25 return 'https:// poloniex.com/public?command=returnTicker';25 return 'https://api.poloniex.com/markets/%s/price'; 26 26 } 27 27 … … 33 33 */ 34 34 protected function get_exchange_price_index() : string { 35 return ' last';35 return 'price'; 36 36 } 37 37 … … 43 43 */ 44 44 protected function get_pair_format() : string { 45 return '% 1$s_%2$s';45 return '%2$s_%1$s'; 46 46 } 47 47 … … 56 56 } 57 57 58 /** 59 * 60 * Get the stale index in exchange result. 61 * Default is '' (no stale index in result) 62 * 63 * @return string 64 */ 65 protected function get_exchange_stale_index() : string { 66 return 'isFrozen'; 67 } 68 69 /** 70 * 71 * Format the price data from exchange result to default data format 58 /** Format the price data from exchange result to default data format 72 59 * 73 60 * @param stdClass $price_data Json decoded result from exchange api call. … … 76 63 */ 77 64 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 78 $pair = $this->get_search_pair(); 79 if ( isset( $price_data->$pair ) && $price_data->$pair instanceof stdClass ) { 80 return $price_data->$pair; 65 if ( ! empty( $price_data->ts ) && is_numeric( $price_data->ts ) ) { 66 $price_data->timestamp = $price_data->ts; 81 67 } 82 68 -
cryptocurrency-payment-gateway/tags/1.4.8/readme.txt
r2947271 r2972696 4 4 Requires at least: 4.7 5 5 Tested up to: 6.3 6 Stable tag: 1.4. 76 Stable tag: 1.4.8 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later … … 130 130 == Changelog == 131 131 132 = 1.4.8 = 133 * WooCommerce tested up to 8.2 134 * Fix reattempt exchange rate if missing during checkout 135 * Remove unused redux extension redux-vendor-support 136 * Fix Poloniex price api 137 * Add decimals options 1, 3, 5 and 7 138 * Add check if the data in blockchain.com exchange api is stale 139 * Fix issue getting price from Okcoin for Bitcoin 140 * Add HitBTC price api for bitcoin cash and litecoin 141 * Add FMFW price api for bitcoin cash, dogecoin and litecoin 142 * Add KuCoin price api for bitcoin cash, dogecoin and litecoin 143 * Add Binance price api for dogecoin 144 * Add Coinbase price api for dogecoin and litecoin 145 * Add Bitstamp price api for litecoin 146 * Add BitPay price api for litecoin 147 * Remove Livecoin price api for bitcoin and bitcoin cash 148 * Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin 149 * Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin 150 * Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin 151 * Remove Poloniex price api for BlackCoin 152 * Disable bitcoinaverage price api for bitcoin until we support required api key 153 * Disable blockchain.com price api for bitcoin cash 154 132 155 = 1.4.7 = 133 156 * WordPress tested up to 6.3 -
cryptocurrency-payment-gateway/trunk/admin/options-init.php
r2877204 r2972696 941 941 'blockchaincom' => 'Blockchain.com', 942 942 'blockio' => 'Block.io (Enter API keys in "Wallet Settings")', 943 'bitcoinaverage' => 'BitcoinAverage',943 // 'bitcoinaverage' => 'BitcoinAverage', TODO: Add back with API requirement. 944 944 'bitpay' => 'BitPay', 945 945 'bitstamp' => 'Bitstamp', … … 954 954 'kraken' => 'Kraken', 955 955 'gemini' => 'Gemini', 956 'livecoin' => 'Livecoin',957 'coinflex' => 'CoinFLEX',958 956 ); 959 957 … … 1255 1253 'kraken' => array( 'EUR', 'GBP', 'USD', 'CAD' ), 1256 1254 'gemini' => array( 'USD', 'EUR', 'GBP', 'SGD' ), 1257 'livecoin' => array( 'EUR', 'USD' ),1258 'coinflex' => array( 'USD' ),1259 1255 ); 1260 1256 … … 4476 4472 'options' => array( 4477 4473 'coingecko' => 'CoinGecko', 4478 'blockchaincom' => 'Blockchain.com',4474 // 'blockchaincom' => 'Blockchain.com', TODO: Add back when calculation via fiat is possible, the BCH_BTC pair is closed. 4479 4475 'binance' => 'Binance', 4480 4476 'coinbase' => 'Coinbase', 4481 4477 'kraken' => 'Kraken', 4482 4478 'gemini' => 'Gemini', 4483 'bittrex' => 'Bittrex',4484 4479 'poloniex' => 'Poloniex', 4485 4480 // 'bitfinex' => 'Bitfinex', TODO: Add bitfinex, only the pair BCHN:USD is supported. 4486 4481 'bitstamp' => 'Bitstamp', 4487 4482 'bitpay' => 'BitPay', 4488 'shapeshift' => 'ShapeShift', 4489 'livecoin' => 'Livecoin', 4490 'okcoin' => 'OKCoin.com', 4491 'coinflex' => 'CoinFLEX', 4483 'hitbtc' => 'HitBTC', 4484 'fmfw' => 'FMFW', 4485 'kucoin' => 'KuCoin', 4492 4486 ), 4493 4487 'default' => 'coingecko', … … 4510 4504 'options' => array( 4511 4505 'coingecko' => 'CoinGecko', 4506 'binance' => 'Binance', 4507 'coinbase' => 'Coinbase', 4512 4508 // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com. 4513 4509 'kraken' => 'Kraken', … … 4515 4511 'blockio' => 'Block.io (Enter API keys in "Wallet Settings")', 4516 4512 'dogecoinaverage' => 'DogecoinAverage.com', 4517 'shapeshift' => 'ShapeShift',4518 4513 'poloniex' => 'Poloniex', 4519 'bittrex' => 'Bittrex', 4520 'coinflex' => 'CoinFLEX', 4514 //'hitbtc' => 'HitBTC', erroneous price, differs largely from global prices! 4515 'fmfw' => 'FMFW', 4516 'kucoin' => 'KuCoin', 4521 4517 ), 4522 4518 'default' => 'coingecko', … … 4536 4532 'options' => array( 4537 4533 'coingecko' => 'CoinGecko', 4534 'binance' => 'Binance', 4535 'coinbase' => 'Coinbase', 4538 4536 // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com. 4539 4537 'kraken' => 'Kraken', … … 4542 4540 //'btc_e' => 'BTC-e', 4543 4541 'bitfinex' => 'Bitfinex', 4544 'shapeshift' => 'ShapeShift',4545 4542 'poloniex' => 'Poloniex', 4546 'bittrex' => 'Bittrex', 4547 'binance' => 'Binance', 4548 'coinflex' => 'CoinFLEX', 4543 'bitstamp' => 'Bitstamp', 4544 'bitpay' => 'BitPay', 4545 'hitbtc' => 'HitBTC', 4546 'fmfw' => 'FMFW', 4547 'kucoin' => 'KuCoin', 4549 4548 ), 4550 4549 'default' => 'coingecko', … … 4563 4562 ), 4564 4563 'options' => array( 4565 'coingecko' => 'CoinGecko', 4566 'shapeshift' => 'ShapeShift', 4567 'poloniex' => 'Poloniex', 4568 'bittrex' => 'Bittrex', 4564 'coingecko' => 'CoinGecko', 4569 4565 ), 4570 4566 'default' => 'coingecko', … … 4596 4592 'desc' => '', 4597 4593 'options' => array( 4594 1 => '1', 4598 4595 2 => '2', 4596 3 => '3', 4599 4597 4 => '4', 4598 5 => '5', 4600 4599 6 => '6', 4600 7 => '7', 4601 4601 8 => '8', 4602 4602 ), … … 4617 4617 ), 4618 4618 'options' => array( 4619 1 => '1', 4619 4620 2 => '2', 4621 3 => '3', 4620 4622 4 => '4', 4623 5 => '5', 4621 4624 6 => '6', 4625 7 => '7', 4622 4626 8 => '8', 4623 4627 ), … … 4632 4636 'desc' => '', 4633 4637 'options' => array( 4638 1 => '1', 4634 4639 2 => '2', 4640 3 => '3', 4635 4641 4 => '4', 4642 5 => '5', 4636 4643 6 => '6', 4644 7 => '7', 4637 4645 8 => '8', 4638 4646 ), … … 4647 4655 'desc' => '', 4648 4656 'options' => array( 4649 0 => '0',4657 1 => '1', 4650 4658 2 => '2', 4659 3 => '3', 4651 4660 4 => '4', 4661 5 => '5', 4652 4662 6 => '6', 4663 7 => '7', 4653 4664 8 => '8', 4654 4665 ), … … 4663 4674 'desc' => '', 4664 4675 'options' => array( 4665 0 => '0',4676 1 => '1', 4666 4677 2 => '2', 4678 3 => '3', 4667 4679 4 => '4', 4680 5 => '5', 4668 4681 6 => '6', 4682 7 => '7', 4669 4683 8 => '8', 4670 4684 ), -
cryptocurrency-payment-gateway/trunk/changelog
r2947271 r2972696 1 = 1.4.7 2023-08-03 1 =1.4.8 2023-09-28 = 2 WooCommerce tested up to 8.2 3 Fix reattempt exchange rate if missing during checkout 4 Remove unused redux extension redux-vendor-support 5 Fix Poloniex price api 6 Add decimals options 1, 3, 5 and 7 7 Add check if the data in blockchain.com exchange api is stale 8 Fix issue getting price from Okcoin for Bitcoin 9 Add HitBTC price api for bitcoin cash and litecoin 10 Add FMFW price api for bitcoin cash, dogecoin and litecoin 11 Add KuCoin price api for bitcoin cash, dogecoin and litecoin 12 Add Binance price api for dogecoin 13 Add Coinbase price api for dogecoin and litecoin 14 Add Bitstamp price api for litecoin 15 Add BitPay price api for litecoin 16 Remove Livecoin price api for bitcoin and bitcoin cash 17 Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin 18 Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin 19 Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin 20 Remove Poloniex price api for BlackCoin 21 Disable bitcoinaverage price api for bitcoin until we support required api key 22 Disable blockchain.com price api for bitcoin cash 23 24 = 1.4.7 2023-08-03 = 2 25 WordPress tested up to 6.3 3 26 WooCommerce tested up to 8.0 -
cryptocurrency-payment-gateway/trunk/cryptocurrency-payment-gateway.php
r2947271 r2972696 7 7 * Plugin URI: https://www.cryptowoo.com/ 8 8 * Description: Digital Currency Payment Gateway for WooCommerce 9 * Version: 1.4. 79 * Version: 1.4.8 10 10 * Author: CryptoWoo AS 11 11 * Author URI: https://www.cryptowoo.com … … 16 16 * 17 17 * Tested up to: 6.3 18 * WC tested up to: 8. 018 * WC tested up to: 8.2 19 19 * WC requires at least: 3.0 20 20 * … … 45 45 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 46 */ 47 define( 'CWOO_VERSION', '1.4. 7' );47 define( 'CWOO_VERSION', '1.4.8' ); 48 48 define( 'CWOO_FILE', 'cryptocurrency-payment-gateway/cryptocurrency-payment-gateway.php' ); 49 49 define( 'CWOO_PLUGIN_PATH', plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) . '/' ); … … 943 943 $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], false, $order->get_currency() ); 944 944 945 // If exchange rate is zero at this point we must re-attempt. 946 if ( empty( $price ) ) { 947 CW_AdminMain::cryptowoo_log_data( 0, __FUNCTION__, date( 'Y-m-d H:i:s' ) . ' Exchange rate is empty, the value is: ' . var_export( $price, true ) . ', retrying to get exchange rate now, Status: ' . var_export( $payment_details, true ), 'error' ); 948 $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], true, $order->get_currency() ); 949 } 950 945 951 // Aelia currency switcher: Get the order amount in the active currency 946 952 if ( CW_ExchangeRates::tools()->currency_is_fiat( $currency ) && cw_get_woocommerce_default_currency() !== $currency ) { … … 951 957 $price = apply_filters( 'wcml_raw_price_amount', $price, $order->get_currency() ); 952 958 953 // If exchange rate is zero at this point we must re-attempt.954 if ( empty( $price ) ) {955 CW_AdminMain::cryptowoo_log_data( 0, __FUNCTION__, date( 'Y-m-d H:i:s' ) . ' Exchange rate is empty, the value is: ' . var_export( $price, true ) . ', retrying to get exchange rate now, Status: ' . var_export( $payment_details, true ), 'error' );956 CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], true, $order->get_currency() );957 }958 959 // If the exchange rate is still empty we must redirect to cart and show an error to the user. 959 960 if ( empty( $price ) ) { -
cryptocurrency-payment-gateway/trunk/includes/class.exchange-rates.php
r2634120 r2972696 26 26 * - OKCoin.cn 27 27 * - Kraken 28 * - Livecoin.net29 28 * 30 29 * Some functions modified from "Bitcoin Payments for WooCommerce" -
cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-blockchaincom.php
r2730993 r2972696 54 54 /** 55 55 * 56 * Get the stale index in exchange result. 57 * Default is '' (no stale index in result) 58 * 59 * @return string 60 */ 61 protected function get_exchange_stale_index() : string { 62 return 'has_no_volume'; 63 } 64 65 /** 66 * 56 67 * Is the exchange rate search pair uppercase or lowercase in the api url? 57 68 * … … 61 72 return true; 62 73 } 74 75 /** 76 * 77 * Format the price data from exchange result to default data format 78 * 79 * @param stdClass $price_data Json decoded result from exchange api call. 80 * 81 * @return stdClass 82 */ 83 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 84 $price_data->{$this->get_exchange_stale_index()} = empty( $price_data->volume_24h ); 85 86 return $price_data; 87 } 63 88 } -
cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-okcoin.php
r2634120 r2972696 23 23 */ 24 24 protected function get_exchange_url_format() : string { 25 return 'https://www.okcoin.com/api/v 1/ticker.do?symbol=%s';25 return 'https://www.okcoin.com/api/v5/market/ticker?instId=%s'; 26 26 } 27 27 … … 43 43 */ 44 44 protected function get_pair_format() : string { 45 return '%2$s_%1$s'; 45 return '%2$s-%1$s'; 46 } 47 48 /** 49 * 50 * Is the exchange rate search pair uppercase or lowercase in the api url? 51 * Default is lower case. 52 * 53 * @return bool 54 */ 55 protected function search_pair_is_uppercase(): bool { 56 return true; 46 57 } 47 58 … … 55 66 */ 56 67 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 57 if ( isset( $price_data->ticker ) && $price_data->ticker instanceof stdClass ) { 58 if ( isset( $price_data->date ) ) { 59 $price_data->ticker->timestamp = $price_data->date; 68 if ( isset( $price_data->data ) && is_array( $price_data->data ) ) { 69 $data = current( $price_data->data ); 70 if ( $data instanceof stdClass ) { 71 if ( isset( $data->ts ) ) { 72 $data->timestamp = $data->ts; 73 } 74 75 return $data; 60 76 } 61 62 return $price_data->ticker;63 77 } 64 78 -
cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-poloniex.php
r2634120 r2972696 23 23 */ 24 24 protected function get_exchange_url_format() : string { 25 return 'https:// poloniex.com/public?command=returnTicker';25 return 'https://api.poloniex.com/markets/%s/price'; 26 26 } 27 27 … … 33 33 */ 34 34 protected function get_exchange_price_index() : string { 35 return ' last';35 return 'price'; 36 36 } 37 37 … … 43 43 */ 44 44 protected function get_pair_format() : string { 45 return '% 1$s_%2$s';45 return '%2$s_%1$s'; 46 46 } 47 47 … … 56 56 } 57 57 58 /** 59 * 60 * Get the stale index in exchange result. 61 * Default is '' (no stale index in result) 62 * 63 * @return string 64 */ 65 protected function get_exchange_stale_index() : string { 66 return 'isFrozen'; 67 } 68 69 /** 70 * 71 * Format the price data from exchange result to default data format 58 /** Format the price data from exchange result to default data format 72 59 * 73 60 * @param stdClass $price_data Json decoded result from exchange api call. … … 76 63 */ 77 64 protected function format_price_data_from_exchange( stdClass $price_data ) : stdClass { 78 $pair = $this->get_search_pair(); 79 if ( isset( $price_data->$pair ) && $price_data->$pair instanceof stdClass ) { 80 return $price_data->$pair; 65 if ( ! empty( $price_data->ts ) && is_numeric( $price_data->ts ) ) { 66 $price_data->timestamp = $price_data->ts; 81 67 } 82 68 -
cryptocurrency-payment-gateway/trunk/readme.txt
r2947271 r2972696 4 4 Requires at least: 4.7 5 5 Tested up to: 6.3 6 Stable tag: 1.4. 76 Stable tag: 1.4.8 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later … … 130 130 == Changelog == 131 131 132 = 1.4.8 = 133 * WooCommerce tested up to 8.2 134 * Fix reattempt exchange rate if missing during checkout 135 * Remove unused redux extension redux-vendor-support 136 * Fix Poloniex price api 137 * Add decimals options 1, 3, 5 and 7 138 * Add check if the data in blockchain.com exchange api is stale 139 * Fix issue getting price from Okcoin for Bitcoin 140 * Add HitBTC price api for bitcoin cash and litecoin 141 * Add FMFW price api for bitcoin cash, dogecoin and litecoin 142 * Add KuCoin price api for bitcoin cash, dogecoin and litecoin 143 * Add Binance price api for dogecoin 144 * Add Coinbase price api for dogecoin and litecoin 145 * Add Bitstamp price api for litecoin 146 * Add BitPay price api for litecoin 147 * Remove Livecoin price api for bitcoin and bitcoin cash 148 * Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin 149 * Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin 150 * Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin 151 * Remove Poloniex price api for BlackCoin 152 * Disable bitcoinaverage price api for bitcoin until we support required api key 153 * Disable blockchain.com price api for bitcoin cash 154 132 155 = 1.4.7 = 133 156 * WordPress tested up to 6.3
Note: See TracChangeset
for help on using the changeset viewer.