telr_mobile_payment_sdk 3.0.1 copy "telr_mobile_payment_sdk: ^3.0.1" to clipboard
telr_mobile_payment_sdk: ^3.0.1 copied to clipboard

Flutter plugin that wraps Telr native iOS/Android SDKs via platform channels to present the payment UI.

Telr Mobile Payment SDK


Telr Flutter Payments SDK #

Accept Telr payments in your Flutter app with a single call. The SDK presents the Telr checkout, handles the flow, and returns a clear success/failure result.

Requirements #

  • Flutter: ≥ 3.19 (Dart ≥ 3)
  • iOS: ≥ 15.1
  • Android: minSdk ≥ 21, targetSdk ≥ 34
  • Backend: HTTPS tokenURL and orderURL

Install #

Add to pubspec.yaml and fetch:

dependencies:
  telr_mobile_payment_sdk: ^X.Y.Z
flutter pub get

iOS setup #

  1. Set minimum iOS in ios/Podfile and enable static frameworks:
platform :ios, '15.1'

target 'Runner' do
  use_frameworks! :linkage => :static
end
  1. Install pods:
cd ios && pod install
  • If CocoaPods cannot find TelrSDK, ensure Telr’s private/spec source is configured in your Podfile, run pod repo update, then re-install.

Android setup #

  1. Ensure repositories in android/settings.gradle:
dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
  }
}
  1. Set SDK versions in android/app/build.gradle:
android {
  compileSdkVersion 34

  defaultConfig {
    minSdkVersion 21
    targetSdkVersion 34
  }
}
  1. Optional: initialize on app load (configure language/logging)

Call the SDK initializer early (e.g., in main() before runApp()), especially if you want to set the preferred language or enable debug logging.

import 'package:flutter/widgets.dart';
import 'package:telr_mobile_payment_sdk/telr_mobile_payment_sdk.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await TelrSdk.init(
    preferredLanguageCode: 'en',
    debugLoggingEnabled: true,
    samsungPayServiceId: null,
    samsungPayMerchantId: null,
  );
  runApp(const MyApp());
}

Use #

Minimal example:

import 'package:flutter/material.dart';
import 'package:telr_mobile_payment_sdk/telr_mobile_payment_sdk.dart';

class PayButton extends StatelessWidget {
  const PayButton({super.key});

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: () async {
        try {
          final res = await TelrSdk.presentPayment(
            'https://merchant.example.com/token',
            'https://merchant.example.com/order',
          );
          final msg = res.success
              ? 'Payment successful'
              : 'Payment failed: ${res.message}';
          if (context.mounted) {
            ScaffoldMessenger.of(context)
                .showSnackBar(SnackBar(content: Text(msg)));
          }
        } catch (e) {
          if (context.mounted) {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(content: Text('Unexpected error: $e')),
            );
          }
        }
      },
      child: const Text('Pay with Telr'),
    );
  }
}

If you need to set the language or other options, initialize once on app load as shown in the Android setup section, then call presentPayment when needed.

API #

  • init({ preferredLanguageCode, debugLoggingEnabled, samsungPayServiceId, samsungPayMerchantId })Future<PaymentResponse>
    • Initializes the SDK and applies configuration. Call once on app startup.
  • presentPayment(tokenURL, orderURL)Future<PaymentResponse>
    • Presents the Telr payment UI full-screen and resolves when completed.

Types:

class PaymentResponse {
  final bool success;
  final String message;
  const PaymentResponse({required this.success, required this.message});
}

Merchant checklist #

  • Expose HTTPS tokenURL and orderURL from your backend.
  • Ensure device/emulator can reach both URLs.
  • Handle the returned result to confirm/cancel the order server-side.

Troubleshooting #

  • Android: E002 "Unable to register for Activity Result": Ensure initialization happens during app load. Call TelrSdk.init(...) in main() before runApp().
  • iOS: CocoaPods cannot find TelrSDK: Configure Telr spec source, run pod repo update, then pod install.
  • iOS: Build fails due to iOS version: Set platform :ios, '15.1' or newer.
  • Android: minSdk/targetSdk mismatch: Use min 21 / target 34 / compile 34.
  • Network/HTTP errors: Verify backend endpoints and connectivity.

Security #

  • Always use HTTPS; validate server responses.
  • Never embed secrets in the app or log cardholder data.

License #

MIT

2
likes
135
points
265
downloads

Publisher

verified publishertelr.com

Weekly Downloads

Flutter plugin that wraps Telr native iOS/Android SDKs via platform channels to present the payment UI.

Repository (GitHub)
View/report issues

Topics

#payments #telr #checkout #sdk

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on telr_mobile_payment_sdk

Packages that implement telr_mobile_payment_sdk