woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

AXO: Send JS logs to WooCommerce logger (3172) #2263

Closed Dinamiko closed 1 month ago

Dinamiko commented 1 month ago

As most of the AXO flows happens on the frontend it would make sense to add logic for sending JS log entries to WooCommerce logger so we could debug what happened, for example which kind of user started the flow or which data was sent and received from PayPal.

Dinamiko commented 1 month ago

Good job on this @Dinamiko!

I have tested the PR and the logging functionality seems to be working correctly.

logger

The code looks legit, I only have a few minor suggestions and concerns :)

I am a bit wary of including so much sensitive data (customer billing details) in the logs. Perhaps we can obfuscate/sanitize the response?

WC Logs are accessible to admins only, customer billing details can also be seen by admins in the WC order. We are already logging the requests to PayPal which includes the payer information in the request body.

Being said that, right now I'm not 100% sure which data should be logged... the idea is log the data that could be useful when debugging issues, so the idea for now is to have the frontend logging mechanism in place and then we'll decide which log entries do we really need.