Plugin Directory

Changeset 2972696


Ignore:
Timestamp:
09/28/2023 03:05:09 PM (3 years ago)
Author:
CryptoWoo
Message:

Updating to version 1.4.8

Location:
cryptocurrency-payment-gateway
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cryptocurrency-payment-gateway/tags/1.4.8/admin/options-init.php

    r2877204 r2972696  
    941941        'blockchaincom'   => 'Blockchain.com',
    942942        'blockio'         => 'Block.io (Enter API keys in "Wallet Settings")',
    943         'bitcoinaverage'  => 'BitcoinAverage',
     943        // 'bitcoinaverage'  => 'BitcoinAverage', TODO: Add back with API requirement.
    944944        'bitpay'          => 'BitPay',
    945945        'bitstamp'        => 'Bitstamp',
     
    954954        'kraken'          => 'Kraken',
    955955        'gemini'          => 'Gemini',
    956         'livecoin'        => 'Livecoin',
    957         'coinflex'        => 'CoinFLEX',
    958956    );
    959957
     
    12551253        'kraken'          => array( 'EUR', 'GBP', 'USD', 'CAD' ),
    12561254        'gemini'          => array( 'USD', 'EUR', 'GBP', 'SGD' ),
    1257         'livecoin'        => array( 'EUR', 'USD' ),
    1258         'coinflex'        => array( 'USD' ),
    12591255    );
    12601256
     
    44764472                'options'           => array(
    44774473                    '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.
    44794475                    'binance'       => 'Binance',
    44804476                    'coinbase'      => 'Coinbase',
    44814477                    'kraken'        => 'Kraken',
    44824478                    'gemini'        => 'Gemini',
    4483                     'bittrex'       => 'Bittrex',
    44844479                    'poloniex'      => 'Poloniex',
    44854480                    // 'bitfinex'   => 'Bitfinex', TODO: Add bitfinex, only the pair BCHN:USD is supported.
    44864481                    'bitstamp'      => 'Bitstamp',
    44874482                    'bitpay'        => 'BitPay',
    4488                     'shapeshift'    => 'ShapeShift',
    4489                     'livecoin'      => 'Livecoin',
    4490                     'okcoin'        => 'OKCoin.com',
    4491                     'coinflex'      => 'CoinFLEX',
     4483                    'hitbtc'        => 'HitBTC',
     4484                    'fmfw'          => 'FMFW',
     4485                    'kucoin'        => 'KuCoin',
    44924486                ),
    44934487                'default'           => 'coingecko',
     
    45104504                'options'           => array(
    45114505                    'coingecko'       => 'CoinGecko',
     4506                    'binance'         => 'Binance',
     4507                    'coinbase'        => 'Coinbase',
    45124508                    // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com.
    45134509                    'kraken'          => 'Kraken',
     
    45154511                    'blockio'         => 'Block.io (Enter API keys in "Wallet Settings")',
    45164512                    'dogecoinaverage' => 'DogecoinAverage.com',
    4517                     'shapeshift'      => 'ShapeShift',
    45184513                    'poloniex'        => 'Poloniex',
    4519                     'bittrex'         => 'Bittrex',
    4520                     'coinflex'        => 'CoinFLEX',
     4514                    //'hitbtc'          => 'HitBTC', erroneous price, differs largely from global prices!
     4515                    'fmfw'            => 'FMFW',
     4516                    'kucoin'          => 'KuCoin',
    45214517                ),
    45224518                'default'           => 'coingecko',
     
    45364532                'options'           => array(
    45374533                    'coingecko'     => 'CoinGecko',
     4534                    'binance'       => 'Binance',
     4535                    'coinbase'      => 'Coinbase',
    45384536                    // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com.
    45394537                    'kraken'        => 'Kraken',
     
    45424540                    //'btc_e'             => 'BTC-e',
    45434541                    'bitfinex'      => 'Bitfinex',
    4544                     'shapeshift'    => 'ShapeShift',
    45454542                    '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',
    45494548                ),
    45504549                'default'           => 'coingecko',
     
    45634562                ),
    45644563                'options'        => array(
    4565                     'coingecko'  => 'CoinGecko',
    4566                     'shapeshift' => 'ShapeShift',
    4567                     'poloniex'   => 'Poloniex',
    4568                     'bittrex'    => 'Bittrex',
     4564                    'coingecko' => 'CoinGecko',
    45694565                ),
    45704566                'default'           => 'coingecko',
     
    45964592                'desc'     => '',
    45974593                'options'  => array(
     4594                    1 => '1',
    45984595                    2 => '2',
     4596                    3 => '3',
    45994597                    4 => '4',
     4598                    5 => '5',
    46004599                    6 => '6',
     4600                    7 => '7',
    46014601                    8 => '8',
    46024602                ),
     
    46174617                ),
    46184618                'options'  => array(
     4619                    1 => '1',
    46194620                    2 => '2',
     4621                    3 => '3',
    46204622                    4 => '4',
     4623                    5 => '5',
    46214624                    6 => '6',
     4625                    7 => '7',
    46224626                    8 => '8',
    46234627                ),
     
    46324636                'desc'     => '',
    46334637                'options'  => array(
     4638                    1 => '1',
    46344639                    2 => '2',
     4640                    3 => '3',
    46354641                    4 => '4',
     4642                    5 => '5',
    46364643                    6 => '6',
     4644                    7 => '7',
    46374645                    8 => '8',
    46384646                ),
     
    46474655                'desc'     => '',
    46484656                'options'  => array(
    4649                     0 => '0',
     4657                    1 => '1',
    46504658                    2 => '2',
     4659                    3 => '3',
    46514660                    4 => '4',
     4661                    5 => '5',
    46524662                    6 => '6',
     4663                    7 => '7',
    46534664                    8 => '8',
    46544665                ),
     
    46634674                'desc'     => '',
    46644675                'options'  => array(
    4665                     0 => '0',
     4676                    1 => '1',
    46664677                    2 => '2',
     4678                    3 => '3',
    46674679                    4 => '4',
     4680                    5 => '5',
    46684681                    6 => '6',
     4682                    7 => '7',
    46694683                    8 => '8',
    46704684                ),
  • cryptocurrency-payment-gateway/tags/1.4.8/changelog

    r2947271 r2972696  
    1 = 1.4.7 2023-08-03
     1=1.4.8 2023-09-28 =
     2WooCommerce tested up to 8.2
     3Fix reattempt exchange rate if missing during checkout
     4Remove unused redux extension redux-vendor-support
     5Fix Poloniex price api
     6Add decimals options 1, 3, 5 and 7
     7Add check if the data in blockchain.com exchange api is stale
     8Fix issue getting price from Okcoin for Bitcoin
     9Add HitBTC price api for bitcoin cash and litecoin
     10Add FMFW price api for bitcoin cash, dogecoin and litecoin
     11Add KuCoin price api for bitcoin cash, dogecoin and litecoin
     12Add Binance price api for dogecoin
     13Add Coinbase price api for dogecoin and litecoin
     14Add Bitstamp price api for litecoin
     15Add BitPay price api for litecoin
     16Remove Livecoin price api for bitcoin and bitcoin cash
     17Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin
     18Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin
     19Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin
     20Remove Poloniex price api for BlackCoin
     21Disable bitcoinaverage price api for bitcoin until we support required api key
     22Disable blockchain.com price api for bitcoin cash
     23
     24= 1.4.7 2023-08-03 =
    225WordPress tested up to 6.3
    326WooCommerce tested up to 8.0
  • cryptocurrency-payment-gateway/tags/1.4.8/cryptocurrency-payment-gateway.php

    r2947271 r2972696  
    77 * Plugin URI: https://www.cryptowoo.com/
    88 * Description: Digital Currency Payment Gateway for WooCommerce
    9  * Version: 1.4.7
     9 * Version: 1.4.8
    1010 * Author: CryptoWoo AS
    1111 * Author URI: https://www.cryptowoo.com
     
    1616 *
    1717 * Tested up to: 6.3
    18  * WC tested up to: 8.0
     18 * WC tested up to: 8.2
    1919 * WC requires at least: 3.0
    2020 *
     
    4545OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    4646 */
    47 define( 'CWOO_VERSION', '1.4.7' );
     47define( 'CWOO_VERSION', '1.4.8' );
    4848define( 'CWOO_FILE', 'cryptocurrency-payment-gateway/cryptocurrency-payment-gateway.php' );
    4949define( 'CWOO_PLUGIN_PATH', plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) . '/' );
     
    943943                    $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], false, $order->get_currency() );
    944944
     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
    945951                    // Aelia currency switcher: Get the order amount in the active currency
    946952                    if ( CW_ExchangeRates::tools()->currency_is_fiat( $currency ) && cw_get_woocommerce_default_currency() !== $currency ) {
     
    951957                    $price = apply_filters( 'wcml_raw_price_amount', $price, $order->get_currency() );
    952958
    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                     }
    958959                    // If the exchange rate is still empty we must redirect to cart and show an error to the user.
    959960                    if ( empty( $price ) ) {
  • cryptocurrency-payment-gateway/tags/1.4.8/includes/class.exchange-rates.php

    r2634120 r2972696  
    2626 * - OKCoin.cn
    2727 * - Kraken
    28  * - Livecoin.net
    2928 *
    3029 * 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  
    5454    /**
    5555     *
     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     *
    5667     * Is the exchange rate search pair uppercase or lowercase in the api url?
    5768     *
     
    6172        return true;
    6273    }
     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    }
    6388}
  • cryptocurrency-payment-gateway/tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-okcoin.php

    r2634120 r2972696  
    2323     */
    2424    protected function get_exchange_url_format() : string {
    25         return 'https://www.okcoin.com/api/v1/ticker.do?symbol=%s';
     25        return 'https://www.okcoin.com/api/v5/market/ticker?instId=%s';
    2626    }
    2727
     
    4343     */
    4444    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;
    4657    }
    4758
     
    5566     */
    5667    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;
    6076            }
    61 
    62             return $price_data->ticker;
    6377        }
    6478
  • cryptocurrency-payment-gateway/tags/1.4.8/includes/pricing/exchanges/class-cw-exchange-poloniex.php

    r2634120 r2972696  
    2323     */
    2424    protected function get_exchange_url_format() : string {
    25         return 'https://poloniex.com/public?command=returnTicker';
     25        return 'https://api.poloniex.com/markets/%s/price';
    2626    }
    2727
     
    3333     */
    3434    protected function get_exchange_price_index() : string {
    35         return 'last';
     35        return 'price';
    3636    }
    3737
     
    4343     */
    4444    protected function get_pair_format() : string {
    45         return '%1$s_%2$s';
     45        return '%2$s_%1$s';
    4646    }
    4747
     
    5656    }
    5757
    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
    7259     *
    7360     * @param stdClass $price_data Json decoded result from exchange api call.
     
    7663     */
    7764    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;
    8167        }
    8268
  • cryptocurrency-payment-gateway/tags/1.4.8/readme.txt

    r2947271 r2972696  
    44Requires at least: 4.7
    55Tested up to: 6.3
    6 Stable tag: 1.4.7
     6Stable tag: 1.4.8
    77Requires PHP: 7.3
    88License: GPLv2 or later
     
    130130== Changelog ==
    131131
     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
    132155= 1.4.7 =
    133156* WordPress tested up to 6.3
  • cryptocurrency-payment-gateway/trunk/admin/options-init.php

    r2877204 r2972696  
    941941        'blockchaincom'   => 'Blockchain.com',
    942942        'blockio'         => 'Block.io (Enter API keys in "Wallet Settings")',
    943         'bitcoinaverage'  => 'BitcoinAverage',
     943        // 'bitcoinaverage'  => 'BitcoinAverage', TODO: Add back with API requirement.
    944944        'bitpay'          => 'BitPay',
    945945        'bitstamp'        => 'Bitstamp',
     
    954954        'kraken'          => 'Kraken',
    955955        'gemini'          => 'Gemini',
    956         'livecoin'        => 'Livecoin',
    957         'coinflex'        => 'CoinFLEX',
    958956    );
    959957
     
    12551253        'kraken'          => array( 'EUR', 'GBP', 'USD', 'CAD' ),
    12561254        'gemini'          => array( 'USD', 'EUR', 'GBP', 'SGD' ),
    1257         'livecoin'        => array( 'EUR', 'USD' ),
    1258         'coinflex'        => array( 'USD' ),
    12591255    );
    12601256
     
    44764472                'options'           => array(
    44774473                    '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.
    44794475                    'binance'       => 'Binance',
    44804476                    'coinbase'      => 'Coinbase',
    44814477                    'kraken'        => 'Kraken',
    44824478                    'gemini'        => 'Gemini',
    4483                     'bittrex'       => 'Bittrex',
    44844479                    'poloniex'      => 'Poloniex',
    44854480                    // 'bitfinex'   => 'Bitfinex', TODO: Add bitfinex, only the pair BCHN:USD is supported.
    44864481                    'bitstamp'      => 'Bitstamp',
    44874482                    'bitpay'        => 'BitPay',
    4488                     'shapeshift'    => 'ShapeShift',
    4489                     'livecoin'      => 'Livecoin',
    4490                     'okcoin'        => 'OKCoin.com',
    4491                     'coinflex'      => 'CoinFLEX',
     4483                    'hitbtc'        => 'HitBTC',
     4484                    'fmfw'          => 'FMFW',
     4485                    'kucoin'        => 'KuCoin',
    44924486                ),
    44934487                'default'           => 'coingecko',
     
    45104504                'options'           => array(
    45114505                    'coingecko'       => 'CoinGecko',
     4506                    'binance'         => 'Binance',
     4507                    'coinbase'        => 'Coinbase',
    45124508                    // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com.
    45134509                    'kraken'          => 'Kraken',
     
    45154511                    'blockio'         => 'Block.io (Enter API keys in "Wallet Settings")',
    45164512                    'dogecoinaverage' => 'DogecoinAverage.com',
    4517                     'shapeshift'      => 'ShapeShift',
    45184513                    'poloniex'        => 'Poloniex',
    4519                     'bittrex'         => 'Bittrex',
    4520                     'coinflex'        => 'CoinFLEX',
     4514                    //'hitbtc'          => 'HitBTC', erroneous price, differs largely from global prices!
     4515                    'fmfw'            => 'FMFW',
     4516                    'kucoin'          => 'KuCoin',
    45214517                ),
    45224518                'default'           => 'coingecko',
     
    45364532                'options'           => array(
    45374533                    'coingecko'     => 'CoinGecko',
     4534                    'binance'       => 'Binance',
     4535                    'coinbase'      => 'Coinbase',
    45384536                    // 'blockchaincom' => 'Blockchain.com', TODO: When supporting getting altcoin prices from USD price as base currency, add support for blockchain.com.
    45394537                    'kraken'        => 'Kraken',
     
    45424540                    //'btc_e'             => 'BTC-e',
    45434541                    'bitfinex'      => 'Bitfinex',
    4544                     'shapeshift'    => 'ShapeShift',
    45454542                    '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',
    45494548                ),
    45504549                'default'           => 'coingecko',
     
    45634562                ),
    45644563                'options'        => array(
    4565                     'coingecko'  => 'CoinGecko',
    4566                     'shapeshift' => 'ShapeShift',
    4567                     'poloniex'   => 'Poloniex',
    4568                     'bittrex'    => 'Bittrex',
     4564                    'coingecko' => 'CoinGecko',
    45694565                ),
    45704566                'default'           => 'coingecko',
     
    45964592                'desc'     => '',
    45974593                'options'  => array(
     4594                    1 => '1',
    45984595                    2 => '2',
     4596                    3 => '3',
    45994597                    4 => '4',
     4598                    5 => '5',
    46004599                    6 => '6',
     4600                    7 => '7',
    46014601                    8 => '8',
    46024602                ),
     
    46174617                ),
    46184618                'options'  => array(
     4619                    1 => '1',
    46194620                    2 => '2',
     4621                    3 => '3',
    46204622                    4 => '4',
     4623                    5 => '5',
    46214624                    6 => '6',
     4625                    7 => '7',
    46224626                    8 => '8',
    46234627                ),
     
    46324636                'desc'     => '',
    46334637                'options'  => array(
     4638                    1 => '1',
    46344639                    2 => '2',
     4640                    3 => '3',
    46354641                    4 => '4',
     4642                    5 => '5',
    46364643                    6 => '6',
     4644                    7 => '7',
    46374645                    8 => '8',
    46384646                ),
     
    46474655                'desc'     => '',
    46484656                'options'  => array(
    4649                     0 => '0',
     4657                    1 => '1',
    46504658                    2 => '2',
     4659                    3 => '3',
    46514660                    4 => '4',
     4661                    5 => '5',
    46524662                    6 => '6',
     4663                    7 => '7',
    46534664                    8 => '8',
    46544665                ),
     
    46634674                'desc'     => '',
    46644675                'options'  => array(
    4665                     0 => '0',
     4676                    1 => '1',
    46664677                    2 => '2',
     4678                    3 => '3',
    46674679                    4 => '4',
     4680                    5 => '5',
    46684681                    6 => '6',
     4682                    7 => '7',
    46694683                    8 => '8',
    46704684                ),
  • cryptocurrency-payment-gateway/trunk/changelog

    r2947271 r2972696  
    1 = 1.4.7 2023-08-03
     1=1.4.8 2023-09-28 =
     2WooCommerce tested up to 8.2
     3Fix reattempt exchange rate if missing during checkout
     4Remove unused redux extension redux-vendor-support
     5Fix Poloniex price api
     6Add decimals options 1, 3, 5 and 7
     7Add check if the data in blockchain.com exchange api is stale
     8Fix issue getting price from Okcoin for Bitcoin
     9Add HitBTC price api for bitcoin cash and litecoin
     10Add FMFW price api for bitcoin cash, dogecoin and litecoin
     11Add KuCoin price api for bitcoin cash, dogecoin and litecoin
     12Add Binance price api for dogecoin
     13Add Coinbase price api for dogecoin and litecoin
     14Add Bitstamp price api for litecoin
     15Add BitPay price api for litecoin
     16Remove Livecoin price api for bitcoin and bitcoin cash
     17Remove CoinFlex price api for bitcoin, bitcoin cash, dogecoin and litecoin
     18Remove ShapeShift price api for bitcoin cash, dogecoin, litecoin and blackcoin
     19Remove Bittrex price api for bitcoin cash, dogecoin, litecoin, blackcoin
     20Remove Poloniex price api for BlackCoin
     21Disable bitcoinaverage price api for bitcoin until we support required api key
     22Disable blockchain.com price api for bitcoin cash
     23
     24= 1.4.7 2023-08-03 =
    225WordPress tested up to 6.3
    326WooCommerce tested up to 8.0
  • cryptocurrency-payment-gateway/trunk/cryptocurrency-payment-gateway.php

    r2947271 r2972696  
    77 * Plugin URI: https://www.cryptowoo.com/
    88 * Description: Digital Currency Payment Gateway for WooCommerce
    9  * Version: 1.4.7
     9 * Version: 1.4.8
    1010 * Author: CryptoWoo AS
    1111 * Author URI: https://www.cryptowoo.com
     
    1616 *
    1717 * Tested up to: 6.3
    18  * WC tested up to: 8.0
     18 * WC tested up to: 8.2
    1919 * WC requires at least: 3.0
    2020 *
     
    4545OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    4646 */
    47 define( 'CWOO_VERSION', '1.4.7' );
     47define( 'CWOO_VERSION', '1.4.8' );
    4848define( 'CWOO_FILE', 'cryptocurrency-payment-gateway/cryptocurrency-payment-gateway.php' );
    4949define( 'CWOO_PLUGIN_PATH', plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) . '/' );
     
    943943                    $price = CW_ExchangeRates::processing()->get_exchange_rate( $wallet_config['request_coin'], false, $order->get_currency() );
    944944
     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
    945951                    // Aelia currency switcher: Get the order amount in the active currency
    946952                    if ( CW_ExchangeRates::tools()->currency_is_fiat( $currency ) && cw_get_woocommerce_default_currency() !== $currency ) {
     
    951957                    $price = apply_filters( 'wcml_raw_price_amount', $price, $order->get_currency() );
    952958
    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                     }
    958959                    // If the exchange rate is still empty we must redirect to cart and show an error to the user.
    959960                    if ( empty( $price ) ) {
  • cryptocurrency-payment-gateway/trunk/includes/class.exchange-rates.php

    r2634120 r2972696  
    2626 * - OKCoin.cn
    2727 * - Kraken
    28  * - Livecoin.net
    2928 *
    3029 * Some functions modified from "Bitcoin Payments for WooCommerce"
  • cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-blockchaincom.php

    r2730993 r2972696  
    5454    /**
    5555     *
     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     *
    5667     * Is the exchange rate search pair uppercase or lowercase in the api url?
    5768     *
     
    6172        return true;
    6273    }
     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    }
    6388}
  • cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-okcoin.php

    r2634120 r2972696  
    2323     */
    2424    protected function get_exchange_url_format() : string {
    25         return 'https://www.okcoin.com/api/v1/ticker.do?symbol=%s';
     25        return 'https://www.okcoin.com/api/v5/market/ticker?instId=%s';
    2626    }
    2727
     
    4343     */
    4444    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;
    4657    }
    4758
     
    5566     */
    5667    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;
    6076            }
    61 
    62             return $price_data->ticker;
    6377        }
    6478
  • cryptocurrency-payment-gateway/trunk/includes/pricing/exchanges/class-cw-exchange-poloniex.php

    r2634120 r2972696  
    2323     */
    2424    protected function get_exchange_url_format() : string {
    25         return 'https://poloniex.com/public?command=returnTicker';
     25        return 'https://api.poloniex.com/markets/%s/price';
    2626    }
    2727
     
    3333     */
    3434    protected function get_exchange_price_index() : string {
    35         return 'last';
     35        return 'price';
    3636    }
    3737
     
    4343     */
    4444    protected function get_pair_format() : string {
    45         return '%1$s_%2$s';
     45        return '%2$s_%1$s';
    4646    }
    4747
     
    5656    }
    5757
    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
    7259     *
    7360     * @param stdClass $price_data Json decoded result from exchange api call.
     
    7663     */
    7764    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;
    8167        }
    8268
  • cryptocurrency-payment-gateway/trunk/readme.txt

    r2947271 r2972696  
    44Requires at least: 4.7
    55Tested up to: 6.3
    6 Stable tag: 1.4.7
     6Stable tag: 1.4.8
    77Requires PHP: 7.3
    88License: GPLv2 or later
     
    130130== Changelog ==
    131131
     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
    132155= 1.4.7 =
    133156* WordPress tested up to 6.3
Note: See TracChangeset for help on using the changeset viewer.