Skip to content

Commit

Permalink
Merge branch 'main' into rba-metadata-feature
Browse files Browse the repository at this point in the history
* main:
  Remove old analytic events lingering from v4 (#1093)
  Convert PayPal module classes to Kotlin (#1091)
  Convert PayPal Classes to Kotlin (#1089)
  Paypal Module Kotlin Conversion (#1088)
  Parcelize Nonce Classes (#1087)
  Update 3DS and GraphQL Endpoint Sent to FPTI (v5) (#1080)
  Remove appLinkEnabled property (#1085)
  Remove publishing javadocs from maven publish (#1082)

# Conflicts:
#	CHANGELOG.md
#	PayPal/src/main/java/com/braintreepayments/api/paypal/PayPalRequest.java
#	PayPal/src/main/java/com/braintreepayments/api/paypal/PayPalVaultRequest.java
#	PayPal/src/test/java/com/braintreepayments/api/paypal/PayPalVaultRequestUnitTest.java
  • Loading branch information
tdchow committed Aug 5, 2024
2 parents d24b10b + c3d4859 commit c3571a3
Show file tree
Hide file tree
Showing 81 changed files with 2,563 additions and 3,941 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,14 @@ class BraintreeClient @VisibleForTesting internal constructor(
) { response, httpError ->
response?.let {
try {
json?.optString(GraphQLConstants.Keys.OPERATION_NAME)
json?.optString(GraphQLConstants.Keys.QUERY)
?.let { query ->
val queryDiscardHolder = query.replace(Regex("^[^\\(]*"), "")
val finalQuery = query.replace(queryDiscardHolder, "")
val params = AnalyticsEventParams(
startTime = it.timing.startTime,
endTime = it.timing.endTime,
endpoint = query
endpoint = finalQuery
)
sendAnalyticsEvent(
CoreAnalytics.apiRequestLatency,
Expand Down Expand Up @@ -355,7 +357,11 @@ class BraintreeClient @VisibleForTesting internal constructor(
}

private fun sendAnalyticsTimingEvent(endpoint: String, timing: HttpResponseTiming) {
val cleanedPath = endpoint.replace(Regex("/merchants/([A-Za-z0-9]+)/client_api"), "")
var cleanedPath = endpoint.replace(Regex("/merchants/([A-Za-z0-9]+)/client_api"), "")
cleanedPath = cleanedPath.replace(
Regex("payment_methods/.*/three_d_secure"), "payment_methods/three_d_secure"
)

sendAnalyticsEvent(
CoreAnalytics.apiRequestLatency,
AnalyticsEventParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ object GraphQLConstants {
const val LEGACY_CODE = "legacyCode"
const val URL = "url"
const val FEATURES = "features"
const val OPERATION_NAME = "operationName"
}

object ErrorTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.braintreepayments.api.core

import android.os.Parcel
import android.os.Parcelable
import androidx.annotation.RestrictTo
import androidx.annotation.VisibleForTesting

/**
* Base class representing a method of payment for a customer. [PaymentMethodNonce] represents the
Expand All @@ -14,40 +12,9 @@ import androidx.annotation.VisibleForTesting
* actions.
* @property isDefault `true` if this payment method is the default for the current customer, `false` otherwise
*/
open class PaymentMethodNonce : Parcelable {

companion object {
@JvmField
val CREATOR = object : Parcelable.Creator<PaymentMethodNonce> {
override fun createFromParcel(`in`: Parcel) = PaymentMethodNonce(`in`)
override fun newArray(size: Int) = arrayOfNulls<PaymentMethodNonce>(size)
}
}

open val string: String
abstract class PaymentMethodNonce
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
constructor(
open val string: String,
open val isDefault: Boolean

/**
* @suppress
*/
@VisibleForTesting
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
constructor(nonce: String, isDefault: Boolean) {
string = nonce
this.isDefault = isDefault
}

override fun describeContents(): Int {
return 0
}

override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(string)
dest.writeByte(if (isDefault) 1.toByte() else 0.toByte())
}

protected constructor(inParcel: Parcel) {
string = inParcel.readString() ?: ""
isDefault = inParcel.readByte() > 0
}
}
) : Parcelable

This file was deleted.

17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# Braintree Android SDK Release Notes

## unreleased

* BraintreeCore
* Update `endpoint` syntax sent to FPTI for 3D Secure and Venmo flows
* PayPal
* Add `PayPalRecurringBillingDetails` and `PayPalRecurringBillingPlanType` opt-in request objects. Including these details will provide transparency to users on their billing schedule, dates, and amounts, as well as launch a modernized checkout UI.
* Add `PayPalRecurringBillingDetails` and `PayPalRecurringBillingPlanType` opt-in request objects. Including these details will provide transparency to users on their billing schedule, dates, and amounts, as well as launch a modernized checkout UI.
* Breaking Changes
* PayPal
* Remove `appLinkEnabled` from `PayPalRequest` as Android app links are now required
* Update `PayPalCreditFinancing.hasPayerAcceptance()` to `getHasPayerAcceptance()` (Java)
* Change `PayPalPaymentIntent` to an enum
* Change `PayPalLandingPageType` to an enum
* Change `PayPalPaymentUserAction` to an enum
* Update `PayPalRequest.hasUserLocationConsent()` to `getHasUserLocationConsent()` (Java)
* Change `PayPalLineItem.desc()` to `setDescription()`
* Change `PayPalLineItemKind` to an enum
* Rename `PayPalLineItemKind.KIND_CREDIT` to `CREDIT`
* Rename `PayPalLineItemKind.KIND_DEBIT` to `DEBIT`

## 5.0.0-beta1 (2024-07-23)

Expand Down
1 change: 1 addition & 0 deletions Card/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'kotlin-parcelize'
}

android {
Expand Down
Loading

0 comments on commit c3571a3

Please sign in to comment.