Load PayPal gateway directly to prevent potential gateway errors.

`install()` method may be called before wc_version is set, this may cause unknown errors in 3PD gateways.

So its safer to only load PayPal gateway directly.
This commit is contained in:
vedanshujain 2021-06-17 14:32:21 +05:30
parent ed3c76bd1d
commit 381626069e
1 changed files with 3 additions and 1 deletions

View File

@ -1631,7 +1631,9 @@ CREATE TABLE {$wpdb->prefix}wc_reserved_stock (
*/
private static function set_paypal_standard_load_eligibility() {
// Initiating the payment gateways sets the flag.
WC()->payment_gateways();
if ( class_exists( 'WC_Gateway_Paypal' ) ) {
( new WC_Gateway_Paypal() )->should_load();
}
}
}