diff --git a/CHANGELOG.md b/CHANGELOG.md index ba97ae212..71200607c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # PayPal Android SDK Release Notes +## unreleased +* CorePayments + * Fix issue that causes analytics version number to always be `null` + ## 2.0.0-beta1 (2024-11-20) * Breaking Changes * PayPalNativePayments diff --git a/CardPayments/build.gradle b/CardPayments/build.gradle index 44f0ec904..a651909ef 100644 --- a/CardPayments/build.gradle +++ b/CardPayments/build.gradle @@ -22,7 +22,7 @@ android { buildTypes { release { - version = android.defaultConfig.versionName // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } diff --git a/CorePayments/build.gradle b/CorePayments/build.gradle index fde4a6eef..42adae532 100644 --- a/CorePayments/build.gradle +++ b/CorePayments/build.gradle @@ -18,12 +18,12 @@ android { targetSdkVersion modules.androidTargetVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" - buildConfigField "String", "CLIENT_SDK_VERSION", "\"$versionName\"" + buildConfigField "String", "CLIENT_SDK_VERSION", "\"${requireExists(rootProject.version)}\"" } buildTypes { release { - version = android.defaultConfig.versionName // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } @@ -82,6 +82,11 @@ dependencies { androidTestImplementation libs.kotlinx.coroutinesTest } +static def requireExists(String value) { + if (value) return value + throw new Exception("Error in CorePayments/build.gradle: Variable does not exist.") +} + project.ext.name = "core-payments" project.ext.version = rootProject.version project.ext.pom_name = "PayPal SDK - CorePayments" diff --git a/CorePayments/src/main/java/com/paypal/android/corepayments/TrackingEventsAPI.kt b/CorePayments/src/main/java/com/paypal/android/corepayments/TrackingEventsAPI.kt index 20b75972b..96574f975 100644 --- a/CorePayments/src/main/java/com/paypal/android/corepayments/TrackingEventsAPI.kt +++ b/CorePayments/src/main/java/com/paypal/android/corepayments/TrackingEventsAPI.kt @@ -8,8 +8,10 @@ internal class TrackingEventsAPI constructor( private val coreConfig: CoreConfig, private val restClient: RestClient ) { + + // api-m.sandbox.paypal.com does not currently send FPTI events to BigQuery/Looker constructor(coreConfig: CoreConfig) : - this(coreConfig, RestClient(coreConfig)) + this(coreConfig, RestClient(toLiveConfig(coreConfig))) suspend fun sendEvent(event: AnalyticsEventData, deviceData: DeviceData): HttpResponse { val apiRequest = createAPIRequestForEvent(event, deviceData) @@ -79,5 +81,8 @@ internal class TrackingEventsAPI constructor( const val KEY_EVENT_PARAMETERS = "event_params" const val KEY_EVENTS = "events" + + fun toLiveConfig(config: CoreConfig): CoreConfig = + CoreConfig(config.clientId, environment = Environment.LIVE) } } diff --git a/FraudProtection/build.gradle b/FraudProtection/build.gradle index a8d81736e..4ef200214 100644 --- a/FraudProtection/build.gradle +++ b/FraudProtection/build.gradle @@ -21,7 +21,7 @@ android { buildTypes { release { - version = android.defaultConfig.versionName // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } diff --git a/PayPalWebPayments/build.gradle b/PayPalWebPayments/build.gradle index af2a21276..480405893 100644 --- a/PayPalWebPayments/build.gradle +++ b/PayPalWebPayments/build.gradle @@ -21,7 +21,7 @@ android { buildTypes { release { - version = android.defaultConfig.versionName // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } diff --git a/PaymentButtons/build.gradle b/PaymentButtons/build.gradle index 022833774..fb7328257 100644 --- a/PaymentButtons/build.gradle +++ b/PaymentButtons/build.gradle @@ -21,7 +21,7 @@ android { buildTypes { release { - version = android.defaultConfig.versionName // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } diff --git a/Venmo/build.gradle b/Venmo/build.gradle index 09707c0bf..ba27f2bdc 100644 --- a/Venmo/build.gradle +++ b/Venmo/build.gradle @@ -21,8 +21,7 @@ android { buildTypes { release { - version = android.defaultConfig.versionName - // had to add this to get the version in the build + version = rootProject.version minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' }