From 7dedb0a9abd4b2f0945527f5d2c488fdda46c4b5 Mon Sep 17 00:00:00 2001 From: Justin Warmkessel Date: Tue, 3 Dec 2024 10:37:39 -0800 Subject: [PATCH 01/17] Add shopper insights session ID to paypalRequest --- .../demo/ShopperInsightsFragment.kt | 6 ++++ .../res/layout/fragment_shopping_insights.xml | 29 ++++++++++++++++++- .../api/paypal/PayPalCheckoutRequest.kt | 4 +++ .../api/paypal/PayPalRequest.kt | 4 +++ .../api/paypal/PayPalVaultRequest.kt | 2 ++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt b/Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt index 65ad45b48e..871b8f25c2 100644 --- a/Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt +++ b/Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt @@ -49,6 +49,8 @@ class ShopperInsightsFragment : BaseFragment() { private lateinit var nationalNumberInput: TextInputLayout private lateinit var emailNullSwitch: SwitchMaterial private lateinit var phoneNullSwitch: SwitchMaterial + private lateinit var shopperInsightsSessionIdInput: TextInputLayout + private lateinit var shopperInsightsSessionIdNullSwitch: SwitchMaterial private lateinit var shopperInsightsClient: ShopperInsightsClient private lateinit var payPalClient: PayPalClient @@ -95,9 +97,13 @@ class ShopperInsightsFragment : BaseFragment() { nationalNumberInput = view.findViewById(R.id.nationalNumberInput) emailNullSwitch = view.findViewById(R.id.emailNullSwitch) phoneNullSwitch = view.findViewById(R.id.phoneNullSwitch) + shopperInsightsSessionIdInput = view.findViewById(R.id.shopperInsightsSessionIdInput) + shopperInsightsSessionIdNullSwitch = view.findViewById(R.id.shopperInsightsSessionIdNullSwitch) + emailInput.editText?.setText("PR1_merchantname@personal.example.com") nationalNumberInput.editText?.setText("4082321001") + shopperInsightsSessionIdInput.editText?.setText("shopperSessionId") countryCodeInput.editText?.setText("1") } diff --git a/Demo/src/main/res/layout/fragment_shopping_insights.xml b/Demo/src/main/res/layout/fragment_shopping_insights.xml index 2560fc92d9..6c9e60f2a4 100644 --- a/Demo/src/main/res/layout/fragment_shopping_insights.xml +++ b/Demo/src/main/res/layout/fragment_shopping_insights.xml @@ -79,6 +79,23 @@ android:hint="@string/insights_text_input_national_number" /> + + + + + + app:layout_constraintTop_toBottomOf="@+id/shopperInsightsSessionIdInput" />