The CashAppPay option on the Web Payments SDK seems to be unstoppably spammy

Greetings,

We’re noticing that when the Square Payment Form loads with the Cash App Pay button, the browser will continually make a request against the cashapp website every second. What’s a bit disturbing is that when the user leaves the page, such that the Payment Form is no longer displaying, or if they choose a different payment option (such as Apple Pay, Google Pay, or Credit Card), the requests do not stop.

We had initially followed the implementation as proposed in the example documentation, which did not list any destroy calls, after we attach the elements to their respective DOM Elements. However, even when we call destory, the API calls persist.

Furthermore, if the user leaves the Payment Form, and returns in the same Browser SPA session, the Cash App Pay button will not load citing the message that it needs to be destroyed before being created again. Again, this is despite the fact that we’re calling the destroy method on the various Payment Element Options.

https://developer.squareup.com/reference/sdks/web/payments/cash-app-pay#CashAppPay.destroy

Is this a bug we are encountering? Is the behavior somehow different on the Sandbox than the Production environment when it comes to destroying these elements, or is there something I’m missing.

Please let me know,

Thanks,

~ Theodore Schnepper

:wave: Is this in production or sandbox? Also what’s your application ID and is the page that the form is on available so we can take a look? :slightly_smiling_face:

We’ve noticed it occurring on both Sandbox and Production.

The Sandbox Application ID is as follows: sandbox-sq0idb-GowUqXPtPHsc_njczAnCYA
The Production Application ID is as follows: sq0idp-fS_lWfoTDo87DJfrl13Xvw

Our production site does not yet have the destroy method being called on the checkout process when the Elements become unmounted. However, the behavior I described above has been observed when we attempt to update the Element in isolation in our testing environment, though that would only be running on the Sandbox Environment.

Sandbox Example
Production Example

Please let me know if you have any questions,

Thanks,

~ Theodore Schnepper

According to the team this is expected at this time and improvements will follow. :slightly_smiling_face: