pinterest-for-woocommerce icon indicating copy to clipboard operation
pinterest-for-woocommerce copied to clipboard

Donot repeatedly call v3_create_commerce_partner_merchant for 409 error

Open adarshakb opened this issue 1 year ago • 0 comments

Describe the bug:

v3_create_commerce_partner_merchant is called repeatedly to register merchant. But in some error cases it should not be called. Instead we should stop calling it and ask the merchant to disconnect and reconnect the plugin at a later time after the issue is fixed.

Error 1: Merchant has already connected to other platform Error 2: You are trying to connect a new domain %s. Please disconnect from the previous domain %s and retry. example - You are trying to connect a new domain spence550stg.wpengine.com. Please disconnect from the previous domain spencediamonds.com and retry.

Steps to reproduce:

  1. To reproduce error 1 , connect an account in woocommerce thats connected to Pinterest shopify app
  2. To reproduce error 2, connect an account to domain A and then without disconnecting connect to domain B

Expected behavior:

When we encounter 4xx errors we should not repeatedly call the API as most of the errors are not recoverable.

Actual behavior:

App repeatedly calls the API

adarshakb avatar Nov 17 '23 18:11 adarshakb