Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@
<string name="error_title_onrampTransactionAvsValidationFailed">Billing Address Invalid</string>
<string name="error_description_onrampTransactionAvsValidationFailed">Please check that your billing address is correct and try again</string>

<string name="error_title_onrampInvalidBillingName">Billing Name Invalid</string>
<string name="error_description_onrampInvalidBillingName">Please check that the name on your card matches your billing name and try again</string>

<string name="error_title_onrampTransactionFailed">Something Went Wrong</string>
<string name="error_description_onrampTransactionFailed">The Coinbase team has been notified and is investigating the issue. Your funds will arrive once resolved. We appreciate your patience</string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,83 +62,119 @@ fun CoinbaseOnRampHandler(

private fun showOnRampFailure(resources: Resources, error: CoinbaseOnRampWebError) {
when (error) {
is CoinbaseOnRampWebError.Unknown,
is CoinbaseOnRampWebError.MissingTransactionUuid -> {
// --- Grouped errors ---

is CoinbaseOnRampWebError.UnknownFailure -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampUnknownFailure),
message = resources.getString(R.string.error_description_onrampUnknownFailure),
)
}

is CoinbaseOnRampWebError.CardDeclined -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampCardSoftDeclined),
message = resources.getString(R.string.error_description_onrampCardSoftDeclined),
)
}

is CoinbaseOnRampWebError.BillingAddressInvalid -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampTransactionAvsValidationFailed),
message = resources.getString(R.string.error_description_onrampTransactionAvsValidationFailed),
)
}

is CoinbaseOnRampWebError.InternalFailure -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampInternal),
message = resources.getString(R.string.error_description_onrampInternal),
)
}

is CoinbaseOnRampWebError.TransactionFailed -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionFailed),
message = resources.getString(R.string.error_description_onrampTransactionFailed),
)
}

// --- Single-variant errors ---

is CoinbaseOnRampWebError.GuestCardNotDebit -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampInvalidCard),
message = resources.getString(R.string.error_description_onrampInvalidCard),
)
}

is CoinbaseOnRampWebError.GuestRegionMismatch -> {
is CoinbaseOnRampWebError.GuestCardRiskDeclined -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampRegionMismatch),
message = resources.getString(R.string.error_description_onrampRegionMismatch),
title = resources.getString(R.string.error_title_onrampCardRiskDeclined),
message = resources.getString(R.string.error_description_onrampCardRiskDeclined),
)
}

is CoinbaseOnRampWebError.GuestPermissionDenied -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampCardPermissionDenied),
message = resources.getString(R.string.error_description_onrampCardPermissionDenied),
)
}

is CoinbaseOnRampWebError.AssetNotTradableInRegion -> {
is CoinbaseOnRampWebError.RegionNotSupported -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampRegionMismatch),
message = resources.getString(R.string.error_description_onrampRegionMismatch),
)
}

is CoinbaseOnRampWebError.GuestGooglePayError -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionFailed),
message = resources.getString(R.string.error_description_onrampTransactionFailed),
is CoinbaseOnRampWebError.GuestWeeklyTransactionLimitReached -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampTransactionLimit),
message = resources.getString(R.string.error_description_onrampTransactionLimit),
)
}

is CoinbaseOnRampWebError.GuestGooglePayNotReady -> {
is CoinbaseOnRampWebError.GuestTransactionMaxLimitReached -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampGooglePayNotReady),
message = resources.getString(R.string.error_description_onrampGooglePayNotReady),
title = resources.getString(R.string.error_title_onrampTransactionCount),
message = resources.getString(R.string.error_description_onrampTransactionCount),
)
}

is CoinbaseOnRampWebError.GuestTransactionBuyFailed -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionBuyFailed),
message = resources.getString(R.string.error_description_onrampTransactionBuyFailed),
is CoinbaseOnRampWebError.GuestGooglePayNotReady -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampGooglePayNotReady),
message = resources.getString(R.string.error_description_onrampGooglePayNotReady),
)
}

is CoinbaseOnRampWebError.GuestTransactionSendFailed -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionSendFailed),
message = resources.getString(R.string.error_description_onrampTransactionSendFailed),
is CoinbaseOnRampWebError.GuestGooglePayNotSupported -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampGooglePayNotSupported),
message = resources.getString(R.string.error_description_onrampGooglePayNotSupported),
)
}

is CoinbaseOnRampWebError.GuestTransactionAvsValidationFailed -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionAvsValidationFailed),
message = resources.getString(R.string.error_description_onrampTransactionAvsValidationFailed),
is CoinbaseOnRampWebError.GuestCardInsufficientBalance -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampCardInsufficientBalance),
message = resources.getString(R.string.error_description_onrampCardInsufficientBalance),
)
}

is CoinbaseOnRampWebError.GuestTransactionTransactionFailed -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampTransactionFailed),
message = resources.getString(R.string.error_description_onrampTransactionFailed),
is CoinbaseOnRampWebError.GuestCardPrepaidDeclined -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampCardPrepaidDeclined),
message = resources.getString(R.string.error_description_onrampCardPrepaidDeclined),
)
}

is CoinbaseOnRampWebError.Internal,
is CoinbaseOnRampWebError.GooglePayButtonNotFound,
is CoinbaseOnRampWebError.WebViewTimeout -> {
BottomBarManager.showError(
title = resources.getString(R.string.error_title_onrampInternal),
message = resources.getString(R.string.error_description_onrampInternal),
is CoinbaseOnRampWebError.InvalidBillingName -> {
BottomBarManager.showAlert(
title = resources.getString(R.string.error_title_onrampInvalidBillingName),
message = resources.getString(R.string.error_description_onrampInvalidBillingName),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private fun WebView.configureForCoinbaseOnRamp(
"gmsVersion" to gmsVersion
},
)
onPaymentFailure(CoinbaseOnRampWebError.WebViewTimeout())
onPaymentFailure(CoinbaseOnRampWebError.InternalFailure.WebViewTimeout())
}
}

Expand Down Expand Up @@ -221,7 +221,7 @@ private fun WebView.configureForCoinbaseOnRamp(
error: WebResourceError?
) {
if (request?.isForMainFrame == true) {
wrappedOnPaymentFailure(CoinbaseOnRampWebError.GuestGooglePayError())
wrappedOnPaymentFailure(CoinbaseOnRampWebError.TransactionFailed.GooglePayError())
}
}
}
Expand Down
Loading
Loading