---
title: "3rd-Party Payment Flow"
slug: "3rd-party-payment-flow"
updated: 2025-06-24T10:12:42Z
published: 2025-06-24T10:12:42Z
canonical: "ignite.ticketmaster.com/3rd-party-payment-flow"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://ignite.ticketmaster.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 3rd-Party Payment Flow

## Redirecting Back to Your App from a 3rd-Party Payment Flow

When a user chooses a 3rd-party payment method, they will be temporarily taken out of your app to complete the transaction. To handle the return (whether the payment is successful or not), you need to set up a custom scheme-based redirect.

Below are the steps to implement this mechanism:

---

****Android****

#### **1. Define a Custom URL Scheme**

Create a custom scheme (e.g., `xyzpayments`) that the 3rd-party payment provider will use to redirect the user back to your app after the transaction.

#### **2. Register the Scheme in the Manifest**

The scheme should be declared as part of an `intent-filter` in the activity responsible for hosting the EDP (Event Detail Page) — for example `PurchaseActivity`.

Update your `AndroidManifest.xml` like so:

```xml
<activity
    android:name="com.ticketmaster.mobile.android.library.retail.purchase.PurchaseActivity"
    android:exported="true"
    android:launchMode="singleTop"
    android:screenOrientation="portrait">

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="xyzpayments" />
    </intent-filter>

</activity>
```

This enables your app to respond to URLs like `xyzpayments://...` and bring the user back to the appropriate activity.

---

#### **3. Pass the Scheme to the Payment SDK**

When initializing the payment SDK (e.g., `TMPurchase`), provide the custom scheme so that it knows where to redirect after the payment flow:

```kotlin
val tmPurchase = TMPurchase(
    apiKey = apiKey,
    purchaseUrlScheme = "xyzpayments"
)
```

#### **4. Handle the Redirect with** `TMPurchaseDeeplinkDelegate`

To properly receive and handle the redirect intent, pass a `TMPurchaseDeeplinkDelegate` to your `TMPurchaseFragmentFactory`. This allows the SDK to listen for and handle deep links when `onNewIntent()` is triggered.

```kotlin
private val tmPurchaseDeeplinkDelegate = TMPurchaseDeeplinkDelegate()

val factory = TMPurchaseFragmentFactory(
    tmPurchaseNavigationListener = PurchaseNavigationListener {
        // Example: close the activity when purchase flow completes
        finish()
    },
    tmPurchaseDeeplinkDelegate = tmPurchaseDeeplinkDelegate // 👈 required to handle deep links
)
```

Then, inside your `PurchaseActivity`, forward the new intent like this:

```kotlin
override fun onNewIntent(intent: Intent?) {
    super.onNewIntent(intent)
    tmPurchaseDeeplinkDelegate.handleIntent(intent)
}
```
