Wrong API key results in fatal error – how to fix
-
I can still browse the site, but when I go to the PayPal settings page, it throws a fatal error. This occurred after the wrong API credentials were added. How can I fix this so I can finish setting PayPal up?
Error Details
=============
An error of type E_ERROR was caused in line 122 of the file /usr/src/app/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php. Error message: Uncaught WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException: Could not create token. in /usr/src/app/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php:122
Stack trace:
#0 /usr/src/app/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php(97): WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer->newBearer()
#1 /usr/src/app/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php(150): WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer->bearer()
#2 /usr/src/app/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php(236): WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsListener->listen_for_vaulting_enabled()
#3 /usr/src/app/wp-includes/class-wp-hook.php(292): WooCommerce\PayPalCommerce\WcGateway\WcGatewayModule::WooCommerce\PayPalCommerce\WcGateway\
-
Hello @siteworkscollab
can you please deinstall the plugin completely and install it again?
Thank you
Regards
AndreasHi Andreas – I’ve tried that several times and it still is not working. The same error persists.
Hello @siteworkscollab
can you please add this to your wp-confog.php before Happy blogging
// Remove all data from on uninstall
define(‘WC_REMOVE_ALL_DATA’, true);Please uninstall the plugin and install it again. That code forces WordPress to remove all entries from the plugin when it gets uninstalled. Please note its valid for all other plugins too
Best regards
Andreas- This reply was modified 3 years, 5 months ago by Andreas W..
Closed because of inactivity
Ran into the same issue.
We where trying to set it up using the PayPal Sandbox Business Pro account
We will keep looking into it but hope this helps
The reply was
["body"]=> string(77) "{"error":"invalid_client","error_description":"Client Authentication failed"}" ["response"]=> array(2) { ["code"]=> int(401) ["message"]=> string(12) "Unauthorized" }
Error
2021/07/22 20:04:56 [error] 83366#83366: *125028 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException: Could not create token. in /www/localhost/public/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php:122 Stack trace: #0 /www/localhost/public/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php(97): WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer->newBearer() #1 /www/localhost/public/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php(150): WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer->bearer() #2 /www/localhost/public/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php(236): WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsListener->listen_for_vaulting_enabled() #3 /www/localhost" while reading response header from upstream, client: 98.0.35.41, server: localhost.dev, request: "GET /wp-admin/admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-localhost.sock:", host: "localhost.dev", referrer: "https://localhost.dev/wp-admin/admin.php?page=wc-settings&tab=checkout"
### WordPress Environment ### WordPress address (URL): http://localhost.dev Site address (URL): http://localhost.dev WC Version: 5.5.1 REST API Version: ✔ 5.5.1 WC Blocks Version: ✔ 5.3.2 Action Scheduler Version: ✔ 3.2.1 WC Admin Version: ✔ 2.4.1 Log Directory Writable: ✔ WP Version: ❌ 5.7.2 - There is a newer version of WordPress available (5.8) WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: – Language: en_US External object cache: – ### Server Environment ### Server Info: nginx/1.21.0 PHP Version: 7.4.21 PHP Post Max Size: 128 MB PHP Time Limit: 300 PHP Max Input Vars: 10000 cURL Version: 7.68.0 OpenSSL/1.1.1f SUHOSIN Installed: – MySQL Version: 5.5.5-10.5.10-MariaDB-1:10.5.10+maria~focal-log Max Upload Size: 128 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 5.5.1 WC Database Prefix: wp_ Total Database Size: 5.27MB Database Data Size: 3.34MB Database Index Size: 1.93MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.02MB + Index: 0.13MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_ac_segments: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_admin_columns: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_gf_addon_feed: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form_view: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 2.05MB + Index: 0.06MB + Engine InnoDB wp_postmeta: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_posts: Data: 0.05MB + Index: 0.06MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.03MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_indexable: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### attachment: 2 customize_changeset: 2 nav_menu_item: 30 page: 29 post: 2 product: 1 product_variation: 2 revision: 23 wc_membership_plan: 1 wc_user_membership: 2 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (15) ### Gravity Forms: by Gravity Forms – 2.5.7 Admin Columns Pro: by AdminColumns.com – 5.5.3 Advanced Custom Fields PRO: by Delicious Brains – 5.9.8 Akismet Anti-Spam: by Automattic – 4.1.10 Gravity Forms Event Tracking: by Ronald Huereca – 2.4.2 Hall Customization: by Hall – 1.20.0 Hall Mail: by Hall – 1.8.3 Privacy Notice: by Hall Internet Marketing – 1.0.0 Hall Updater: by Hall – 1.3.1 WooCommerce Memberships: by SkyVerge – 1.22.3 WooCommerce PayPal Payments: by WooCommerce – 1.3.2 WooCommerce Social Login: by SkyVerge – 2.11.0 WooCommerce Subscriptions: by WooCommerce – 3.1.3 (update to version 3.1.4 is available) WooCommerce: by Automattic – 5.5.1 Yoast SEO: by Team Yoast – 16.7 ### Inactive Plugins (7) ### Google Listings and Ads: by WooCommerce – 1.2.1 Google Tag Manager for WordPress: by Thomas Geiger – 1.13.1 Teams for WooCommerce Memberships: by SkyVerge – 1.5.5 WooCommerce AvaTax: by SkyVerge – 1.13.0 WooCommerce Google Analytics Pro: by SkyVerge – 1.10.0 WooCommerce Stripe Gateway: by WooCommerce – 5.2.3 WooCommerce Subscriptions Gifting: by WooCommerce – 2.1.3 ### Must Use Plugins (1) ### Kinsta Must-use Plugins: by Kinsta Team – 2.3.6 ### Settings ### API Enabled: – Force SSL: ✔ Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #7 - /shop/ Cart: #8 - /cart/ Checkout: #9 - /checkout/ My account: #10 - /my-account/ Terms and conditions: #42 - /terms-of-use/ ### Theme ### Name: localhost Version: 3.2 Author URL: localhost theme Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Memberships ### Restriction mode:: Hide content only Public content:: – Excluded from discounts:: – Membership plans:: 1 Individual:: Members: 0Access method: Product(s) purchaseAccess length: Unlimited Subscription: YesInstallment plan: No ### Subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://localhost.dev Subscription Statuses: – WooCommerce Account Connected: ❌ No Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure ### Store Setup ### Country / State: United States (US) — Illinois ### Payment Gateway Support ### PayPal Standard: subscription_payment_method_change_customer subscription_payment_method_change_admin subscription_amount_changes subscription_date_changes multiple_subscriptions subscription_payment_method_delayed_change subscriptions subscription_cancellation subscription_suspension subscription_reactivation products refunds PayPal Reference Transactions Enabled: ✔ Yes ### Social Login ### Facebook: ✔ Available Twitter: Disabled Google: ✔ Available Amazon: Disabled Linkedin: Disabled Paypal: Disabled Disqus: Disabled Yahoo: Disabled Vkontakte: Disabled ### Action Scheduler ### Complete: 54 Oldest: 2021-07-22 16:15:01 +0000 Newest: 2021-07-22 20:00:01 +0000 Pending: 1 Oldest: 2021-07-22 20:04:47 +0000 Newest: 2021-07-22 20:04:47 +0000 ### Status report information ### Generated at: 2021-07-22 20:14:32 +00:00
Tried https://wordpress.org/support/topic/wrong-api-key-results-in-fatal-error-how-to-fix/#post-14607222
It didn’t work
Manually deleted the
woocommerce_ppcp-gateway_settings
andwoocommerce-ppcp-settings
from the wp_option table.It seems like the issue was the login process for the sandbox was unclear and entering the incorrect information in the manual process was causing the issue.
Additional checks/validation should be done on the information and documentation improved.
Otherwise should be all set now for me.
Hopefully the information above helps.
Hi @timbhowe,
Apologies for the trouble with the plugin setup.
This issue has been resolved for our next update 1.4.0 which is set to be released sometime next week. We are also implementing additional checks that verify the feature availability for connected PayPal accounts.
You can find the current plugin documentation here: https://docs.woocommerce.com/document/woocommerce-paypal-payments/
The documentation will be expanded with more details sometime soon.
If there’s anything specific you’d like to see or when you want to share feedback, please let us know.
Thanks!Kind regards,
NiklasAwesome! Glad to hear it and thanks for the info.
- The topic ‘Wrong API key results in fatal error – how to fix’ is closed to new replies.