Plugin Directory

Changeset 2145243


Ignore:
Timestamp:
08/26/2019 12:39:04 AM (7 years ago)
Author:
nomiddleman
Message:

Added USDC and DGB autopay.

Location:
nomiddleman-crypto-payments-for-woocommerce/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • nomiddleman-crypto-payments-for-woocommerce/trunk/README.txt

    r2144969 r2145243  
    11=== Nomiddleman Bitcoin and Crypto Payments for WooCommerce ===
    22Contributors: nomiddleman
     3Donate link: https://nomiddlemancrypto.io/donate/
    34Tags: bitcoin, cryptocurrency, woocommerce, bitcoin payment, crypto, btc, payments, ethereum, ether, ethereum token, token, gas, e-commerce, ecommerce, monero, dogecoin, pay with crypto, pay with bitcoin, bitcoin payments, bitcoin payment gateway, crypto woo, accept, dash, litecoin, cash, gateway, payment gateway, woocommerce gateway, wordpress, electrum, mpk, master public key, hd wallet, address, zcash, bitcore, bitcoin cash, bitcoin gold, blackcoin, dash, deeponion, ethereum classic, ripple, vericoin, eos, bitcoin sv, vechain, tron, stellar, rep, bch, btg, blk, dash, onion, doge, eth, etc, ltc, xmr, xrp, vrc, zec, eos, bsv, vet, trx, xlm, no fees, no middleman, freedom, nomiddleman, no fees, free, for free, free crypto plugin, plugin, plug-in, no middleman, binance coin, bnb, iota, miota, maker, mkr, nem, xem, waves, ontology, ont, omisego, omg, holo, hot, chainlink, link, decred, dcr, basic attention token, bat, 0x, zrx, lisk, lsk, bytecoin, bcn, bitcoin diamond, bcd, digibyte, dgb, gemini dollar, gusd, potcoin, pot, risk, high-risk, coin, mineable, erc20 token, erc20, KYC, No KYC, No registration, No login, processing, processor, groestlcoin, bitcore
    45Requires at least: 3.0.1
     
    67Requires PHP: 5.2.4
    78License: GPL v3
    8 Stable Tag: 2.4.5
     9Stable Tag: 2.4.6
    910
    1011Absolutely the easiest setup in the industry. No registration. No API keys. No middleman. Accept bitcoin, ethereum, litecoin, and more.
     
    106107
    107108= 2.4.5 =
     109* Added USDC Classic/Autopay
     110* Added DGB Autopay
     111
     112= 2.4.5 =
    108113* Updated Autopay endpoints for BTC and LTC
    109114
  • nomiddleman-crypto-payments-for-woocommerce/trunk/nomiddleman-crypto-woocommerce.php

    r2144969 r2145243  
    22/*
    33WC requires at least: 3.0.0
    4 WC tested up to: 3.6.5
     4WC tested up to: 3.7.0
    55Plugin Name: Nomiddleman Bitcoin and Crypto Payments for WooCommerce
    66Plugin URI:  https://wordpress.org/plugins/nomiddleman-crypto-payments-for-woocommerce/
     
    99Author URI: https://nomiddlemancrypto.io
    1010
    11 Version: 2.4.5
     11Version: 2.4.6
    1212Copyright: © 2019 Nomiddleman Crypto (email : support@nomiddlemancrypto.io)
    1313License: GNU General Public License v3.0
     
    4242
    4343    define('NMM_CRON_JOB_URL', plugins_url('', __FILE__) . '/src/NMM_Cron.php');
    44     define('NMM_VERSION', '2.4.5');
     44    define('NMM_VERSION', '2.4.6');
    4545   
    4646    define('NMM_REDUX_SLUG', 'nmmpro_options');
  • nomiddleman-crypto-payments-for-woocommerce/trunk/src/NMM_Blockchain.php

    r2144969 r2145243  
    838838    }
    839839
     840    public static function get_dgb_address_transactions($address) {
     841        $args = array('timeout' => 25);
     842        $request = 'https://explorer-1.us.digibyteservers.io/api/txs/?address=' . $address;
     843
     844        $response = wp_remote_get($request, $args);
     845
     846        if (is_wp_error($response) || $response['response']['code'] !== 200) {
     847            NMM_Util::log(__FILE__, __LINE__, 'FAILED API CALL ( ' . $request . ' ): ' . print_r($response, true));
     848
     849            //TODO: https://digiexplorer.info/
     850            $result = array(
     851                'result' => 'error',
     852                'total_received' => '',
     853            );
     854
     855            return $result;
     856        }
     857
     858        $body = json_decode($response['body']);
     859
     860        $rawTransactions = $body->txs;
     861        if (!is_array($rawTransactions)) {
     862            $result = array(
     863                'result' => 'error',
     864                'message' => 'No transactions found',
     865            );
     866
     867            return $result;
     868        }
     869        $transactions = array();
     870        foreach ($rawTransactions as $rawTransaction) {
     871            foreach ($rawTransaction->vout as $vout) {
     872                if ($vout->scriptPubKey->addresses[0] === $address) {
     873                    $transactions[] = new NMM_Transaction($vout->value * 100000000,
     874                        $rawTransaction->confirmations,
     875                        $rawTransaction->time,
     876                        $rawTransaction->txid);
     877                }
     878            }
     879
     880
     881        }
     882
     883        $result = array (
     884            'result' => 'success',
     885            'transactions' => $transactions,
     886        );
     887
     888        return $result;
     889    }
     890
    840891    public static function get_eos_address_transactions($address) {
    841892       
     
    10341085        return $result;
    10351086    }
    1036 
    1037     //https://groestlsight.groestlcoin.org/api/txs?address=
    1038     //32QrhXp8cTmKj4VUDPe334Eq7uFcsR2rYz
    1039     //FYoKoGrSXGpTavNFVbvW18UYxo6JVbUDDa
    1040     // /grs1
    10411087
    10421088    public static function get_lsk_address_transactions($address) {
  • nomiddleman-crypto-payments-for-woocommerce/trunk/src/NMM_Cryptocurrencies.php

    r2144969 r2145243  
    1919            // auto-pay coins           
    2020            'ETH' => new NMM_Cryptocurrency('ETH', 'Ethereum', 18, 'ethereum_logo_small.png', 60, 'Ξ', false, true, true, ''),
    21             'DGB' => new NMM_Cryptocurrency('DGB', 'Digibyte', 8, 'digibyte_logo_small.png', 60, '', false, false, true, ''),
     21            'DGB' => new NMM_Cryptocurrency('DGB', 'Digibyte', 8, 'digibyte_logo_small.png', 60, '', false, true, true, ''),
    2222            'ZEC' => new NMM_Cryptocurrency('ZEC', 'Zcash', 8, 'zcash_logo_small.png', 60, 'ⓩ', false, true, true, ''),
    2323            'DCR' => new NMM_Cryptocurrency('DCR', 'Decred', 8, 'decred_logo_small.png', 60, '', false, true, true, ''),           
     
    4949            'MLN' => new NMM_Cryptocurrency('MLN', 'Melon', 18, 'melon_logo_small.png', 60, '', false, true, true, '0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1'),
    5050            'ZRX' => new NMM_Cryptocurrency('ZRX', '0x', 18, '0x_logo_small.png', 60, '', false, true, true, '0xe41d2489571d322189246dafa5ebde1f4699f498'),
    51            
     51            'USDC' => new NMM_Cryptocurrency('USDC', 'USDC', 6, 'usdc_logo_small.png', 60, '', false, true, true, '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'),
    5252
    5353            // no support
     
    323323            return preg_match('/^APL-[a-zA-Z0-9-]{8,42}/', $address);
    324324        }
     325        if ($cryptoId === 'USDC') {
     326            return preg_match('/^0x[a-fA-F0-9]{40,42}/', $address);
     327        }
    325328       
    326329        NMM_Util::log(__FILE__, __LINE__, 'Invalid cryptoId, contact plug-in developer.');       
  • nomiddleman-crypto-payments-for-woocommerce/trunk/src/NMM_Payment.php

    r2144969 r2145243  
    230230            $result = NMM_Blockchain::get_grs_address_transactions($address);   
    231231        }
     232        if ($cryptoId === 'DGB') {
     233            $result = NMM_Blockchain::get_dgb_address_transactions($address);
     234        }
     235        if ($cryptoId === 'USDC') {
     236            $result = NMM_Blockchain::get_erc20_address_transactions('USDC', $address);
     237        }
    232238       
    233239        if ($result['result'] === 'error') {           
Note: See TracChangeset for help on using the changeset viewer.