$args
* @return void
@@ -148,9 +173,9 @@ public function userSettingForm(array $args): void
$address = isset($settings['address']) ? $settings['address'] : '';
if ($this->key == 'dokan_cryptopay') {
- $networks = Helpers::getNetworks()->toArray();
+ $this->networks = Helpers::getNetworks()->toArray();
} else {
- $networks = LiteServices::getNetworks();
+ $this->networks = $this->getNetworksById();
}
?>
@@ -162,7 +187,7 @@ public function userSettingForm(array $args): void
@@ -370,7 +400,7 @@ public function runCryptoPay(): string
if ($this->key == 'dokan_cryptopay') {
return (new Payment($this->key))->setConfirmation(false)->html();
} else {
- return LiteServices::preparePaymentProcess($this->key, false);
+ return (new LitePayment($this->key))->setConfirmation(false)->html();
}
}
}
diff --git a/dokan-cryptopay-withdrawal.php b/dokan-cryptopay-withdrawal.php
index 28e6610..c9f8d3b 100644
--- a/dokan-cryptopay-withdrawal.php
+++ b/dokan-cryptopay-withdrawal.php
@@ -10,7 +10,7 @@
/**
* Plugin Name: Dokan - CryptoPay Withdrawal
- * Version: 1.0.2
+ * Version: 1.0.3
* Plugin URI: https://beycanpress.com/cryptopay/
* Description: Add custom cryptocurrency withdrawal method to Dokan plugin
* Author: BeycanPress LLC
@@ -29,8 +29,9 @@
use BeycanPress\CryptoPayLite\Loader as LiteLoader;
define('DOKAN_CRYPTOPAY_FILE', __FILE__);
-define('DOKAN_CRYPTOPAY_VERSION', '1.0.2');
+define('DOKAN_CRYPTOPAY_VERSION', '1.0.3');
define('DOKAN_CRYPTOPAY_URL', plugin_dir_url(__FILE__));
+define('DOKAN_CRYPTOPAY_PATH', plugin_dir_path(__FILE__));
add_action('plugins_loaded', function (): void {
require_once __DIR__ . '/classes/DokanCryptoPayWithdrawal.php';
diff --git a/readme.txt b/readme.txt
index 9ee39f7..49ff725 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,8 +4,8 @@ Tags: Bitcoin, Ethereum, Binance Smart Chain, Blockchain, Networks, Cryptocurren
Requires at least: 5.0
Tested up to: 6.4.2
Requires PHP: 8.1
-Stable Tag: 1.0.2
-Version: 1.0.2
+Stable Tag: 1.0.3
+Version: 1.0.3
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
diff --git a/resources/mainnets.json b/resources/mainnets.json
new file mode 100644
index 0000000..cfc0d71
--- /dev/null
+++ b/resources/mainnets.json
@@ -0,0 +1,155 @@
+[
+ {
+ "id" : 1,
+ "hexId" : "0x1",
+ "name" : "Ethereum",
+ "code" : "evmchains",
+ "rpcUrl" : "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
+ "explorerUrl" : "https://etherscan.io/",
+ "nativeCurrency" : {
+ "symbol" : "ETH",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "ETH"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xdac17f958d2ee523a2206206994597c13d831ec7"
+ },
+ {
+ "symbol" : "USDC",
+ "address" : "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
+ },
+ {
+ "symbol" : "BUSD",
+ "address" : "0x4Fabb145d64652a948d72533023f6E7A623C7C53"
+ }
+ ]
+ },
+ {
+ "id" : 56,
+ "hexId" : "0x38",
+ "name" : "BNB Smart Chain",
+ "code" : "evmchains",
+ "rpcUrl" : "https://bsc-dataseed.binance.org/",
+ "explorerUrl" : "https://bscscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "BNB",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi",
+ "binancewallet"
+ ],
+ "currencies": [
+ {
+ "symbol" : "BNB"
+ },
+ {
+ "symbol" : "BUSD",
+ "address" : "0xe9e7cea3dedca5984780bafc599bd69add087d56"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0x55d398326f99059ff775485246999027b3197955"
+ },
+ {
+ "symbol" : "USDC",
+ "address" : "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"
+ }
+ ]
+ },
+ {
+ "id" : 43114,
+ "hexId" : "0xa86a",
+ "name" : "Avalanche C-Chain",
+ "code" : "evmchains",
+ "rpcUrl" : "https://api.avax.network/ext/bc/C/rpc",
+ "explorerUrl" : "https://cchain.explorer.avax.network/",
+ "nativeCurrency" : {
+ "symbol" : "AVAX",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "AVAX"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xde3a24028580884448a5397872046a019649b084"
+ }
+ ]
+ },
+ {
+ "id" : 137,
+ "hexId" : "0x89",
+ "name" : "Polygon",
+ "code" : "evmchains",
+ "rpcUrl" : "https://polygon-rpc.com/",
+ "explorerUrl" : "https://polygonscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "MATIC",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "MATIC"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
+ }
+ ]
+ },
+ {
+ "id" : 250,
+ "hexId" : "0xfa",
+ "name" : "Fantom",
+ "code" : "evmchains",
+ "rpcUrl" : "https://rpc.fantom.network",
+ "explorerUrl" : "https://ftmscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "FTM",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "FTM"
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/resources/testnets.json b/resources/testnets.json
new file mode 100644
index 0000000..06e25a1
--- /dev/null
+++ b/resources/testnets.json
@@ -0,0 +1,144 @@
+[
+ {
+ "id" : 11155111,
+ "hexId" : "0xaa36a7",
+ "mainnetId" : 1,
+ "code" : "evmchains",
+ "name" : "Ethereum Sepolia Testnet",
+ "rpcUrl" : "https://sepolia.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
+ "explorerUrl" : "https://sepolia.etherscan.io/",
+ "nativeCurrency" : {
+ "symbol" : "ETH",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "ETH"
+ }
+ ]
+ },
+ {
+ "id" : 97,
+ "hexId" : "0x61",
+ "mainnetId" : 56,
+ "code" : "evmchains",
+ "name" : "BNB Smart Chain Testnet",
+ "rpcUrl" : "https://bsc-testnet.publicnode.com",
+ "explorerUrl" : "https://testnet.bscscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "BNB",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi",
+ "binancewallet"
+ ],
+ "currencies": [
+ {
+ "symbol" : "BNB"
+ },
+ {
+ "symbol" : "BUSD",
+ "address" : "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xba6670261a05b8504e8ab9c45d97a8ed42573822"
+ }
+ ]
+ },
+ {
+ "id" : 43113,
+ "hexId" : "0xa869",
+ "mainnetId" : 43114,
+ "code" : "evmchains",
+ "name" : "Avalanche FUJI C-Chain Testnet",
+ "rpcUrl" : "https://api.avax-test.network/ext/bc/C/rpc",
+ "explorerUrl" : "https://cchain.explorer.avax-test.network",
+ "nativeCurrency" : {
+ "symbol" : "AVAX",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "AVAX"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xFe143522938e253e5Feef14DB0732e9d96221D72"
+ }
+ ]
+ },
+ {
+ "id" : 80001,
+ "hexId" : "0x13881",
+ "mainnetId" : 137,
+ "code" : "evmchains",
+ "name" : "Polygon Mumbai Testnet",
+ "rpcUrl" : "https://rpc-mumbai.maticvigil.com/",
+ "explorerUrl" : "https://mumbai.polygonscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "MATIC",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "MATIC"
+ },
+ {
+ "symbol" : "USDT",
+ "address" : "0xa02f6adc7926efebbd59fd43a84f4e0c0c91e832"
+ }
+ ]
+ },
+ {
+ "id" : 4002,
+ "hexId" : "0xfa2",
+ "mainnetId" : 250,
+ "code" : "evmchains",
+ "name" : "Fantom Testnet",
+ "rpcUrl" : "https://rpc.testnet.fantom.network/",
+ "explorerUrl" : "https://testnet.ftmscan.com/",
+ "nativeCurrency" : {
+ "symbol" : "FTM",
+ "decimals" : 18
+ },
+ "wallets": [
+ "metamask",
+ "trustwallet",
+ "bitget",
+ "okx",
+ "xdefi"
+ ],
+ "currencies": [
+ {
+ "symbol" : "FTM"
+ }
+ ]
+ }
+]
\ No newline at end of file