Utilize helper method when constructing proto charge failure.

Fixes #14871
This commit is contained in:
Alex Hart
2026-07-08 09:26:01 -03:00
parent 4ab4bb458a
commit b55a8dc98e
2 changed files with 119 additions and 9 deletions
@@ -111,15 +111,7 @@ object InAppPaymentsRepository {
.cancellation(
InAppPaymentData.Cancellation(
reason = if (chargeFailure != null) InAppPaymentData.Cancellation.Reason.PAST_DUE else InAppPaymentData.Cancellation.Reason.CANCELED,
chargeFailure = chargeFailure?.let {
InAppPaymentData.ChargeFailure(
code = it.code,
message = it.message,
outcomeType = it.outcomeType,
outcomeNetworkReason = it.outcomeNetworkReason ?: "",
outcomeNetworkStatus = it.outcomeNetworkStatus
)
}
chargeFailure = chargeFailure?.toInAppPaymentDataChargeFailure()
)
)
.build()