-
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
0 parents
commit 47539f2
Showing
35 changed files
with
2,523 additions
and
0 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,38 @@ | ||
name: Create auto release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
auto_release: | ||
name: Auto release | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
|
||
- name: Check if release already exists | ||
run: | | ||
existing_release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} 2>&1) | ||
if [[ $existing_release == *"Not Found"* ]]; then | ||
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV | ||
else | ||
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV | ||
fi | ||
- name: Create Release | ||
id: create_release | ||
if: ${{ env.RELEASE_EXISTS == 'false' }} | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: Version ${{ github.ref_name }} | ||
body: Version ${{ github.ref_name }} | ||
draft: false | ||
prerelease: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BeycanPress\CryptoPay\EDD; | ||
|
||
class Loader | ||
{ | ||
/** | ||
* Loader constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BeycanPress\CryptoPay\EDD\Models; | ||
|
||
use BeycanPress\CryptoPayLite\Models\AbstractTransaction; | ||
|
||
class TransactionsLite extends AbstractTransaction | ||
{ | ||
public string $addon = 'edd'; | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct('edd_transaction'); | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BeycanPress\CryptoPay\EDD\Models; | ||
|
||
use BeycanPress\CryptoPay\Models\AbstractTransaction; | ||
|
||
class TransactionsPro extends AbstractTransaction | ||
{ | ||
public string $addon = 'edd'; | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct('edd_transaction'); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,15 @@ | ||
{ | ||
"scripts": { | ||
"phpcs": "phpcs --standard=phpcs.xml .", | ||
"phpcbf": "phpcbf --standard=phpcs.xml .", | ||
"install-phpcs": "composer config --global --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true && composer global require --dev squizlabs/php_codesniffer=* slevomat/coding-standard" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"BeycanPress\\CryptoPay\\EDD\\": "app/" | ||
} | ||
}, | ||
"require": { | ||
"beycanpress/cryptopay-integrator": "^0.1.3" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
defined('ABSPATH') || exit; | ||
|
||
// @phpcs:disable PSR1.Files.SideEffects | ||
// @phpcs:disable PSR12.Files.FileHeader | ||
// @phpcs:disable Generic.Files.InlineHTML | ||
// @phpcs:disable Generic.Files.LineLength | ||
|
||
/** | ||
* Plugin Name: Easy Digital Downloads (EDD) - CryptoPay Gateway | ||
* Version: 1.0.0 | ||
* Plugin URI: https://beycanpress.com/cryptopay/ | ||
* Description: Adds Cryptocurrency payment gateway (CryptoPay) for Easy Digital Downloads (EDD). | ||
* Author: BeycanPress LLC | ||
* Author URI: https://beycanpress.com | ||
* License: GPLv3 | ||
* License URI: https://www.gnu.org/licenses/gpl-3.0.html | ||
* Text Domain: edd-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 | ||
* Requires at least: 5.0 | ||
* Tested up to: 6.4.3 | ||
* Requires PHP: 8.1 | ||
*/ | ||
|
||
// Autoload | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
define('EDD_CRYPTOPAY_FILE', __FILE__); | ||
define('EDD_CRYPTOPAY_VERSION', '1.0.0'); | ||
define('EDD_CRYPTOPAY_KEY', basename(__DIR__)); | ||
define('EDD_CRYPTOPAY_URL', plugin_dir_url(__FILE__)); | ||
define('EDD_CRYPTOPAY_DIR', plugin_dir_path(__FILE__)); | ||
define('EDD_CRYPTOPAY_SLUG', plugin_basename(__FILE__)); | ||
|
||
use BeycanPress\CryptoPay\Integrator\Helpers; | ||
|
||
Helpers::registerModel(BeycanPress\CryptoPay\EDD\Models\TransactionsPro::class); | ||
Helpers::registerLiteModel(BeycanPress\CryptoPay\EDD\Models\TransactionsLite::class); | ||
|
||
load_plugin_textdomain('edd-cryptopay', false, basename(__DIR__) . '/languages'); | ||
|
||
if (!defined('GF_MIN_WP_VERSION') /* TODO: check the plugin */) { | ||
add_action('admin_notices', function (): void { | ||
?> | ||
<div class="notice notice-error"> | ||
<p><?php echo sprintf(esc_html__('Easy Digital Downloads (EDD) - CryptoPay Gateway: This plugin requires Easy Digital Downloads (EDD) to work. You can buy Easy Digital Downloads (EDD) by %s.', 'edd-cryptopay'), '<a href="https://wordpress.org/plugins/easy-digital-downloads/" target="_blank">' . esc_html__('clicking here', 'edd-cryptopay') . '</a>'); ?></p> | ||
</div> | ||
<?php | ||
}); | ||
} elseif (Helpers::bothExists()) { | ||
new BeycanPress\CryptoPay\EDD\Loader(); | ||
} else { | ||
add_action('admin_notices', function (): void { | ||
?> | ||
<div class="notice notice-error"> | ||
<p><?php echo sprintf(esc_html__('Easy Digital Downloads (EDD) - CryptoPay Gateway: This plugin is an extra feature plugin so it cannot do anything on its own. It needs CryptoPay to work. You can buy CryptoPay by %s.', 'edd-cryptopay'), '<a href="https://beycanpress.com/product/cryptopay-all-in-one-cryptocurrency-payments-for-wordpress/?utm_source=wp_org_addons&utm_medium=edd" target="_blank">' . esc_html__('clicking here', 'edd-cryptopay') . '</a>'); ?></p> | ||
</div> | ||
<?php | ||
}); | ||
} |
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,2 @@ | ||
<?php // @phpcs:ignore | ||
// Silence is golden. |
Oops, something went wrong.