Skip to content

Commit

Permalink
fixed wordpress feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
muggledev committed Jun 19, 2024
1 parent 88de25e commit 0d7cd2c
Show file tree
Hide file tree
Showing 1,123 changed files with 149 additions and 149,960 deletions.
Binary file removed assets/.DS_Store
Binary file not shown.
Binary file removed assets/images/.DS_Store
Binary file not shown.
10 changes: 5 additions & 5 deletions class/class-mpwp-gateway-blocks-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Automattic\WooCommerce\StoreApi\Payments\PaymentContext;
use Automattic\WooCommerce\StoreApi\Payments\PaymentResult;

final class WC_Gateway_MPWP_Blocks_Support extends AbstractPaymentMethodType {
final class MPWP_WC_Gateway_Blocks_Support extends AbstractPaymentMethodType {
/**
* Payment method name/id/slug.
*
Expand All @@ -23,7 +23,7 @@ final class WC_Gateway_MPWP_Blocks_Support extends AbstractPaymentMethodType {
public function initialize() {
$this->settings = get_option( 'woocommerce_mpwp_settings', array() );

add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'failed_payment_notice' ), 8, 2 );
add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'mpwp_failed_payment_notice' ), 8, 2 );
}

/**
Expand Down Expand Up @@ -58,7 +58,7 @@ public function get_payment_method_script_handles() {
'1.2',
true
);
wp_set_script_translations( 'wc-mpwp-blocks', 'mpwp' );
wp_set_script_translations( 'wc-mpwp-blocks', 'muggle-pay' );
return array( "wc-mpwp-blocks" );
}

Expand All @@ -85,10 +85,10 @@ public function get_payment_method_data() {
* @param PaymentContext $context Holds context for the payment.
* @param PaymentResult $result Result object for the payment.
*/
public function failed_payment_notice( PaymentContext $context, PaymentResult &$result ) {
public function mpwp_failed_payment_notice( PaymentContext $context, PaymentResult &$result ) {
if ( 'mpwp' === $context->payment_method ) {
// add_action(
// 'wc_gateway_mpwp_process_payment_error',
// 'mpwp_wc_gateway_process_payment_error',
// function( $failed_notice ) use ( &$result ) {
// $payment_details = $result->payment_details;
// $payment_details['errorMessage'] = wp_strip_all_tags( $failed_notice );
Expand Down
234 changes: 125 additions & 109 deletions class/class-mpwp-gateway.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions class/class-mugglepay-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* Sends API requests to MugglePay.
* @see https://mugglepay.docs.stoplight.io/
*/
class MugglePay_Request
class MPWP_MugglePay_Request
{
/**
* Pointer to gateway making the request.
*
* @var WC_Gateway_MPWP
* @var MPWP_WC_Gateway
*/
protected $gateway;

Expand All @@ -26,7 +26,7 @@ class MugglePay_Request
/**
* Constructor.
*
* @param WC_Gateway_MPWP $gateway MugglePay gateway object.
* @param MPWP_WC_Gateway $gateway MugglePay gateway object.
*/
public function __construct($gateway)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public function send_request($endpoint, $params = array(), $header = array(), $m
$url = $this->api_url . $endpoint;

if (in_array($method, array( 'POST', 'PUT' ))) {
$args['body'] = json_encode($params);
$args['body'] = wp_json_encode($params);
} else {
$url = add_query_arg($params, $url);
}
Expand Down
Binary file removed i18n/.DS_Store
Binary file not shown.
Binary file removed i18n/languages/.DS_Store
Binary file not shown.
22 changes: 13 additions & 9 deletions muggle-pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Version: 1.0.1
Author: MugglePay
Author URI: https://mugglepay.com/
Text Domain: mpwp
Text Domain: muggle-pay
Domain Path: /i18n/languages/
License: GPLv3+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -47,24 +47,24 @@ function mpwp_init()
/**
* Registers WooCommerce Blocks integration.
*/
function wc_gateway_mpwp_woocommerce_block_support() {
function mpwp_wc_gateway_woocommerce_block_support() {
if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
require_once __DIR__ . '/class/class-mpwp-gateway-blocks-support.php';
add_action(
'woocommerce_blocks_payment_method_type_registration',
static function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
$payment_method_registry->register( new WC_Gateway_MPWP_Blocks_Support() );
$payment_method_registry->register( new MPWP_WC_Gateway_Blocks_Support() );
}
);
}
}
add_action( 'woocommerce_blocks_loaded', 'wc_gateway_mpwp_woocommerce_block_support' );
add_action( 'woocommerce_blocks_loaded', 'mpwp_wc_gateway_woocommerce_block_support' );


// Regiester Gateway To WooCommerce
function mpwp_add_gateway_class($methods)
{
$methods[] = 'WC_Gateway_MPWP';
$methods[] = 'MPWP_WC_Gateway';
return $methods;
}

Expand All @@ -85,7 +85,7 @@ function mpwp_cron_schedules($schedules)
if (!isset($schedules["5min"])) {
$schedules["5min"] = array(
'interval' => 5 * 60,
'display' => __('Once every 5 minutes', 'mpwp')
'display' => __('Once every 5 minutes', 'muggle-pay')
);
}
return $schedules;
Expand Down Expand Up @@ -120,10 +120,14 @@ function mpwp_order_meta_general($order)
?>

<br class="clear" />
<h3><?php _e('MugglePay Payment Voucher', 'mpwp'); ?>
<h3><?php esc_html_e('MugglePay Payment Voucher', 'muggle-pay'); ?>
</h3>
<div class="">
<p><?php echo esc_html__(__('Transaction ID: %s', 'mpwp'), $order->get_transaction_id()); ?>
<p>
<?php
// Translators: %s is the transaction ID.
printf( esc_html__( 'Transaction ID: %s', 'muggle-pay' ), esc_html( $order->get_transaction_id() ) );
?>
</p>
</div>

Expand All @@ -137,7 +141,7 @@ function mpwp_order_meta_general($order)
*/
function mpwp_plugin_languages_init()
{
load_plugin_textdomain('mpwp', false, basename(dirname(__FILE__)) . '/i18n/languages/');
load_plugin_textdomain('muggle-pay', false, basename(dirname(__FILE__)) . '/i18n/languages/');
}
add_action('plugins_loaded', 'mpwp_plugin_languages_init');

Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Stable tag: 1.0.1
License: GPLv3+
License URI: https://www.gnu.org/licenses/gpl-3.0.html

MugglePay is a WooCommerce payment gateway for accepting cryptocurrency payments with real-time settlement.

== Description ==

Since its establishment in 2019, MugglePay has over 14,000 registered merchants, many of whom are in the e-commerce sector. However, current integration with MugglePay requires additional development. We aim to streamline this process by launching a Woo payment plugin, also assisting merchants using other website tools to transition to Woo.
Expand Down
5 changes: 0 additions & 5 deletions tools/php-cs-fixer/composer.json

This file was deleted.

Loading

0 comments on commit 0d7cd2c

Please sign in to comment.