Skip to content

Commit

Permalink
configured for wp.org
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Apr 16, 2024
1 parent f8f4528 commit ef413d5
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 1,118 deletions.
10 changes: 5 additions & 5 deletions classes/lite/MeprCryptoPayLiteGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use BeycanPress\CryptoPayLite\Payment;
use BeycanPress\CryptoPayLite\Settings;
use BeycanPress\CryptoPayLite\PluginHero\Hook;
use BeycanPress\CryptoPayLite\PluginHero\Helpers;
use BeycanPress\CryptoPayLite\Types\Order\OrderType;

// @phpcs:ignore
Expand Down Expand Up @@ -216,13 +216,13 @@ public function display_payment_form($amount, $user, $productId, $transactionId)
?>
<div class="mp_wrapper mp_payment_form_wrapper">
<?php
echo (new Payment('memberpress'))
Helpers::ksesEcho((new Payment('memberpress'))
->setOrder(OrderType::fromArray([
'id' => (int) $transactionId,
'amount' => (float) $amount,
'currency' => $meprOptions->currency_code,
]))
->html(loading:true);
->html(loading:true));
?>
</div>
<?php
Expand Down Expand Up @@ -257,9 +257,9 @@ private function mepr_invoice_header($txn): void
}

if (count($order_bumps)) {
echo MeprTransactionsHelper::get_invoice_order_bumps($txn, '', $order_bumps);
Helpers::ksesEcho(MeprTransactionsHelper::get_invoice_order_bumps($txn, '', $order_bumps));
} else {
echo MeprTransactionsHelper::get_invoice($txn);
Helpers::ksesEcho(MeprTransactionsHelper::get_invoice($txn));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use BeycanPress\CryptoPayLite\Models\AbstractTransaction;

// @phpcs:ignore
class MemberPressCryptoPayLiteModel extends AbstractTransaction
class MeprMemberPressCryptoPayLiteModel extends AbstractTransaction
{
public string $addon = 'memberpress';

Expand Down
9 changes: 5 additions & 4 deletions classes/pro/MeprCryptoPayGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use BeycanPress\CryptoPay\Payment;
use BeycanPress\CryptoPay\Settings;
use BeycanPress\CryptoPay\PluginHero\Hook;
use BeycanPress\CryptoPay\PluginHero\Helpers;
use BeycanPress\CryptoPay\Types\Order\OrderType;

// @phpcs:ignore
Expand Down Expand Up @@ -247,9 +248,9 @@ private function mepr_invoice_header($txn): void
}

if (count($order_bumps)) {
echo MeprTransactionsHelper::get_invoice_order_bumps($txn, '', $order_bumps);
Helpers::ksesEcho(MeprTransactionsHelper::get_invoice_order_bumps($txn, '', $order_bumps));
} else {
echo MeprTransactionsHelper::get_invoice($txn);
Helpers::ksesEcho(MeprTransactionsHelper::get_invoice($txn));
}
}

Expand Down Expand Up @@ -426,13 +427,13 @@ private function show_cryptopay_payment_form($txn): void
?>
<div class="mp_wrapper mp_payment_form_wrapper">
<?php
echo (new Payment('memberpress'))
Helpers::ksesEcho((new Payment('memberpress'))
->setOrder(OrderType::fromArray([
'id' => (int) $txn->id,
'amount' => (float) $amount,
'currency' => $meprOptions->currency_code,
]))
->html(loading:true);
->html(loading:true));
?>
</div>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use BeycanPress\CryptoPay\Models\AbstractTransaction;

// @phpcs:ignore
class MemberPressCryptoPayModel extends AbstractTransaction
class MeprMemberPressCryptoPayModel extends AbstractTransaction
{
public string $addon = 'memberpress';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Text Domain: memberpress-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
* Tested up to: 6.5.2
* Requires PHP: 8.1
*/

Expand All @@ -39,12 +39,12 @@

register_activation_hook(MEMBERPRESS_CRYPTOPAY_FILE, function (): void {
if (class_exists(Loader::class)) {
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/pro/Models/MemberPressCryptoPayModel.php';
(new MemberPressCryptoPayModel())->createTable();
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/pro/Models/MeprMemberPressCryptoPayModel.php';
(new MeprMemberPressCryptoPayModel())->createTable();
}
if (class_exists(LiteLoader::class)) {
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/lite/Models/MemberPressCryptoPayLiteModel.php';
(new MemberPressCryptoPayLiteModel())->createTable();
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/lite/Models/MeprMemberPressCryptoPayLiteModel.php';
(new MeprMemberPressCryptoPayLiteModel())->createTable();
}
});

Expand All @@ -54,19 +54,19 @@
function memberpress_cryptopay_addModels(): void
{
if (class_exists(Loader::class)) {
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/pro/Models/MemberPressCryptoPayModel.php';
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/pro/Models/MeprMemberPressCryptoPayModel.php';
Hook::addFilter('models', function ($models) {
return array_merge($models, [
'memberpress' => new MemberPressCryptoPayModel()
'memberpress' => new MeprMemberPressCryptoPayModel()
]);
});
}

if (class_exists(LiteLoader::class)) {
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/lite/Models/MemberPressCryptoPayLiteModel.php';
require_once MEMBERPRESS_CRYPTOPAY_DIR . 'classes/lite/Models/MeprMemberPressCryptoPayLiteModel.php';
LiteHook::addFilter('models', function ($models) {
return array_merge($models, [
'memberpress' => new MemberPressCryptoPayLiteModel()
'memberpress' => new MeprMemberPressCryptoPayLiteModel()
]);
});
}
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<file>./**/*.php</file>
<arg name="extensions" value="php"/>
<exclude-pattern>*/views/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/PluginHero/templates/*</exclude-pattern>
<arg name="standard" value="PSR12"/>
<rule ref="Generic.Files.InlineHTML"/>
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: BeycanPress
Tags: Bitcoin, Ethereum, Binance Smart Chain, Blockchain, Networks, Cryptocurrency, Payments, Gateway, WordPress, MemberPress
Requires at least: 5.0
Tested up to: 6.4.3
Tested up to: 6.5.2
Requires PHP: 8.1
Stable Tag: 1.0.4
Version: 1.0.4
Expand Down
25 changes: 0 additions & 25 deletions vendor/autoload.php

This file was deleted.

Loading

0 comments on commit ef413d5

Please sign in to comment.