Plugin Directory

Changeset 3487182


Ignore:
Timestamp:
03/20/2026 12:26:13 PM (2 weeks ago)
Author:
coinsnap
Message:
  1. 1.7.5
Location:
coinsnap-for-woocommerce
Files:
97 added
3 edited

Legend:

Unmodified
Added
Removed
  • coinsnap-for-woocommerce/trunk/coinsnap-for-woocommerce.php

    r3476661 r3487182  
    88 * Text Domain:     coinsnap-for-woocommerce
    99 * Domain Path:     /languages
    10  * Version:         1.7.4
     10 * Version:         1.7.5
    1111 * Requires PHP:    7.4
    1212 * Tested up to:    6.9
     
    1414 * Requires Plugins: woocommerce
    1515 * WC requires at least: 6.0
    16  * WC tested up to: 10.5.3
     16 * WC tested up to: 10.6.1
    1717 * License:         GPL2
    1818 * License URI:     https://www.gnu.org/licenses/gpl-2.0.html
     
    3131defined( 'ABSPATH' ) || exit();
    3232if(!defined('COINSNAP_WC_PHP_VERSION')){define( 'COINSNAP_WC_PHP_VERSION', '7.4' );}
    33 if(!defined('COINSNAP_WC_VERSION')){define( 'COINSNAP_WC_VERSION', '1.7.4' );}
     33if(!defined('COINSNAP_WC_VERSION')){define( 'COINSNAP_WC_VERSION', '1.7.5' );}
    3434if(!defined('COINSNAP_VERSION_KEY')){define( 'COINSNAP_VERSION_KEY', 'coinsnap_version' );}
    3535if(!defined('COINSNAP_PLUGIN_FILE_PATH')){define( 'COINSNAP_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) );}
     
    4949    $this->includes();
    5050        add_action('woocommerce_thankyou_coinsnap', [$this, 'orderStatusThankYouPage'], 10, 1);
    51        
    5251
    5352    // Run the updates.
  • coinsnap-for-woocommerce/trunk/library/Client/Invoice.php

    r3454623 r3487182  
    3030    public function loadExchangeRates(): array {
    3131        $url = 'https://api.coingecko.com/api/v3/exchange_rates';
    32         $headers = [];
     32        $headers = [
     33            'Host' => 'api.coingecko.com',
     34            'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0',
     35            'Accept:' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
     36            'Accept-Language' => 'en-US,en;q=0.9',
     37            'Accept-Encoding' => 'gzip, deflate, br, zstd',
     38            'Connection' => 'keep-alive',
     39            'Priority' => 'u=0, i',
     40        ];
    3341        $method = 'GET';
    34         $response = $this->getHttpClient()->request($method, $url, $headers);
    35        
    36         if ($response->getStatus() === 200) {
    37             $body = json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR);
    38         }
     42        $code = 1000;
     43       
     44        while($code > 399){
     45            if($code !== 1000){ sleep(2); }
     46            $response = $this->getHttpClient()->request($method, $url, $headers);
     47            $code = (int)$response->getStatus();
     48        }
     49       
     50        $body = json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR);       
     51        /*
     52        if ((int)$response->getStatus() < 400) {}
    3953        else {
    40             return array('result' => false, 'error' => 'ratesLoadingError');
    41         }
     54            return array('result' => false, 'error' => 'ratesLoadingError ('.(int)$response->getStatus().')');
     55        }*/
    4256       
    4357        if (count($body)<1 || !isset($body['rates'])){
     
    5064    public function checkPaymentData($amount,$currency,$provider = 'coinsnap',$mode = 'invoice'): array {
    5165       
    52         $btcPayCurrencies = $this->loadExchangeRates();
     66        if(defined('COINSNAP_CURRENCY_RATES')){
     67            $btcPayCurrencies = COINSNAP_CURRENCY_RATES;
     68        }
     69        else {
     70            $btcPayCurrencies = $this->loadExchangeRates();
     71            define('COINSNAP_CURRENCY_RATES',$btcPayCurrencies);
     72        }
    5373           
    5474        if(!$btcPayCurrencies['result']){
     
    147167            'walletMessage' => $walletMessage,
    148168            'checkout' => [
     169                'redirectUrl'           => $redirectUrl,
    149170                'redirectAutomatically' => $redirectAutomatically,
    150171                'redirectUrl' => $redirectUrl,
  • coinsnap-for-woocommerce/trunk/readme.txt

    r3476661 r3487182  
    33Tags: Lightning, SATS, bitcoin, WooCommerce, payment gateway
    44Tested up to: 6.9
    5 Stable tag: 1.7.4
     5Stable tag: 1.7.5
    66License: GPLv2
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    404404= 1.7.4 :: 2026-03-06 =
    405405* Compatibility with WooCommerce 10.5.0 - 10.5.3 is tested.
     406
     407= 1.7.6 :: 2026-03-20 =
     408* Updated currency rates loading functionality.
     409* Compatibility with WooCommerce 10.6.1 is tested.
Note: See TracChangeset for help on using the changeset viewer.