Skip to content

Commit

Permalink
fix errors with merge
Browse files Browse the repository at this point in the history
  • Loading branch information
carlHandy committed Sep 3, 2024
1 parent e20cf81 commit d73e01c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
19 changes: 2 additions & 17 deletions includes/class-mmgcp-checkout-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,12 @@ public function __construct() {
require_once __DIR__ . '/class-mmgcp-checkout-settings.php';
new MMGCP_Checkout_Settings();

<<<<<<< HEAD:includes/class-mmgcp-checkout-payment.php
add_action( 'wp_enqueue_scripts', array( $this, 'mmgcp_enqueue_scripts' ) );
add_action( 'wp_ajax_generate_checkout_url', array( $this, 'mmgcp_generate_checkout_url' ) );
add_action( 'wp_ajax_nopriv_generate_checkout_url', array( $this, 'mmgcp_generate_checkout_url' ) );
add_filter( 'woocommerce_payment_gateways', array( $this, 'mmgcp_add_gateway_class' ) );
add_action( 'plugins_loaded', array( $this, 'mmgcp_init_gateway_class' ), 11 );
add_action( 'parse_request', array( $this, 'mmgcp_parse_api_request' ) );
=======
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'wp_ajax_generate_checkout_url', array( $this, 'generate_checkout_url' ) );
add_action( 'wp_ajax_nopriv_generate_checkout_url', array( $this, 'generate_checkout_url' ) );
add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateway_class' ) );
add_action( 'plugins_loaded', array( $this, 'init_gateway_class' ), 11 );
add_action( 'parse_request', array( $this, 'parse_api_request' ), 10, 1 );
>>>>>>> 384084a (Bug fix: rewrite rule not initialized (#56)):includes/class-mmg-checkout-payment.php
add_action( 'parse_request', array( $this, 'mmgcp_parse_api_request' ), 10, 1 );

$this->live_checkout_url = $this->mmgcp_get_checkout_url( 'live' );
$this->demo_checkout_url = $this->mmgcp_get_checkout_url( 'demo' );
Expand Down Expand Up @@ -369,15 +360,9 @@ private function mmgcp_url_safe_base64_decode( $data ) {
*
* @param WP $wp The WordPress environment instance.
*/
<<<<<<< HEAD:includes/class-mmgcp-checkout-payment.php
public function mmgcp_parse_api_request() {
global $wp;
if ( isset( $wp->query_vars['mmg-checkout'] ) ) {
=======
public function parse_api_request( $wp ) {
public function mmgcp_parse_api_request( $wp ) {
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : 'No REQUEST_URI';
if ( isset( $wp->query_vars['mmg-checkout'] ) || strpos( $request_uri, 'mmg-checkout' ) !== false ) {
>>>>>>> 384084a (Bug fix: rewrite rule not initialized (#56)):includes/class-mmg-checkout-payment.php
$path_info = isset( $_SERVER['PATH_INFO'] ) ? sanitize_text_field( wp_unslash( $_SERVER['PATH_INFO'] ) ) : '';
if ( strpos( $path_info, '/errorpayment' ) !== false ) {
$this->mmgcp_handle_error_payment();
Expand Down
8 changes: 4 additions & 4 deletions mmg-checkout-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
* This function is called when all plugins are loaded and dependencies are met.
* It includes the main plugin class and instantiates it.
*/
function mmg_checkout_init() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmg-checkout-payment.php';
$mmg_checkout = new MMG_Checkout_Payment();
function mmgcp_checkout_init() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-mmgcp-checkout-payment.php';
$mmg_checkout = new MMGCP_Checkout_Payment();

add_action( 'parse_request', array( $mmg_checkout, 'parse_api_request' ), 10, 1 );
add_action( 'parse_request', array( $mmg_checkout, 'mmgcp_parse_api_request' ), 10, 1 );
}
add_action( 'plugins_loaded', 'mmgcp_checkout_init' );
}
Expand Down

0 comments on commit d73e01c

Please sign in to comment.