: '', ( isset( $data->payer_id ) ) ? $data->payer_id : '', $address, $birth_date, $phone, $tax_info ); } /** * Returns a Payer object based off the given checkout form fields. * * @param array $form_fields The checkout form fields. * @return Payer * @throws RuntimeException When invalid data. */ public function from_checkout_form( array $form_fields ): Payer { $first_name = $form_fields['billing_first_name'] ?? ''; $last_name = $form_fields['billing_last_name'] ?? ''; $billing_email = $form_fields['billing_email'] ?? ''; $billing_country = $form_fields['billing_country'] ?? ''; $billing_address_1 = $form_fields['billing_address_1'] ?? ''; $billing_address_2 = $form_fields['billing_address_2'] ?? ''; $admin_area_1 = $form_fields['billing_state'] ?? ''; $admin_area_2 = $form_fields['billing_city'] ?? ''; $billing_postcode = $form_fields['billing_postcode'] ?? ''; $phone = null; if ( isset( $form_fields['billing_phone'] ) && '' !== $form_fields['billing_phone'] ) { // make sure the phone number contains only numbers and is max 14. chars long. $national_number = $form_fields['billing_phone']; $national_number = preg_replace( '/[^0-9]/', '', $national_number ); if ( null !== $national_number ) { $national_number = substr( $national_number, 0, 14 ); if ( $national_number ) { $phone = new PhoneWithType( 'HOME', new Phone( $national_number ) ); } } } if ( ! is_email( $billing_email ) ) { /* phpcs:disable WordPress.WP.I18n.TextDomainMismatch translators: %s: email address */ throw new RuntimeException( sprintf( __( '%s is not a valid email address.', 'woocommerce' ), esc_html( $billing_email ) ) ); } return new Payer( new PayerName( $first_name, $last_name ), $billing_email, '', new Address( $billing_country, $billing_address_1, $billing_address_2, $admin_area_1, $admin_area_2, $billing_postcode ), null, $phone ); } }
Fatal error: Uncaught Error: Class "WooCommerce\PayPalCommerce\ApiClient\Factory\PayerFactory" not found in /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php:404 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(71): WooCommerce\PayPalCommerce\ApiClient\ApiModule::WooCommerce\PayPalCommerce\ApiClient\{closure}(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #1 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php(414): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get('api.factory.pay...') #2 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(71): WooCommerce\PayPalCommerce\ApiClient\ApiModule::WooCommerce\PayPalCommerce\ApiClient\{closure}(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #3 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php(217): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get('api.factory.ord...') #4 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(71): WooCommerce\PayPalCommerce\ApiClient\ApiModule::WooCommerce\PayPalCommerce\ApiClient\{closure}(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #5 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-subscriptions/services.php(28): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get('api.endpoint.or...') #6 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(71): WooCommerce\PayPalCommerce\WcSubscriptions\WcSubscriptionsModule::WooCommerce\PayPalCommerce\WcSubscriptions\{closure}(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #7 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-compat/services.php(30): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get('wc-subscription...') #8 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php(71): WooCommerce\PayPalCommerce\Compat\CompatModule::WooCommerce\PayPalCommerce\Compat\{closure}(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #9 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-compat/src/CompatModule.php(93): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer->get('compat.ppec.sub...') #10 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-compat/src/CompatModule.php(54): WooCommerce\PayPalCommerce\Compat\CompatModule->initialize_ppec_compat_layer(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #11 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(530): WooCommerce\PayPalCommerce\Compat\CompatModule->run(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #12 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(405): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->doExecute() #13 /htdocs/wp-content/plugins/woocommerce-paypal-payments/bootstrap.php(40): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->boot() #14 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(77): {closure}('/htdocs/wp-cont...') #15 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(92): WooCommerce\PayPalCommerce\init() #16 /htdocs/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\{closure}('') #17 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #18 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #19 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #20 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #21 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #22 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #23 /htdocs/index.php(17): require('/htdocs/wp-blog...') #24 {main} Next Exception: Can't obtain the container instance at this point of application. in /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php:701 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(639): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->assertStatus(4, 'obtain the cont...', '>=') #1 /htdocs/wp-content/plugins/woocommerce-paypal-payments/bootstrap.php(42): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->container() #2 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(77): {closure}('/htdocs/wp-cont...') #3 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(92): WooCommerce\PayPalCommerce\init() #4 /htdocs/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\{closure}('') #5 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #6 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #7 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #8 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #9 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #10 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #11 /htdocs/index.php(17): require('/htdocs/wp-blog...') #12 {main} thrown in /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php on line 701