-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50a6d32
commit e193b89
Showing
15 changed files
with
243 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: PHPCS Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
phpcs: | ||
name: PHPCS Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
|
||
- name: Install PHPCS | ||
run: | | ||
composer config --global --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | ||
composer require --dev squizlabs/php_codesniffer=* slevomat/coding-standard | ||
- name: Run PHPCS | ||
run: | | ||
composer phpcs --standard=phpcs.xml . | ||
exit_status=$? | ||
if [ $exit_status -ne 0 ]; then | ||
echo "PHPCS check failed. Please fix the issues before merging." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BeycanPress\CryptoPay\Donation; | ||
|
||
use BeycanPress\CryptoPay\Helpers; | ||
use BeycanPress\CryptoPay\PluginHero\Hook; | ||
use BeycanPress\CryptoPay\PluginHero\Helpers; | ||
use BeycanPress\CryptoPay\PluginHero\Updater; | ||
use BeycanPress\CryptoPay\Pages\TransactionPage; | ||
|
||
class Loader | ||
{ | ||
use Helpers; | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
new Updater([ | ||
'requires' => '5.0', | ||
'requires_php' => '7.4', | ||
'plugin_file' => 'cryptopay-donation/index.php', | ||
'plugin_version' => $this->addons->donation->getVersion(), | ||
'requires_php' => '8.1', | ||
'plugin_file' => 'cryptopay-donation/cryptopay-donation.php', | ||
'plugin_version' => Helpers::getAddon('donation')->getVersion(), | ||
'icons' => [ | ||
'2x' => plugin_dir_url(dirname(__FILE__, 2) . '/index.php') . '/assets/images/icon-256x256.png', | ||
'1x' => plugin_dir_url(dirname(__FILE__, 2) . '/index.php') . '/assets/images/icon-128x128.png', | ||
] | ||
]); | ||
|
||
Hook::addFilter('apply_discount_donation', '__return_false'); | ||
Hook::addFilter('models', function($models) { | ||
Hook::addFilter('models', function ($models) { | ||
return array_merge($models, [ | ||
'donation' => new Models\DonationTransaction() | ||
]); | ||
}); | ||
|
||
Hook::addFilter('transaction_status_donation', fn() => 'completed'); | ||
|
||
if (is_admin()) { | ||
new TransactionPage( | ||
esc_html__('Donation transactions', 'cryptopay'), | ||
'donation', | ||
3, | ||
[], | ||
false, | ||
['orderId', 'status', 'updatedAt'] | ||
); | ||
} else { | ||
new DonateBox\DonateBox(); | ||
} | ||
|
||
new Integrations(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BeycanPress\CryptoPay\Donation\Models; | ||
|
||
use BeycanPress\CryptoPay\Models\AbstractTransaction; | ||
|
||
class DonationTransaction extends AbstractTransaction | ||
class DonationTransaction extends AbstractTransaction | ||
{ | ||
public $addon = 'donation'; | ||
|
||
public string $addon = 'donation'; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct('donation_transaction'); | ||
} | ||
} | ||
} |
Oops, something went wrong.