Skip to content

Commit

Permalink
JvmOverloads and Internal Docs Cleanup (#1151)
Browse files Browse the repository at this point in the history
* Add internal doc strings

* Add JvmOverloads

* Fix integration test
sarahkoop authored Sep 11, 2024
1 parent 89c4b76 commit 286e80c
Showing 13 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import org.json.JSONObject
* @property rewardsUnit - The rewards unit associated with the rewards balance
*/
@Parcelize
data class AmericanExpressRewardsBalance(
data class AmericanExpressRewardsBalance @JvmOverloads constructor(
var errorCode: String? = null,
var errorMessage: String? = null,
var conversionRate: String? = null,
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ class AnalyticsClientTest {
val event = AnalyticsEvent("event.started")
val sut = AnalyticsClient(context)
val workSpecId =
sut.sendEvent(configuration, event, "sessionId", IntegrationType.CUSTOM, authorization)
sut.sendEvent(configuration, event, IntegrationType.CUSTOM, authorization)

val workInfoBeforeDelay =
WorkManager.getInstance(context).getWorkInfoById(workSpecId).get()
2 changes: 1 addition & 1 deletion Card/src/main/java/com/braintreepayments/api/card/Card.kt
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ import org.json.JSONObject
* Defaults to custom and does not need to ever be set.
*/
@Parcelize
data class Card(
data class Card @JvmOverloads constructor(
var merchantAccountId: String? = null,
var isAuthenticationInsightRequested: Boolean = false,
var shouldValidate: Boolean = false,
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import org.json.JSONObject
* Used to tokenize credit or debit cards using a [Card]. For more information see the
* [documentation](https://developer.paypal.com/braintree/docs/guides/credit-cards/overview)
*/
class CardClient @VisibleForTesting internal constructor(
class CardClient @VisibleForTesting @JvmOverloads internal constructor(
private val braintreeClient: BraintreeClient,
private val apiClient: ApiClient = ApiClient(braintreeClient),
private val analyticsParamRepository: AnalyticsParamRepository = AnalyticsParamRepository.instance
Original file line number Diff line number Diff line change
@@ -5,8 +5,11 @@ package com.braintreepayments.api.googlepay
*/
sealed class GooglePayPaymentAuthRequest {

// TODO: make requestParams internal when GooglePayClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [GooglePayLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
class ReadyToLaunch(val requestParams: GooglePayPaymentAuthRequestParams) : GooglePayPaymentAuthRequest()

Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ import java.util.Locale
*/
@Suppress("TooManyFunctions")
@Parcelize
class GooglePayRequest(
class GooglePayRequest @JvmOverloads constructor(
// NEXT_MAJOR_VERSION: allow merchants to set transaction info params individually and build
// JSON object under the hood
var transactionInfo: TransactionInfo? = null,
Original file line number Diff line number Diff line change
@@ -5,8 +5,11 @@ package com.braintreepayments.api.localpayment
*/
sealed class LocalPaymentAuthRequest {

// TODO: make requestParams internal when LocalPaymentClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [LocalPaymentLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
class ReadyToLaunch(val requestParams: LocalPaymentAuthRequestParams) :
LocalPaymentAuthRequest()
Original file line number Diff line number Diff line change
@@ -5,11 +5,12 @@ package com.braintreepayments.api.paypal
*/
sealed class PayPalPaymentAuthRequest {

// TODO: make requestParams internal when PayPalClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [PayPalLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
// TODO: requestParams should be internal but can't be until PayPalClientUnitTest is converted
// to Kotlin (same for all modules with ReadyToLaunch request)
class ReadyToLaunch(val requestParams: PayPalPaymentAuthRequestParams) :
PayPalPaymentAuthRequest()

Original file line number Diff line number Diff line change
@@ -5,8 +5,11 @@ package com.braintreepayments.api.sepadirectdebit
*/
sealed class SEPADirectDebitPaymentAuthRequest {

// TODO: make requestParams internal when SEPADirectDebitClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [SEPADirectDebitLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
class ReadyToLaunch(val requestParams: SEPADirectDebitPaymentAuthRequestParams) :
SEPADirectDebitPaymentAuthRequest()
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import com.braintreepayments.api.core.PostalAddress
* @see [Documentation](https://developer.paypal.com/reference/locale-codes/)
* for possible values. Locale code should be supplied as a BCP-47 formatted locale code.
*/
data class SEPADirectDebitRequest internal constructor(
data class SEPADirectDebitRequest @JvmOverloads constructor(
var accountHolderName: String? = null,
var iban: String? = null,
var customerId: String? = null,
Original file line number Diff line number Diff line change
@@ -5,8 +5,11 @@ package com.braintreepayments.api.threedsecure
*/
sealed class ThreeDSecurePaymentAuthRequest {

// TODO: make requestParams internal when ThreeDSecureClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [ThreeDSecureLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
class ReadyToLaunch(val requestParams: ThreeDSecureParams) :
ThreeDSecurePaymentAuthRequest()
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ import org.json.JSONObject
* which trigger on certain values.
*/
@Parcelize
data class ThreeDSecureRequest(
data class ThreeDSecureRequest @JvmOverloads constructor(
var nonce: String? = null,
var amount: String? = null,
var mobilePhoneNumber: String? = null,
Original file line number Diff line number Diff line change
@@ -5,8 +5,11 @@ package com.braintreepayments.api.venmo
*/
sealed class VenmoPaymentAuthRequest {

// TODO: make requestParams internal when VenmoClientUnitTest is converted to Kotlin
/**
* The request was successfully created and is ready to be launched by [VenmoLauncher]
* @param requestParams this parameter is intended for internal use only. It is not covered by
* semantic versioning and may be changed or removed at any time.
*/
class ReadyToLaunch(val requestParams: VenmoPaymentAuthRequestParams) : VenmoPaymentAuthRequest()

0 comments on commit 286e80c

Please sign in to comment.