zolozkit_for_flutter
The plugin for inject to zoloz sdk
Getting Started
Depend on it
Run this command:
With Flutter:
flutter pub add zolozkit_for_flutter
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
zolozkit_for_flutter: ^0.0.6
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:zolozkit_for_flutter/zolozkit_for_flutter.dart';
Get Meta Info
Use the ZolozkitForFlutter class and its variable metaInfo to get the meta information about the ZOLOZ SDK and the user's device. The meta information is used to initialize a transaction later.
var metaInfo = await ZolozkitForFlutter.metaInfo;
Initialize a transaction
Send a request that contains the meta information to your (merchant) server to initialize a transaction. Then your (merchant) server needs to call the initialize API to obtain the client configuration and return it to your (merchant) application. see: Server-side integration
Start the transaction flow
start the transaction flow by calling the start method with the clientCfg
and bizCfg
, You also need to override the callback functions to handle the transaction result.
await ZolozkitForFlutter.start("clientCfg", {}, (bool result) {
print(result);
});