Changeset 3180058
- Timestamp:
- 11/01/2024 03:57:17 PM (15 months ago)
- Location:
- multi-crypto-currency-payment/trunk
- Files:
-
- 1 added
- 7 deleted
- 4 edited
-
assets/mccp-admin.css (modified) (2 diffs)
-
assets/mccp.css (modified) (1 diff)
-
inc/activate-plugin.php (deleted)
-
inc/apirone_api (deleted)
-
inc/assets-assign.php (deleted)
-
inc/class-mccp-gateway.php (added)
-
inc/invoice-admin-trait.php (deleted)
-
inc/invoice-class.php (deleted)
-
inc/invoice-db-trait.php (deleted)
-
inc/invoice-utils-trait.php (deleted)
-
mccp.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multi-crypto-currency-payment/trunk/assets/mccp-admin.css
r2839125 r3180058 2 2 3 3 .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 6 10 } 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 7 58 @media only screen and (max-width: 782px){ 8 59 table.form-table.mccp-settings label.currency-label .woocommerce-help-tip { … … 10 61 top: 4px; 11 62 } 63 } 64 65 table.form-table.mccp-settings label.currency-label{ 66 display: flex; 67 align-items: center; 12 68 } 13 69 -
multi-crypto-currency-payment/trunk/assets/mccp.css
r2839125 r3180058 1 . mccp-wrapper {1 .invoice-wrapper { 2 2 height: unset; 3 3 min-height: unset; 4 flex-direction: column; 4 5 } 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 4 4 * Plugin URI: https://github.com/zaytseff/mccp-woo 5 5 * 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 8 7 * Author: Alex Zaytseff 9 8 * Author URI: https://github.com/zaytseff 9 * Tested up to: 6.5 10 10 */ 11 11 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'); 12 defined('ABSPATH') || exit; 17 13 18 14 define('MCCP_ROOT', __DIR__); … … 20 16 define('MCCP_URL', plugin_dir_url(__FILE__)); 21 17 22 require_once('inc/assets-assign.php'); 23 require_once('inc/activate-plugin.php'); 18 use Apirone\API\Log\LoggerWrapper; 19 use Apirone\SDK\Service\InvoiceDb; 20 use Apirone\SDK\Service\InvoiceQuery; 24 21 25 // Add MCCP payment gateway to WooCommerce 26 add_action ('plugin_loaded', 'mccp_payment', 0); 22 if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { 23 return; 24 } 25 26 require_once(__DIR__ . '/vendor/autoload.php'); 27 28 add_filter('woocommerce_payment_gateways', function ($plugins) { 29 return array_merge($plugins, [WC_MCCP::class]); 30 }); 31 32 // Show settings link on plugins page 33 add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) { 34 $url = admin_url('admin.php?page=wc-settings&tab=checkout§ion=mccp'); 35 return array_merge(['<a href="' . $url . '">' . __('Settings') . '</a>'], $links); 36 }); 27 37 28 38 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; 39 if ( 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 } 44 else { 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 } 39 53 40 require_once 'inc/invoice-class.php'; 54 add_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 }); 41 59 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'); 60 add_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 67 if (!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' ); 50 88 } 89 51 90 52 91 /** -
multi-crypto-currency-payment/trunk/readme.txt
r3065019 r3180058 3 3 Contributors: zaytseff 4 4 Tags: accept, bitcoin, litecoin, usdt, crypto 5 Stable tag: 1.2.95 Stable tag: 2.0.0 6 6 Requires PHP: 7.4 7 Tested up to: 6. 57 Tested up to: 6.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 11 WooCommerce plugin - Multi CryptoCurrency Payments 12 Requires at least WooCommerce: 6.0 Tested up to: 8.7.0License: GPLv2 or later12 Requires at least WooCommerce: 6.0 Tested up to: 9.3.3 License: GPLv2 or later 13 13 14 14 == Description == … … 78 78 == Changelog == 79 79 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 80 89 = Version 1.2.9 | 04/04/2024 = 81 90 - Add settings saver when account recreated
Note: See TracChangeset
for help on using the changeset viewer.