Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Aug 22, 2024
1 parent 21d9e31 commit d35c90c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function __construct()
{
$this->registerTransactionListPages();
Helpers::registerIntegration('gravityforms');
add_action('gform_loaded', [$this, 'register'], 5);
Hook::addFilter('edit_config_data_gravityforms', [$this, 'disableReminderEmail']);
Hook::addFilter('payment_redirect_urls_gravityforms', [$this, 'paymentRedirectUrls']);
add_action('gform_field_standard_settings', [ $this, 'fieldStandardSettings' ], 10, 2);
Expand Down Expand Up @@ -116,7 +115,7 @@ public function paymentRedirectUrls(object $data): array
/**
* @return void
*/
public function register(): void
public static function register(): void
{
\GFForms::include_payment_addon_framework();
\GFAddOn::register(Gateways\PaymentAddon::class);
Expand Down
6 changes: 4 additions & 2 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
}
}

$('#gform_' + formId).on('change', checkFormEmpty);
$('#gform_' + formId).on('keyup', checkFormEmpty);
const $form = $('#gform_' + formId);
$form.on('change', checkFormEmpty);
$form.on('keyup', checkFormEmpty);
$form.trigger('change');

const paymentCompleted = async (ctx, formId) => {
ctx.disablePopup = true;
Expand Down
5 changes: 4 additions & 1 deletion cryptopay-gateway-for-gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
define('GF_CRYPTOPAY_SLUG', plugin_basename(__FILE__));

use BeycanPress\CryptoPay\Integrator\Helpers;
use BeycanPress\CryptoPay\GravityForms\Loader;

/**
* @return void
Expand All @@ -50,13 +51,15 @@ function gfCryptoPayRegisterModels(): void

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

add_action('gform_loaded', [Loader::class, 'register'], 5);

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

if (!defined('GF_MIN_WP_VERSION')) {
Helpers::requirePluginMessage('Gravity Forms', 'https://www.gravityforms.com/', false);
} elseif (Helpers::bothExists()) {
new BeycanPress\CryptoPay\GravityForms\Loader();
new Loader();
} else {
Helpers::requireCryptoPayMessage('Gravity Forms');
}
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ After adding the CryptoPay field in the form creation step, you are ready to rec
<a href="https://ibb.co/B331GCf"><img src="https://i.ibb.co/tKKdzJH/Screenshot-2.png" alt="Screenshot-2" border="0"></a>

Result:

<a href="https://ibb.co/wNLQYTP"><img src="https://i.ibb.co/FbWYn9y/Screenshot-3.png" alt="Screenshot-3" border="0"></a>
<a href="https://ibb.co/vc09xxH"><img src="https://i.ibb.co/rQD9GGm/Screenshot-4.png" alt="Screenshot-4" border="0"></a>

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ After adding the CryptoPay field in the form creation step, you are ready to rec
<a href="https://ibb.co/B331GCf"><img src="https://i.ibb.co/tKKdzJH/Screenshot-2.png" alt="Screenshot-2" border="0"></a>

Result:

<a href="https://ibb.co/wNLQYTP"><img src="https://i.ibb.co/FbWYn9y/Screenshot-3.png" alt="Screenshot-3" border="0"></a>
<a href="https://ibb.co/vc09xxH"><img src="https://i.ibb.co/rQD9GGm/Screenshot-4.png" alt="Screenshot-4" border="0"></a>

Expand Down

0 comments on commit d35c90c

Please sign in to comment.