Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate PayPalWebClient Analytics Logic Into PayPalWebAnalytics Class #300

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sshropshire
Copy link
Collaborator

Summary of changes

  • This PR creates a PayPalWebAnalytics class to encapsulate analytics notification logic
  • Externalizing Analytics code should make Analytics Events easier to audit in one place
  • Externalizing Analytics will also make future refactoring to migrate away from the listener pattern more clear

Checklist

  • Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

class CardAnalytics(
private val analyticsService: AnalyticsService
) {
internal class CardAnalytics(private val analyticsService: AnalyticsService) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking analytics related classes internal. I forgot to add this in the previous PR so adding it here now.

@sshropshire sshropshire marked this pull request as ready for review November 26, 2024 17:41
@sshropshire sshropshire requested a review from a team as a code owner November 26, 2024 17:41
@@ -5,7 +5,6 @@ import android.content.Intent
import android.util.Log
import androidx.activity.ComponentActivity
import com.paypal.android.corepayments.CoreConfig
import com.paypal.android.corepayments.PayPalSDKError
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you don't need this now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this import was only used in a function declaration e.g.

private fun notifyWebCheckoutFailure(error: PayPalSDKError, orderId: String?) {}

We removed those methods and the import got flagged by detekt as no longer needed.

Copy link
Collaborator

@KunJeongPark KunJeongPark Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not needed because the launcher imports PayPalWebCheckoutError? I think I got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants