Skip to content

Commit

Permalink
Minor issues resolved after merge conflict, PFWMA-122
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakmaurya committed Jun 7, 2020
1 parent 16766d8 commit 5ff134d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
$order_total = $this->angelleye_get_total($order_id);
if (!empty($gateway_setting->id) && $gateway_setting->id == 'paypal_express') {
$args = array(
'posts_per_page' => -1,
'posts_per_page' => -1,
'post_type' => 'microprocessing',
'order' => 'DESC',
'orderby' => 'order_clause',
Expand Down Expand Up @@ -233,7 +233,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
}
}
}

if (!empty($order_id)) {
$order = wc_get_order($order_id);
foreach ($order->get_items() as $cart_item_key => $values) {
Expand Down Expand Up @@ -1457,14 +1457,14 @@ public function own_angelleye_express_checkout_order_data($paypal_response, $ord
if (!empty($paypal_response['PAYMENTINFO_' . $transaction_map . '_PAYMENTREQUESTID'])) {
$PAYMENTREQUESTID_array = $paypal_response['PAYMENTINFO_' . $transaction_map . '_PAYMENTREQUESTID'];
$request_order_item_id = explode('-', $PAYMENTREQUESTID_array);
if( !empty($request_order_item_id[0]) && $ec_parallel_data['order_item_id'] == $request_order_item_id[0]) {
if( !empty($paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID'])) {
$ec_parallel_data_map[$ec_parallel_data['product_id']]['transaction_id'] = $paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID'];
wc_update_order_item_meta($ec_parallel_data['order_item_id'], '_transaction_id', $paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID']);
} elseif(!empty($paypal_response['PAYMENTINFO_' . $payment . '_ERRORCODE'])) {
wc_update_order_item_meta($ec_parallel_data['order_item_id'], 'Payment Status', __('Not Paid', 'paypal-for-woocommerce-multi-account-management'));
}
}
if( !empty($request_order_item_id[0]) && $ec_parallel_data['order_item_id'] == $request_order_item_id[0]) {
if( !empty($paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID'])) {
$ec_parallel_data_map[$ec_parallel_data['product_id']]['transaction_id'] = $paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID'];
wc_update_order_item_meta($ec_parallel_data['order_item_id'], '_transaction_id', $paypal_response['PAYMENTINFO_' . $transaction_map . '_TRANSACTIONID']);
} elseif(!empty($paypal_response['PAYMENTINFO_' . $payment . '_ERRORCODE'])) {
wc_update_order_item_meta($ec_parallel_data['order_item_id'], 'Payment Status', __('Not Paid', 'paypal-for-woocommerce-multi-account-management'));
}
}
}
}
}
Expand Down Expand Up @@ -1731,17 +1731,15 @@ public function own_angelleye_multi_account_need_shipping($bool, $order_id = '',
}
}

if( !empty($current_product_id) ) {
$product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key);
$_no_shipping_required = get_post_meta($current_product_id, '_no_shipping_required', true);
if( $_no_shipping_required == 'yes' ) {
if($is_required > 0) {
return false;
}
}
}
if (!empty($current_product_id)) {
$_no_shipping_required = get_post_meta($current_product_id, '_no_shipping_required', true);
if ($_no_shipping_required == 'yes') {
if ($is_required > 0) {
return false;
}
}
}
return $bool;

}

public function angelleye_get_account_for_ec_payment_load_balancer($gateways, $gateway_setting, $order_id, $request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public function angelleye_display_multi_account_list() {
$microprocessing_key_array = array('woocommerce_paypal_express_enable', 'woocommerce_paypal_express_testmode', 'woocommerce_paypal_express_account_name', 'woocommerce_paypal_express_sandbox_email', 'woocommerce_paypal_express_sandbox_merchant_id', 'woocommerce_paypal_express_sandbox_api_username', 'woocommerce_paypal_express_sandbox_api_password', 'woocommerce_paypal_express_sandbox_api_signature', 'woocommerce_paypal_express_email', 'woocommerce_paypal_express_merchant_id', 'woocommerce_paypal_express_api_username', 'woocommerce_paypal_express_api_password', 'woocommerce_paypal_express_api_signature', 'woocommerce_paypal_express_api_condition_field', 'woocommerce_paypal_express_api_condition_sign', 'woocommerce_paypal_express_api_condition_value', 'woocommerce_paypal_express_api_user_role', 'woocommerce_paypal_express_api_user', 'woocommerce_paypal_express_api_product_ids', 'product_categories', 'product_tags', 'buyer_countries', 'woocommerce_priority', 'angelleye_multi_account_choose_payment_gateway', 'store_countries', 'shipping_class', 'currency_code', 'ec_site_owner_commission', 'ec_site_owner_commission_label');
foreach ($microprocessing_key_array as $key => $value) {
$microprocessing_new[$value] = isset($microprocessing[$value]) ? $microprocessing[$value] : array();

}
$microprocessing = $microprocessing_new;
foreach ($microprocessing as $microprocessing_key => $microprocessing_value) {
Expand Down Expand Up @@ -435,7 +434,7 @@ public function angelleye_display_multi_account_list() {
$shipping_classes_array = !is_wp_error($classes) ? $classes : array();
if ($shipping_classes_array) {
$shipping_class = !empty($shipping_class) ? $shipping_class : '';
$option_fifteen .= '<option value="all">All Shipping Class</option>';
$option_fifteen .= '<option value="all">All Shipping Class</option>';
foreach ($shipping_classes_array as $classes_key => $classes_name) {
$option_fifteen .= '<option value="' . esc_attr($classes_name->term_id) . '"' . wc_selected($classes_name->term_id, $shipping_class) . '>' . esc_html($classes_name->name) . '</option>';
}
Expand Down Expand Up @@ -565,9 +564,8 @@ public function angelleye_multi_account_settings_fields() {
$global_automatic_rule_creation_testmode = get_option('global_automatic_rule_creation_testmode', '');
$angelleye_payment_load_balancer = get_option('angelleye_payment_load_balancer', '');
?>

<div id="angelleye_paypal_marketing_table">
<div class="angelleye_multi_account_global_setting">
<div class="angelleye_multi_account_global_setting">
<form method="post" id="mainform" action="" enctype="multipart/form-data">
<table class="form-table">
<tr class="angelleye_payment_load_balancer_tr">
Expand Down Expand Up @@ -680,12 +678,7 @@ public function angelleye_multi_account_tooltip_box() {
}

public function angelleye_multi_account_ui() {
if (!empty($_POST['global_commission_microprocessing_save'])) {
update_option('global_ec_site_owner_commission', wc_clean($_POST['global_ec_site_owner_commission']));
update_option('global_ec_site_owner_commission_label', wc_clean($_POST['global_ec_site_owner_commission_label']));
echo sprintf('<div class="notice notice-success is-dismissible"><p>%1$s</p></div>', __('Your settings have been saved.', 'paypal-for-woocommerce-multi-account-management'));
}
if (!empty($_GET['success'])) {
if (!empty($_GET['success'])) {
$this->message = __('Your settings have been saved.', 'paypal-for-woocommerce-multi-account-management');
}
if (!empty($_GET['deleted'])) {
Expand All @@ -703,6 +696,7 @@ public function angelleye_multi_account_ui() {
if (!empty($_POST['angelleye_multi_account_choose_payment_gateway']) && $_POST['angelleye_multi_account_choose_payment_gateway'] == 'paypal') {
$this->angelleye_save_multi_account_data_paypal();
}

if (empty($_GET['action'])) {
?>
<br/>
Expand All @@ -714,7 +708,6 @@ public function angelleye_multi_account_ui() {
<?php echo $this->angelleye_multi_account_api_field_ui() ?>
<?php echo $this->angelleye_multi_account_paypal_pro_payflow_api_field_ui(); ?>
<?php echo $this->angelleye_multi_account_api_paypal_field_ui(); ?>
<?php echo $this->angelleye_multi_account_condition_ui(); ?>
<?php
$angelleye_payment_load_balancer = get_option('angelleye_payment_load_balancer', '');
if($angelleye_payment_load_balancer == '') {
Expand Down Expand Up @@ -1229,14 +1222,12 @@ public function angelleye_get_product_tag_by_product_cat() {
'fields' => 'ids',
'post_status' => 'publish',
'tax_query' => array(

array(
'taxonomy' => 'product_type',
'field' => 'slug',
'terms' => array('grouped', 'external'),
'operator' => 'NOT IN',
)

)
);
if (isset($_POST['author']) && $_POST['author'] != 'all') {
Expand Down Expand Up @@ -1293,7 +1284,6 @@ public function angelleye_get_product_by_product_tags() {
'terms' => array('grouped', 'external'),
'operator' => 'NOT IN',
)

)
);

Expand Down Expand Up @@ -2357,13 +2347,6 @@ public function angelleye_pfwma_display_notice() {
}
}

public function own_update_angelleye_multi_account() {
delete_transient( 'angelleye_multi_ec_payment_load_balancer_synce' );
delete_transient( 'angelleye_multi_ec_payment_load_balancer_synce_sandbox' );
delete_transient( 'angelleye_multi_payflow_payment_load_balancer_synce' );
delete_transient( 'angelleye_multi_payflow_payment_load_balancer_synce_sandbox' );
}

public function angelleye_pfwma_display_marketing_sidebar() {
if (false === ( $html = get_transient('angelleye_dynamic_marketing_sidebar_html_pfwma') )) {
$response = wp_remote_get('https://8aystwpoqi.execute-api.us-east-2.amazonaws.com/AngellEyeDynamicSidebar?pluginId=18');
Expand Down Expand Up @@ -2406,4 +2389,10 @@ public function angelleye_pfwma_plugin_deactivation_request() {
}
}

}
public function own_update_angelleye_multi_account() {
delete_transient( 'angelleye_multi_ec_payment_load_balancer_synce' );
delete_transient( 'angelleye_multi_ec_payment_load_balancer_synce_sandbox' );
delete_transient( 'angelleye_multi_payflow_payment_load_balancer_synce' );
delete_transient( 'angelleye_multi_payflow_payment_load_balancer_synce_sandbox' );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ private function define_admin_hooks() {
$this->loader->add_action('wp_ajax_pfwma_disable_all_vendor_rules', $plugin_admin, 'angelleye_pfwma_disable_all_vendor_rules');
$this->loader->add_action('wp_ajax_pfwma_enable_all_vendor_rules', $plugin_admin, 'angelleye_pfwma_enable_all_vendor_rules');
$this->loader->add_action( 'admin_init', $plugin_admin, 'angelleye_pfwma_display_notice');
$this->loader->add_action( 'admin_footer', $plugin_admin, 'angelleye_pfwma_add_deactivation_form');
$this->loader->add_action( 'wp_ajax_angelleye_send_deactivation_pfwma', $plugin_admin, 'angelleye_pfwma_plugin_deactivation_request');
$angelleye_payment_load_balancer = get_option('angelleye_payment_load_balancer', '');
if($angelleye_payment_load_balancer != '') {
$load_balancer = new Paypal_For_Woocommerce_Multi_Account_Management_Payment_Load_Balancer($this->get_plugin_name(), $this->get_version());
Expand All @@ -215,9 +217,6 @@ private function define_admin_hooks() {
$this->loader->add_filter('angelleye_is_express_checkout_parallel_payment_not_used', $express_checkout, 'own_angelleye_is_payment_load_balancer_not_used', 12, 2);
$this->loader->add_filter('angelleye_is_express_checkout_parallel_payment_handle', $express_checkout, 'own_angelleye_is_express_checkout_payment_load_balancer_handle', 12, 3);
$this->loader->add_action('update_angelleye_multi_account', $plugin_admin, 'own_update_angelleye_multi_account', 10);
$this->loader->add_action( 'admin_footer', $plugin_admin, 'angelleye_pfwma_add_deactivation_form');
$this->loader->add_action( 'wp_ajax_angelleye_send_deactivation_pfwma', $plugin_admin, 'angelleye_pfwma_plugin_deactivation_request');

}

/**
Expand Down

0 comments on commit 5ff134d

Please sign in to comment.