Skip to content

Commit

Permalink
configured for wp.org
Browse files Browse the repository at this point in the history
  • Loading branch information
BeycanDeveloper committed Apr 27, 2024
1 parent 7bf5a82 commit 4a1ba28
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
5 changes: 5 additions & 0 deletions app/Gateways/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ public function get_form_editor_field_settings(): array
private function get_field_works_or_expect_msg(bool $works = true): string
{
$msg = $works
/* translators: %s: field title */
? esc_html__('The %s process will appear on the front-end and the form can be sent when the user completes the payment.', 'gf-cryptopay') // phpcs:ignore
/* translators: %s: field title */
: esc_html__('Please add a total field to your form for %s works.', 'gf-cryptopay');

return sprintf($msg, $this->get_form_editor_field_title());
Expand Down Expand Up @@ -362,6 +364,7 @@ public function add_entry_id_to_tx($entry, $form): mixed
}

$model = Helpers::run('getModelByAddon', 'gravityforms');
// In Gravity Forms process already have nonce process
$txHash = sanitize_text_field($_POST[$this->field_input_id] ?? '');
$model->updateOrderIdByTxHash($txHash, intval($entry['id']));

Expand Down Expand Up @@ -433,6 +436,7 @@ public function get_field_content($value, $forceFrontendLabel, $form): string

if ($this->is_admin_side()) {
return sprintf(
/* translators: %s: field label */
"%s<label class='gfield_label' for='%s'>%s</label>{FIELD}",
$adminButtons,
"input_{$this->id}",
Expand Down Expand Up @@ -475,6 +479,7 @@ public function get_field_content($value, $forceFrontendLabel, $form): string
// @phpcs:ignore
public function validate($value, $form): void
{
// In Gravity Forms process already have nonce process
$txHash = sanitize_text_field($_POST[$this->field_input_id] ?? '');

if (empty($txHash)) {
Expand Down
6 changes: 4 additions & 2 deletions app/Gateways/PaymentAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public function authorize($feed, $data, $form, $entry): array
'error_message' => esc_html__('The payment field is not found!', 'gf-cryptopay')
];
}

// In Gravity Forms process already have nonce process
$txId = $ourField ? sanitize_text_field($_POST[$ourField->field_input_id] ?? '') : '';
$tx = Helpers::run('getModelByAddon', 'gravityforms')->findOneBy(['hash' => $txId]);

Expand Down Expand Up @@ -214,7 +216,7 @@ public function get_menu_icon(): string
throw new \Exception(
\sprintf(
'Could not read WordPress admin menu icon from file: %s.',
$file
esc_html($file)
)
);
}
Expand All @@ -225,7 +227,7 @@ public function get_menu_icon(): string
throw new \Exception(
\sprintf(
'Could not read WordPress admin menu icon from file: %s.',
$file
esc_html($file)
)
);
}
Expand Down
1 change: 1 addition & 0 deletions app/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function registerTransactionListPages(): void
$formId = $tx->params?->formId ?? $tx->params?->formIdOld;
return Helpers::run('view', 'components/link', [
'url' => sprintf(admin_url('admin.php?page=gf_entries&view=entry&id=%d&lid=%d&order=ASC&filter&paged=1&pos=0&field_id&operator'), $formId, $tx->orderId), // @phpcs:ignore
/* translators: %d: transaction id */
'text' => sprintf(esc_html__('View entry #%d', 'gf-cryptopay'), $tx->orderId)
]);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Models/TransactionsLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function cleanFormIdsInTxs(string $formId): void
{
$this->update(
[
'params' => json_encode(['formIdOld' => $formId]),
'params' => wp_json_encode(['formIdOld' => $formId]),
],
[
'params' => json_encode(['formId' => $formId]),
'params' => wp_json_encode(['formId' => $formId]),
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Models/TransactionsPro.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function cleanFormIdsInTxs(string $formId): void
{
$this->update(
[
'params' => json_encode(['formIdOld' => $formId]),
'params' => wp_json_encode(['formIdOld' => $formId]),
],
[
'params' => json_encode(['formId' => $formId]),
'params' => wp_json_encode(['formId' => $formId]),
]
);
}
Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Cryptocurrency Payment Gateway Plugin for Gravity Forms by CryptoPay ===
=== Cryptocurrency Payment Gateway for Gravity Forms by CryptoPay ===
Contributors: BeycanPress
Tags: Bitcoin, Ethereum, Binance Smart Chain, Blockchain, Networks, Cryptocurrency, Payments, Gateway, WordPress, Gravity Forms
Tags: Bitcoin, Ethereum, Cryptocurrency, Payments, Gravity Forms
Requires at least: 5.0
Tested up to: 6.5.0
Requires PHP: 8.1
Expand All @@ -9,11 +9,11 @@ Version: 1.0.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Cryptocurrency Payment Gateway Plugin for Gravity Forms, Cryptocurrency payments for WordPress, Bitcoin payments, Crypto payments, USDT, BTC, ETH, SOL
Cryptocurrency Payment Gateway for Gravity Forms, Cryptocurrency payments for WordPress, Bitcoin payments, Crypto payments, USDT, BTC, ETH, SOL

== Description ==

### Cryptocurrency Payment Gateway Plugin for Gravity Forms by CryptoPay
### Cryptocurrency Payment Gateway for Gravity Forms by CryptoPay

First of all, we would like to point out that this plugin is not a standalone plugin. This plugin is a **<a href="https://beycanpress.com/cryptopay/?utm_source=wporg_readme&utm_medium=cryptopay_gravity_forms">cryptocurrency payment gateway for Gravity Forms</a>**. In other words, users who want to sell courses with cryptocurrency payments can use WordPress and Gravity Forms. However, this plugin is a plugin for CryptoPay and a cryptocurrency payment gateway for Gravity Forms. So it's actually CryptoPay, which is the main plugin that handles cryptocurrency payments for WordPress. Therefore, users must have both plugins.

Expand Down

0 comments on commit 4a1ba28

Please sign in to comment.