Skip to main content

Redirect Payment to DANA App


The DANA Widget Non-Binding flow enables users to pay with DANA within merchant apps. Currently, users complete payments on the DANA Web View page. Starting 31 July 2026, we will gradually roll out an update that redirects users to the DANA App as the primary payment experience.

FlowBefore 31 July 2026After 31 July 2026
User installs DANA AppRedirect to DANA Web View pageRedirect to DANA App
User does not install DANA AppRedirect to DANA Web View pageRedirect to DANA Web View page

Before 31 July 2026

The general flow of DANA Widget Non Binding before 31 July 2026 is as follows:

Before
  1. User creates an order and selects DANA as the payment method within the merchant App.
  2. Merchant makes a Direct Debit Payment API call to DANA to initiate the payment transaction.
  3. DANA returns a response containing ‘webRedirectUrl’.
  4. Merchants opens the ‘webRedirectUrl‘.
  5. Launches the DANA Web Payment page for payment.
  6. User completes the payment process and the transaction is finalized.

After 31 July 2026

The general flow of DANA Widget Non Binding after 31 July 2026 is as follows:

After
  1. User creates an order and selects DANA as the payment method within the merchant App.
  2. Merchant makes a Direct Debit Payment API call to DANA to initiate the payment transaction, setting additionalInfo.supportDeepLinkCheckoutUrl as a Mandatory and value always to true
  3. DANA returns a response containing ‘webRedirectUrl’.
  4. Merchants opens the “webRedirectUrl”.
  5. Check if the DANA App is installed.
  6. Detect the app and automatically launches the DANA App for payment.
  7. Detect the app is missing and automatically falls back to the DANA Web Payment page. The web page will open either in container in merchant’s side or open in the browser page.
  8. User completes the payment process and the transaction is finalized.

Demo Video

Redirect Payment to DANA App


What should merchant do?

  • In the Direct Debit Payment API , set supportDeepLinkCheckoutUrl as a mandatory field and always set its value to true.
  • Able to open DANA redirect URLs (universal links) to enable handoff to the DANA App.
  • Prefer opening the redirect URL via the OS/native browser. If the merchant uses an in-app WebView with domain allowlisting, the merchant must whitelist or allowlist the following domains: https://link.dana.id, https://m.dana.id, https://danaid.link, and danaid://.

Common Issue #1: Webview in Merchant Front-end

Some users may not be redirected to the DANA App when the payment page is opened inside the merchant’s in-app WebView. This usually happens because the WebView tries to load the redirect URL as a normal web page instead of passing it to open the target app.

Successful Sample

Failed Sample

The WebView intercepts every navigation event. If the URL matches DANA deeplink/universal link patterns (or is a non-HTTP URI), the app opens it using an Android Intent and returns “handled” so the WebView does not load it.

What should merchant do?

  • Implement both shouldOverrideUrlLoading variants (new and deprecated) so interception works across Android versions.
  • Detect DANA redirect URLs using these identifiers:
    • danaid://
    • https://link.dana.id
    • https://m.dana.id
    • https://danaid.link
  • Treat URLs that are not standard HTTP(S) as external-app URIs (your sample uses !url.contains("http")).
  • Open external-app URIs via Intent(Intent.ACTION_VIEW, uri) and return true to block WebView navigation.
  • Allow normal URLs to load in WebView by returning false.
  • If your WebView uses domain allowlisting, ensure these domains remain allowlisted: link.dana.id, m.dana.id, danaid.link.
WebView Implementation
@TargetApi(Build.VERSION_CODES.N)
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
return handleWebviewCustomUri(request.url)
}

@Suppress("OverridingDeprecatedMember", "DEPRECATION")
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
return handleWebviewCustomUri(Uri.parse(url))
}

private fun handleWebviewCustomUri(uri: Uri): Boolean {
val url = uri.toString()

val deepLinkIdentifiers = listOf(
"danaid://",
"https://link.dana.id",
"https://m.dana.id",
"https://danaid.link"
)

// Check if the URL contains any of the known deep link identifiers, or if it lacks "http"
val isExternalAppUri = deepLinkIdentifiers.any { url.contains(it) } || !url.contains("http")

return if (isExternalAppUri) {
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
true
} else {
false
}
}

Common Issue #2: Web-based Redirect Implementation

Deeplinks work best when triggered by user clicks on <a href="..."> elements across domains. JavaScript-based redirection, such as window.open or window.location.href, can also be used. However, if any issues occur, it is recommended to use redirection triggered directly by a user action, such as clicking a link.

ask AIAI Assistant
Need help with our documentation?
Start from our frequently asked questions or feel free to ask anything else.

AI generated responses may contain mistakes.