woocommerce/pinterest-for-woocommerce

v5: "We are still reviewing your account. Please try again later"

adarshakb opened this issue · 0 comments

Describe the bug:

Sometimes the API rejects users from connecting the feed profile.

We should shown an error message then to the user of why feed profile registration failed

Steps to reproduce:

  1. Connect a new pinterest user. You may need to disconnect the user and connect again sometimes

Expected behavior:

When API errors, we show the error message to user so they can easily pass it back to customer support.

Actual behavior:

App swallows the error

Additional details:

Screenshot 2024-03-18 at 3 06 33 PM

Body: {"items":[{"preferred_processing_schedule":null,"location":"https://joyfully-chief-kingdom.jurassic.ninja/wp-content/uploads/pinterest-for-woocommerce-fpRZXX.xml","updated_at":"2024-03-18T21:58:18.017000","default_locale":"en-US","format":"XML","status":"ACTIVE","credentials":null,"name":null,"default_currency":"USD","default_country":"US","default_availability":null,"created_at":"2024-03-18T21:58:18.017000","id":"1553650766411","catalog_type":"RETAIL"}],"bookmark":null}
2024-03-18T22:03:41+00:00 Debug PATCH Request: https://api.pinterest.com/v5/catalogs/feeds/1553650766411?ad_account_id=549767509140

{"location":"https://joyfully-chief-kingdom.jurassic.ninja/wp-content/uploads/pinterest-for-woocommerce-iePdXY.xml","status":"ACTIVE","preferred_processing_schedule":{"time":"22:08","timezone":"Etc/UTC"},"catalog_type":"RETAIL"}
2024-03-18T22:03:41+00:00 Debug Response:

Status: 403 Forbidden

Headers: {"content-type":"application/json","content-length":"85","pinterest-version":"974758f","x-content-type-options":"nosniff","x-frame-options":"DENY","access-control-allow-credentials":"true","p3p":"CP="Pinterest does not have a P3P policy. You can find our privacy policy at https://www.pinterest.com///policy/privacy-policy."","x-envoy-upstream-service-time":"73","pinterest-generated-by":"tpp-api-prod-0a03d4e5","x-ratelimit-limit":"100, 100;w=1, 100;w=60","x-ratelimit-remaining":"98","x-ratelimit-reset":"1","cache-control":"no-cache, no-store, must-revalidate","x-pinterest-rid":"3261678879571796","date":"Mon, 18 Mar 2024 22:03:41 GMT","alt-svc":"h3=":443"; ma=600","set-cookie":"_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure","akamai-grn":"0.9fed19b8.1710799421.3281a9dd","x-cdn":"akamai"}

Body: {"code":2626,"message":"We are still reviewing your account. Please try again later"}
2024-03-18T22:03:41+00:00 Error We are still reviewing your account. Please try again later
#0 /srv/htdocs/wp-content/plugins/pinterest-for-woocommerce/src/API/Base.php(93): Automattic\WooCommerce\Pinterest\API\Base::handle_request(Array)
#1 /srv/htdocs/wp-content/plugins/pinterest-for-woocommerce/src/API/APIV5.php(531): Automattic\WooCommerce\Pinterest\API\Base::make_request('catalogs/feeds/...', 'PATCH', Array)
#2 /srv/htdocs/wp-content/plugins/pinterest-for-woocommerce/src/Feeds.php(202): Automattic\WooCommerce\Pinterest\API\APIV5::update_feed('1553650766411', Array, '549767509140')
#3 /srv/htdocs/wp-content/plugins/pinterest-for-woocommerce/src/FeedRegistration.php(147): Automattic\WooCommerce\Pinterest\Feeds::update_feed('1553650766411', Array)
#4 /srv/htdocs/wp-content/plugins/pinterest-for-woocommerce/src/FeedRegistration.php(92): Automattic\WooCommerce\Pinterest\FeedRegistration::register_feed()
#5 /srv/htdocs/wp/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Pinterest\FeedRegistration->handle_feed_registration()
#6 /srv/htdocs/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#7 /srv/htdocs/wp/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#8 /srv/htdocs/wp-content/plugins/woocommerce/packages/action-scheduler/classes/actions/ActionScheduler_Action.php(56): do_action_ref_array('pinterest-for-w...', Array)
#9 /srv/htdocs/wp-content/plugins/woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php(88): ActionScheduler_Action->execute()
#10 /srv/htdocs/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(169): ActionScheduler_Abstract_QueueRunner->process_action(91, 'Async Request')
#11 /srv/htdocs/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php(139): ActionScheduler_QueueRunner->do_batch(25, 'Async Request')
#12 /srv/htdocs/wp/wp-includes/class-wp-hook.php(324): ActionScheduler_QueueRunner->run('Async Request')
#13 /srv/htdocs/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#14 /srv/htdocs/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#15 /srv/htdocs/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php(52): do_action('action_schedule...', 'Async Request')
#16 /srv/htdocs/wp-content/plugins/woocommerce/includes/libraries/wp-async-request.php(147): ActionScheduler_AsyncRequest_QueueRunner->handle()
#17 /srv/htdocs/wp/wp-includes/class-wp-hook.php(324): WP_Async_Request->maybe_handle('')
#18 /srv/htdocs/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#19 /srv/htdocs/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#20 /srv/htdocs/wp/wp-admin/admin-ajax.php(188): do_action('wp_ajax_as_asyn...')
#21 {main}
2024-03-18T22:03:41+00:00 Error We are still reviewing your account. Please try again later