Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
BeycanDeveloper committed Jul 20, 2024
1 parent f4d71c7 commit a4073c5
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 33 deletions.
5 changes: 3 additions & 2 deletions app/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ public function field_display($field, $deprecated, $formData): void
}
}

Hook::addFilter('theme', function () use ($theme) {
return $theme;
Hook::addFilter('theme', function (array $themeOptions) use ($theme) {
$themeOptions['mode'] = $theme ?? 'light';
return $themeOptions;
});

if (Helpers::exists()) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
})

const transactionInput = (transaction) => {
return `<input type="hidden" name="wpforms[transaction-hash]" value="${transaction.hash}" />`
return `<input type="hidden" name="wpforms[transaction-hash]" value="${transaction.id}" />`
}

app.events.add('confirmationCompleted', async ({transaction}) => {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
}
},
"require": {
"beycanpress/cryptopay-integrator": "^0.1.11"
"beycanpress/cryptopay-integrator": "^0.1.13"
}
}
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions cryptopay-gateway-for-wpforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: wpforms-cryptopay
* Tags: Cryptopay, Cryptocurrency, WooCommerce, WordPress, MetaMask, Trust, Binance, Wallet, Ethereum, Bitcoin, Binance smart chain, Payment, Plugin, Gateway, Moralis, Converter, API, coin market cap, CMC
* Tags: Bitcoin, Ethereum, Crypto, Payment, WPForms
* Requires at least: 5.0
* Tested up to: 6.5.0
* Tested up to: 6.6
* Requires PHP: 8.1
*/

Expand All @@ -38,12 +38,22 @@

use BeycanPress\CryptoPay\Integrator\Helpers;

Helpers::registerModel(BeycanPress\CryptoPay\WPForms\Models\TransactionsPro::class);
Helpers::registerLiteModel(BeycanPress\CryptoPay\WPForms\Models\TransactionsLite::class);
/**
* @return void
*/
function wpformsCryptoPayRegisterModels(): void
{
Helpers::registerModel(BeycanPress\CryptoPay\WPForms\Models\TransactionsPro::class);
Helpers::registerLiteModel(BeycanPress\CryptoPay\WPForms\Models\TransactionsLite::class);
}

wpformsCryptoPayRegisterModels();

load_plugin_textdomain('wpforms-cryptopay', false, basename(__DIR__) . '/languages');

add_action('plugins_loaded', function (): void {
wpformsCryptoPayRegisterModels();

if (!defined('WPFORMS_VERSION')) {
Helpers::requirePluginMessage('WPForms', 'https://wordpress.org/plugins/wpforms-lite/');
} elseif (Helpers::bothExists()) {
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: BeycanPress
Tags: Bitcoin, Ethereum, Crypto, Payment, WPForms
Requires at least: 5.0
Tested up to: 6.5.0
Tested up to: 6.6
Requires PHP: 8.1
Stable Tag: 1.0.0
Version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion vendor/beycanpress/cryptopay-integrator/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beycanpress/cryptopay-integrator",
"version": "0.1.11",
"version": "0.1.13",
"description": "CryptoPay and CryptoPay Lite integration wrapper",
"type": "library",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions vendor/beycanpress/cryptopay-integrator/src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public static function bothExists(): bool
*/
public static function liteExists(): bool
{
return class_exists(LiteLoader::class);
return defined('CRYPTOPAY_LITE_LOADED');
}

/**
* @return bool
*/
public static function exists(): bool
{
return class_exists(Loader::class);
return defined('CRYPTOPAY_LOADED');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion vendor/beycanpress/cryptopay-integrator/src/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Session
*/
public static function start(): void
{
if (PHP_SESSION_NONE === session_status()) {
if (PHP_SESSION_NONE === session_status() && !headers_sent()) {
session_start();
}
}
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"packages": [
{
"name": "beycanpress/cryptopay-integrator",
"version": "0.1.11",
"version_normalized": "0.1.11.0",
"version": "0.1.13",
"version_normalized": "0.1.13.0",
"source": {
"type": "git",
"url": "https://github.com/BeycanPress/cryptopay-integrator.git",
"reference": "cd50c21a0daf9bbcc5b86a292d620b74b47aa73e"
"reference": "b981bcc7cf021d653acd938d817b51f1cbb27d4f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/BeycanPress/cryptopay-integrator/zipball/cd50c21a0daf9bbcc5b86a292d620b74b47aa73e",
"reference": "cd50c21a0daf9bbcc5b86a292d620b74b47aa73e",
"url": "https://api.github.com/repos/BeycanPress/cryptopay-integrator/zipball/b981bcc7cf021d653acd938d817b51f1cbb27d4f",
"reference": "b981bcc7cf021d653acd938d817b51f1cbb27d4f",
"shasum": ""
},
"require": {
"php": ">=8.1"
},
"time": "2024-04-04T08:02:22+00:00",
"time": "2024-07-20T03:27:42+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -34,7 +34,7 @@
"homepage": "https://github.com/BeycanPress/cryptopay-integrator",
"support": {
"issues": "https://github.com/BeycanPress/cryptopay-integrator/issues",
"source": "https://github.com/BeycanPress/cryptopay-integrator/tree/0.1.11"
"source": "https://github.com/BeycanPress/cryptopay-integrator/tree/0.1.13"
},
"install-path": "../beycanpress/cryptopay-integrator"
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '8dc557c2ad09f80c1ab05a164bd584febfa4b7e6',
'reference' => 'f4d71c77b7f4e444bb546b08670b5b3b1b2f1be0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,16 +13,16 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '8dc557c2ad09f80c1ab05a164bd584febfa4b7e6',
'reference' => 'f4d71c77b7f4e444bb546b08670b5b3b1b2f1be0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'beycanpress/cryptopay-integrator' => array(
'pretty_version' => '0.1.11',
'version' => '0.1.11.0',
'reference' => 'cd50c21a0daf9bbcc5b86a292d620b74b47aa73e',
'pretty_version' => '0.1.13',
'version' => '0.1.13.0',
'reference' => 'b981bcc7cf021d653acd938d817b51f1cbb27d4f',
'type' => 'library',
'install_path' => __DIR__ . '/../beycanpress/cryptopay-integrator',
'aliases' => array(),
Expand Down
2 changes: 1 addition & 1 deletion wpforms/CryptoPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use BeycanPress\CryptoPay\WPForms\Field;
use BeycanPress\CryptoPay\WPForms\Process;
use BeycanPress\CryptoPay\WPForms\Payments;
use BeycanPress\CryptoPay\WPForms\Settings;
use BeycanPress\CryptoPay\Integrator\Helpers;
use BeycanPress\CryptoPay\WPForms\Fields\Settings;

final class CryptoPay implements IntegrationInterface
{
Expand Down

0 comments on commit a4073c5

Please sign in to comment.