b24_payment_sdk 1.1.3 b24_payment_sdk: ^1.1.3 copied to clipboard
Package payment SDK for merchant.
import 'package:b24_payment_sdk/b24_payment_sdk.dart';
import 'package:flutter/material.dart';
// import 'package:b24_payment_sdk/b24_payment_sdk.dart';
void main() {
runApp(const MyApp());
}
class Item {
final double amount;
final String currency;
final String imagePath;
Item({
required this.amount,
required this.currency,
required this.imagePath,
});
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'កម្មវិធី'),
);
}
}
// ignore: must_be_immutable
class MyHomePage extends StatefulWidget {
const MyHomePage({
super.key,
required this.title,
});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool isToggled = false;
String? tranId =
//"8F79D121E49E"
"1D587C961032";
String? refererKey = "12453X";
String? language = '';
bool? darkMode = false;
bool? isProduction = false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Column(
children: <Widget>[
Expanded(
child: Center(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
TextField(
onChanged: (value) {
setState(() {
tranId = value;
});
},
decoration: const InputDecoration(labelText: 'tranId'),
),
TextField(
onChanged: (value) {
setState(() {
refererKey = value;
});
},
decoration:
const InputDecoration(labelText: 'X-Referrer-Key'),
),
TextField(
onChanged: (value) {
setState(() {
language = value;
});
},
decoration:
const InputDecoration(labelText: 'language'),
),
CheckboxListTile(
title: const Text('Is productionS'),
value: isProduction,
onChanged: (value) {
setState(() {
isProduction = value;
});
},
),
CheckboxListTile(
title: const Text('dark Mode'),
value: darkMode,
onChanged: (value) {
setState(() {
darkMode = value;
});
},
),
const SizedBox(height: 10.0),
ElevatedButton(
onPressed: () {
B24PaymentSdk.intSdk(
controller: context,
tranId: '$tranId',
refererKey: "$refererKey",
language: "$language",
//darkMode: null,
darkMode: darkMode,
isProduction: isProduction,
isPopup: true);
},
child: const Text('Checkout'),
),
const SizedBox(height: 80),
],
),
),
),
),
),
],
),
);
}
}