Skip to content

Commit

Permalink
Merge pull request #2049 from angelleye/PFW-1804
Browse files Browse the repository at this point in the history
PFW-1804, Remove PFWMA condition for migration
  • Loading branch information
kcppdevelopers authored Jun 13, 2024
2 parents 43b62bb + 444391c commit 2b2b6c2
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 34 deletions.
3 changes: 0 additions & 3 deletions ppcp-gateway/class-angelleye-paypal-ppcp-admin-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ public function admin_notices() {
if (isset($_GET['page']) && 'paypal-for-woocommerce' === $_GET['page']) {
return;
}
if (class_exists('Paypal_For_Woocommerce_Multi_Account_Management')) {
return;
}
$notice_data['classic_upgrade'] = array(
'id' => 'ppcp_notice_classic_upgrade',
'ans_company_logo' => PAYPAL_FOR_WOOCOMMERCE_ASSET_URL . 'ppcp-gateway/images/admin/angelleye-icon.jpg',
Expand Down
54 changes: 25 additions & 29 deletions ppcp-gateway/class-angelleye-paypal-ppcp-admin-onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,42 +327,38 @@ public function display_view() {
}
}
$this->angelleye_ppcp_load_variable();

if (class_exists('Paypal_For_Woocommerce_Multi_Account_Management')) {
$this->view();
} else {
$angelleye_classic_gateway_id_list = array('paypal_express', 'paypal_pro', 'paypal_pro_payflow', 'paypal_advanced', 'paypal_credit_card_rest', 'paypal', 'ppec_paypal');
$active_classic_gateway_list = array();
foreach (WC()->payment_gateways->get_available_payment_gateways() as $gateway) {
if (in_array($gateway->id, $angelleye_classic_gateway_id_list) && 'yes' === $gateway->enabled && $gateway->is_available() === true) {
$active_classic_gateway_list[$gateway->id] = $gateway->id;
}
$angelleye_classic_gateway_id_list = array('paypal_express', 'paypal_pro', 'paypal_pro_payflow', 'paypal_advanced', 'paypal_credit_card_rest', 'paypal', 'ppec_paypal');
$active_classic_gateway_list = array();
foreach (WC()->payment_gateways->get_available_payment_gateways() as $gateway) {
if (in_array($gateway->id, $angelleye_classic_gateway_id_list) && 'yes' === $gateway->enabled && $gateway->is_available() === true) {
$active_classic_gateway_list[$gateway->id] = $gateway->id;
}
$other_payment_methods = $this->angelleye_ppcp_get_other_payment_methods();
if (!empty($other_payment_methods)) {
foreach ($other_payment_methods as $gateway_id) {
if (in_array($gateway_id, array('paypal', 'ppec_paypal'))) {
//$active_classic_gateway_list[$gateway_id] = $gateway_id;
}
}
$other_payment_methods = $this->angelleye_ppcp_get_other_payment_methods();
if (!empty($other_payment_methods)) {
foreach ($other_payment_methods as $gateway_id) {
if (in_array($gateway_id, array('paypal', 'ppec_paypal'))) {
//$active_classic_gateway_list[$gateway_id] = $gateway_id;
}
}
if (count($active_classic_gateway_list) > 0) {
$paypal_vault_supported_country = angelleye_ppcp_apple_google_vault_supported_country();
if (in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled) {
$this->migration_view($active_classic_gateway_list);
} elseif (!in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled) {
$this->view();
} elseif (in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled === false) {
$this->migration_view($active_classic_gateway_list);
} elseif (!in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled === false) {
$this->migration_view($active_classic_gateway_list);
} else {
$this->view();
}
}
if (count($active_classic_gateway_list) > 0) {
$paypal_vault_supported_country = angelleye_ppcp_apple_google_vault_supported_country();
if (in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled) {
$this->migration_view($active_classic_gateway_list);
} elseif (!in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled) {
$this->view();
} elseif (in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled === false) {
$this->migration_view($active_classic_gateway_list);
} elseif (!in_array($this->ppcp_paypal_country, $paypal_vault_supported_country) && $this->subscription_support_enabled === false) {
$this->migration_view($active_classic_gateway_list);
} else {
$this->view();
}
} else {
$this->view();
}

} catch (Exception $ex) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public function angelleye_ppcp_display_seller_onboard_notice() {
if (function_exists('woocommerce_output_all_notices')) {
if (false !== get_transient('angelleye_ppcp_multi_account_seller_onboarding_process_done')) {
if (function_exists('wc_add_notice')) {
wc_add_notice(sprintf(esc_html__('Just one more step to connect your PayPal account to %s and begin receiving payments for your products and services.', 'paypal-for-woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)), 'success');
wc_add_notice(sprintf(esc_html__('Your PayPal account has been connected successfully and you are ready to rock! You may now list your products/services for sale on %s and payments will be sent directly to you.', 'paypal-for-woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)), 'success');
delete_transient('angelleye_ppcp_multi_account_seller_onboarding_process_done');
}
}
Expand Down
2 changes: 1 addition & 1 deletion ppcp-gateway/class-wc-gateway-ppcp-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public function get_icon() {
public function angelleye_ppcp_admin_notices() {
$is_saller_onboarding_done = false;
$is_saller_onboarding_failed = false;
$onboarding_success_message = sprintf(esc_html__('Just one more step to connect your PayPal account to %s and begin receiving payments for your products and services.', 'paypal-for-woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES));
$onboarding_success_message = sprintf(esc_html__('Your PayPal account has been connected successfully and you are ready to rock!', 'paypal-for-woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES));
if (false !== get_transient('angelleye_ppcp_sandbox_seller_onboarding_process_done')) {
$is_saller_onboarding_done = true;
delete_transient('angelleye_ppcp_sandbox_seller_onboarding_process_done');
Expand Down
1 change: 1 addition & 0 deletions template/migration/ppcp_paypal_advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions template/migration/ppcp_paypal_credit_card_rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions template/migration/ppcp_paypal_express.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions template/migration/ppcp_paypal_express_paypal_pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions template/migration/ppcp_paypal_pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<li><?php echo __('Direct Credit Cards (No Login Required!)', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Credit Card Fees Reduced to 2.69%!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Pro No Longer Required – No Monthly Fees!', 'paypal-for-woocommerce'); ?></li>
<li><?php echo __('Full Support for Multi-Account Functionality', 'paypal-for-woocommerce'); ?></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 2b2b6c2

Please sign in to comment.