Satispay for Flutter
Usage
Initialize the package
import 'package:flutter_satispay/flutter_satispay.dart';
void main() {
// You must run this only once
Satispay.init(environment: SatispayEnvironment.production);
runApp(MyApp());
}
Check if Satispay is available
import 'package:flutter_satispay/flutter_satispay.dart';
final bool isAvailable = await Satispay.instance.isAvailable();
Redirect to the Satispay app
import 'package:flutter_satispay/flutter_satispay.dart';
await Satispay.instance.loadPayment(
token: 'payment_id',
callbackUrl: 'callback_url',
);
import 'package:flutter_satispay/flutter_satispay.dart';
SatispayButton(
onPressed: () async {
// TODO: Check if Satispay is available
// TODO: Create payment on your server
// TODO: Redirect the user to the Satispay app
},
);