Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha #28

Merged
merged 4 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/Models/AbstractTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ public function updateWithPaymentData(PaymentDataType $data, TransactionType $tx
$params = $tx->getParams()->merge($data->getParams());
$status = $data->getStatus() ? Status::VERIFIED : Status::FAILED;

$provider = Helpers::getProvider($tx);
$pTx = $provider->transaction($tx->getHash());
$tx->getAddresses()->setSender($pTx->getSigner());
try {
$provider = Helpers::getProvider($tx);
$pTx = $provider->transaction($tx->getHash());
$tx->getAddresses()->setSender($pTx->getSigner());
} catch (\Throwable $th) {
Helpers::debug('Update with data error', 'ERROR', $th);
}

return (bool) $this->update([
'hash' => $data->getHash(),
Expand Down
5 changes: 5 additions & 0 deletions app/Pages/TransactionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ public function page(): void
$result .= $tx->params->sanction->source . ' with ' . $tx->params->sanction->api . ' API';
}

if (isset($tx->params->failedReason)) {
$result .= CPL_BR2 . esc_html__('Failed reason: ', 'cryptopay');
$result .= $tx->params->failedReason;
}

return $result;
},
'addresses' => function ($tx) {
Expand Down
2 changes: 2 additions & 0 deletions app/RestAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ public function paymentFinished(): void
} catch (\Exception $e) {
$this->paymentData->setStatus(false);
$failedMessage = sprintf($this->getErrorMessage('PFE101'), $e->getMessage());
$this->paymentData->getParams()->set('failedReason', $failedMessage);
Helpers::debug('Payment finished error', 'ERROR', $e);
}

Helpers::debug('Payment finished filters before', 'INFO', $this->paymentData->forDebug());
Expand Down
2 changes: 1 addition & 1 deletion app/Types/InitType.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getBlockConfirmationCount(): int
public function prepareForJsSide(): array
{
return $this->toArray(exclude:[
'order' => ['refunds', 'discountRate']
'order' => ['discountRate']
]);
}
}
4 changes: 2 additions & 2 deletions assets/js/app.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cryptopay-wc-lite.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* Plugin Name: CryptoPay Lite
* Version: 2.3.3
* Version: 2.3.4
* Plugin URI: https://beycanpress.com/cryptopay/
* Description: All In One Cryptocurrency Payments for WordPress
* Author: BeycanPress LLC
Expand All @@ -22,7 +22,7 @@
* Domain Path: /languages
* Tags: Crypto, Cryptocurrency Payment, Gateway, WooCommerce
* Requires at least: 5.0
* Tested up to: 6.6.1
* Tested up to: 6.6.2
* Requires PHP: 8.1
*/

Expand Down
11 changes: 8 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Contributors: BeycanPress
Tags: WooCommerce, Cryptocurrency, Payment, Gateway, Bitcoin
Requires at least: 5.0
Tested up to: 6.6.1
Tested up to: 6.6.2
Requires PHP: 8.1
Stable Tag: 2.3.3
Version: 2.3.3
Stable Tag: 2.3.4
Version: 2.3.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -137,6 +137,11 @@ Yes, our plugin comes with WooCommerce crypto payment gateway support by default

== Changelog ==

= 2.3.4 =
* Added: Failed reason message for transactions if is failed
* Fixed: Not showing "open in explorer" button for mobile devices
* Fixed: Reminder email not asking email for not logged in users

= 2.3.3 =
* Removed: Phantom Wallet support
* Improved: Popup visual improvements
Expand Down
Loading