-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add Shopper Session ID param #1241
Changes from 4 commits
5ff74ea
543fd50
3959200
6306c27
f04e950
d33df2a
18e4e28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import android.net.Uri | |
import android.text.TextUtils | ||
import com.braintreepayments.api.BrowserSwitchOptions | ||
import com.braintreepayments.api.core.AnalyticsEventParams | ||
import com.braintreepayments.api.core.AnalyticsParamRepository | ||
import com.braintreepayments.api.core.BraintreeClient | ||
import com.braintreepayments.api.core.BraintreeException | ||
import com.braintreepayments.api.core.BraintreeRequestCodes | ||
|
@@ -25,8 +24,7 @@ import org.json.JSONObject | |
class PayPalClient internal constructor( | ||
private val braintreeClient: BraintreeClient, | ||
private val internalPayPalClient: PayPalInternalClient = PayPalInternalClient(braintreeClient), | ||
private val merchantRepository: MerchantRepository = MerchantRepository.instance, | ||
private val analyticsParamRepository: AnalyticsParamRepository = AnalyticsParamRepository.instance | ||
private val merchantRepository: MerchantRepository = MerchantRepository.instance | ||
) { | ||
/** | ||
* Used for linking events from the client to server side request | ||
|
@@ -44,6 +42,11 @@ class PayPalClient internal constructor( | |
*/ | ||
private var isVaultRequest = false | ||
|
||
/** | ||
* Used for sending Shopper Insights session ID provided by merchant to FPTI | ||
*/ | ||
private var shopperSessionId: String? = null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we save this in a repository singleton outside of the Client class? Maybe a PayPalRepository that holds all PayPal specific values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered adding it to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah gotcha. That makes sense 👍 |
||
|
||
/** | ||
* Initializes a new [PayPalClient] instance | ||
* | ||
|
@@ -74,11 +77,7 @@ class PayPalClient internal constructor( | |
payPalRequest: PayPalRequest, | ||
callback: PayPalPaymentAuthCallback | ||
) { | ||
// The shopper insights server SDK integration | ||
payPalRequest.shopperSessionId?.let { | ||
analyticsParamRepository.setSessionId(it) | ||
} | ||
|
||
shopperSessionId = payPalRequest.shopperSessionId | ||
isVaultRequest = payPalRequest is PayPalVaultRequest | ||
|
||
braintreeClient.sendAnalyticsEvent(PayPalAnalytics.TOKENIZATION_STARTED, analyticsParams) | ||
|
@@ -337,7 +336,8 @@ class PayPalClient internal constructor( | |
return AnalyticsEventParams( | ||
payPalContextId = payPalContextId, | ||
linkType = linkType?.stringValue, | ||
isVaultRequest = isVaultRequest | ||
isVaultRequest = isVaultRequest, | ||
shopperSessionId = shopperSessionId | ||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we want to match iOS?
/// The Shopper Insights customer session ID created by a merchant's server SDK or graphQL integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍