Plugin Directory

Changeset 3180058


Ignore:
Timestamp:
11/01/2024 03:57:17 PM (15 months ago)
Author:
zaytseff
Message:

v2.0.0

Location:
multi-crypto-currency-payment/trunk
Files:
1 added
7 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • multi-crypto-currency-payment/trunk/assets/mccp-admin.css

    r2839125 r3180058  
    22
    33.currency-icon {
    4     width: 32px;
    5     height: 32px;
     4    width: 24px;
     5    height: 24px;
     6    display: inline-block;
     7    margin-right: .25rem;
     8    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/aprn.svg);
     9
    610}
     11
     12.currency-icon.btc {
     13    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/btc.svg);
     14    background-size: cover;
     15}
     16
     17.currency-icon.tbtc {
     18    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/btc.svg);
     19    filter: grayscale();
     20    background-size: cover;
     21}
     22
     23.currency-icon.ltc {
     24    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/ltc.svg);
     25    background-size: cover;
     26}
     27
     28.currency-icon.bch {
     29    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/bch.svg);
     30    background-size: cover;
     31}
     32
     33.currency-icon.doge {
     34    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/doge.svg);
     35    background-size: cover;
     36}
     37
     38.currency-icon.trx {
     39    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/trx.svg);
     40    background-size: cover;
     41}
     42
     43.currency-icon.usdt_trx {
     44    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/usdt_trx.svg);
     45    background-size: cover;
     46}
     47.currency-icon.usdc_trx {
     48    background-image: url(../vendor/apirone/apirone-sdk-php/src/assets/css/icons/crypto/usdc_trx.svg);
     49    background-size: cover;
     50}
     51
     52.token_item {
     53    display: flex;
     54    align-items: center;
     55    margin: .5rem 0;
     56}
     57
    758@media only screen and (max-width: 782px){
    859    table.form-table.mccp-settings label.currency-label .woocommerce-help-tip {
     
    1061        top: 4px;
    1162    }
     63}
     64
     65table.form-table.mccp-settings label.currency-label{
     66    display: flex;
     67    align-items: center;
    1268}
    1369
  • multi-crypto-currency-payment/trunk/assets/mccp.css

    r2839125 r3180058  
    1 .mccp-wrapper {
     1.invoice-wrapper {
    22    height: unset;
    33    min-height: unset;
     4    flex-direction: column;
    45}
     6.invoice-wrapper > .woocommerce-order {
     7    width: 100%;
     8}
     9
     10.invoice-wrapper p {
     11    margin: 0;
     12}
     13
     14.invoice .btn__copy, .invoice .btn__copy:hover, .invoice .btn__copy:focus, .invoice .btn__copy:active,
     15.invoice .btn, .invoice .btn:hover, .invoice .btn:focus, .invoice .btn:active {
     16    outline: none;
     17    border: none;
     18    border-color: unset;
     19    color: unset;
     20}
     21.invoice .btn__copy:hover {
     22    background-color: unset;
     23}
  • multi-crypto-currency-payment/trunk/mccp.php

    r3065019 r3180058  
    44 * Plugin URI: https://github.com/zaytseff/mccp-woo
    55 * Description: Multi currency crypto payments for WooCommerce. Uses Apirone Processing Provider
    6  * Version: 1.2.9
    7  * Tested up to: 6.5
     6 * Version: 2.0.0
    87 * Author: Alex Zaytseff
    98 * Author URI: https://github.com/zaytseff
     9 * Tested up to: 6.5
    1010 */
    1111
    12 if (!defined('ABSPATH'))
    13     exit; // Exit if accessed directly
    14 
    15 require_once('inc/apirone_api/Apirone.php');
    16 require_once('inc/apirone_api/Payment.php');
     12defined('ABSPATH') || exit;
    1713
    1814define('MCCP_ROOT', __DIR__);
     
    2016define('MCCP_URL', plugin_dir_url(__FILE__));
    2117
    22 require_once('inc/assets-assign.php');
    23 require_once('inc/activate-plugin.php');
     18use Apirone\API\Log\LoggerWrapper;
     19use Apirone\SDK\Service\InvoiceDb;
     20use Apirone\SDK\Service\InvoiceQuery;
    2421
    25 // Add MCCP payment gateway to WooCommerce
    26 add_action ('plugin_loaded', 'mccp_payment', 0);
     22if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
     23    return;
     24}
     25
     26require_once(__DIR__ . '/vendor/autoload.php');
     27
     28add_filter('woocommerce_payment_gateways', function ($plugins) {
     29    return array_merge($plugins, [WC_MCCP::class]);
     30});
     31
     32// Show settings link on plugins page
     33add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) {
     34    $url = admin_url('admin.php?page=wc-settings&tab=checkout&section=mccp');
     35    return array_merge(['<a href="' . $url . '">' . __('Settings') . '</a>'], $links);
     36});
    2737
    2838
    29 /**
    30  * Wrapper for MCCP payment gateway class
    31  *
    32  * @return void
    33  */
    34 function mccp_payment() {
    35     if (!class_exists('WC_Payment_Gateway'))
    36         return;
    37     if (class_exists('WC_MCCP'))
    38         return;
     39if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     40    add_action( 'plugins_loaded', function() {
     41        require_once __DIR__ . '/inc/class-mccp-gateway.php';
     42    });
     43}
     44else {
     45    add_action( 'admin_notices', function() {
     46        ?>
     47        <div class="notice notice-error">
     48            <p><?php esc_attr_e( 'Please activate', 'woocommerce' );?> <a href="https://wordpress.org/plugins/woocommerce/"><?php esc_attr_e( 'Woocommerce', 'woocommerce' ); ?></a> <?php esc_attr_e( 'to use MCCP gateway.', 'woocommerce' ); ?></p>
     49        </div>
     50        <?php   
     51    } );
     52}
    3953
    40     require_once 'inc/invoice-class.php';
     54add_action('admin_enqueue_scripts', function() {
     55    if (isset($_GET['page']) && $_GET['page'] === 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] === 'checkout' && isset($_GET['section']) && $_GET['section'] === 'mccp') {
     56        wp_enqueue_style( 'mccp_style', MCCP_URL . 'assets/mccp-admin.css' );
     57    }
     58});
    4159
    42     /**
    43      * Add MCCP gateway to WooCommerce
    44      */
    45     function add_mccp_gateway($methods) {
    46             $methods[] = 'WC_MCCP';
    47             return $methods;
    48     }
    49     add_filter('woocommerce_payment_gateways', 'add_mccp_gateway');
     60add_action('get_footer', function() {
     61        wp_enqueue_style ( 'mccp_style_invoice', MCCP_URL . 'vendor/apirone/apirone-sdk-php/src/assets/css/styles.min.css' );
     62        wp_enqueue_script('mccp_script_invoice', MCCP_URL . '/vendor/apirone/apirone-sdk-php/src/assets/js/script.min.js', array( 'jquery'));
     63        wp_enqueue_style( 'mccp_style', MCCP_URL . 'assets/mccp.css' );
     64    }
     65);
     66
     67if (!function_exists('mccp_create_table')) {
     68    function mccp_create_table() {
     69        global $wpdb;
     70       
     71        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
     72
     73        $sql = InvoiceQuery::createInvoicesTable($wpdb->prefix, $wpdb->charset, $wpdb->collate);
     74
     75        dbDelta($sql);
     76
     77        if ($wpdb->last_error && class_exists('WC_Logger')) {
     78            $log = new WC_Logger();
     79            $log->error($wpdb->last_error, ['source' => 'mccp_install_error']);   
     80        }
     81
     82        // Remove unused options from v1.0.0
     83        if ( get_option('mccp_db_version' ) ){
     84            delete_option('mccp_db_version');
     85        }
     86    }
     87    register_activation_hook( MCCP_MAIN, 'mccp_create_table' );
    5088}
     89
    5190
    5291/**
  • multi-crypto-currency-payment/trunk/readme.txt

    r3065019 r3180058  
    33Contributors: zaytseff
    44Tags: accept, bitcoin, litecoin, usdt, crypto
    5 Stable tag: 1.2.9
     5Stable tag: 2.0.0
    66Requires PHP: 7.4
    7 Tested up to: 6.5
     7Tested up to: 6.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    1111WooCommerce plugin - Multi CryptoCurrency Payments
    12 Requires at least WooCommerce: 6.0 Tested up to: 8.7.0 License: GPLv2 or later
     12Requires at least WooCommerce: 6.0 Tested up to: 9.3.3 License: GPLv2 or later
    1313
    1414== Description ==
     
    7878== Changelog ==
    7979
     80= Version 2.0.0 | 01/11/2024 =
     81- Started using the official Apirone SDK PHP library
     82- New official Apirone invoice design
     83- Splitted networks & tokens on the plugin settings page
     84- Fixed the "lost merchant address" bug for TRON network & tokens
     85
     86= Version 1.2.10 | 11/07/2024 =
     87- Show tbts to unauthenticated users if test_customer is set to * (asterisk symbol)
     88
    8089= Version 1.2.9 | 04/04/2024 =
    8190- Add settings saver when account recreated
Note: See TracChangeset for help on using the changeset viewer.