Client libraries
Flutter / Dart
Plans for a ShadhinPay Flutter SDK, and the recommended mobile integration pattern today.
Official SDK — Planned
A ShadhinPay Flutter SDK with a drop-in checkout widget is on the roadmap.
Never put your API key in a mobile app
API keys are secrets, and anything shipped in an app can be extracted. Your app must not call ShadhinPay directly with a live key. Instead, your app calls your own backend, and your backend calls ShadhinPay.
Recommended pattern today
Your backend creates the payment with ShadhinPay (see Payments) and returns the
paymentUrl to the app.Your app opens
paymentUrl in an in-app browser / WebView so the customer can pay with bKash or Nagad.Your backend receives and verifies the webhook, updates the order, and your app reflects the result (via your own API or a push).
import 'package:http/http.dart' as http;
import 'dart:convert';
// Calls YOUR backend, which holds the ShadhinPay key and creates the payment.
Future<String> startCheckout(String orderId) async {
final res = await http.post(
Uri.parse('https://your-backend.example.com/checkout'),
headers: {'Content-Type': 'application/json'},
body: jsonEncode({'orderId': orderId}),
);
final data = jsonDecode(res.body) as Map<String, dynamic>;
return data['paymentUrl'] as String; // open this in a WebView / url_launcher
}When the official SDK lands, it will wrap this flow in a single checkout call while keeping your secret key safely on your server.