Skip to content

Commit

Permalink
review readme and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Shek863 committed Nov 2, 2023
1 parent fe8e281 commit 11d063c
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.5/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.9.1/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_android-6.1.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_android-3.12.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.7/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.6/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.8/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.20/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-10-23 10:15:16.891876","version":"3.13.7"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.9.2/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_android-3.12.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.0/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.0/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_web-2.2.0/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-11-02 10:31:19.134667","version":"3.13.7"}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.7

- Update all plugin dependencies
- Review example project
- Review readme

## 1.2.6

- Set sandbox as required
Expand Down
155 changes: 86 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ dependencies:
```dart
final kkiapay = KKiaPay(
@required callback: Function(Map<String, dynamic> response, BuildContext context),
@required amount: String,
@required apikey: String,
@required sandbox: bool,
data: String,
phone: String,
name: String,
reason: String,
email: String,
theme: dynamic,
countries: List<String>,
partnerId: String,
paymentMethods: List<String>
@required amount: int, // Ex : 1000
@required apikey: String, // Ex : XXXX_public_api_key_XXX
@required sandbox: bool, // Ex : true
data: String, // Ex : 'Big data'
phone: String, // Ex : "22961000000"
name: String, // Ex : "John Doe"
reason: String, // Ex : "transaction reason"
email: String, // Ex : "[email protected]"
theme: String, // Ex : "#222F5A"
countries: List<String>, // Ex : ["CI"]
partnerId: String, // Ex : 'AxXxXXxId'
paymentMethods: List<String> // Ex : ["momo","card"]
);
```
Expand All @@ -53,91 +53,108 @@ Navigator.push(context, MaterialPageRoute(builder: (context) => kkiapay),
## Example

```dart
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:kkiapay_flutter_sdk/kkiapay/src/widget_builder_view.dart';
import 'package:kkiapay_flutter_sdk/kkiapayWeb/web_widget_builder.dart';
import 'package:kkiapay_flutter_sdk/src/widget_builder_view.dart';
import 'package:kkiapay_flutter_sdk/utils/config.dart';
import './successScreen.dart';
void main() => runApp(App());
void successCallback(response, context) {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SuccessScreen(
amount: response['requestData']['amount'],
transactionId: response['transactionId']
)),
);
switch ( response['status'] ) {
case PAYMENT_CANCELLED: print(PAYMENT_CANCELLED);
break;
case PAYMENT_SUCCESS:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SuccessScreen(
amount: response['requestData']['amount'],
transactionId: response['transactionId'],
),
),
);
break;
case PAYMENT_FAILED: print(PAYMENT_FAILED);
break;
default:
break;
}
}
final kkiapay = KKiaPay(
amount: 100,
countries: ["BJ"],
phone: "22961000000",
name: "John Doe",
email: "[email protected]",
reason: 'transaction reason',
data: 'Fake data',
sandbox: true,
apikey: 'XXXXXXXXXXXXXXXXXXXXXX',
callback: successCallback,
amount: 1000,//
countries: ["BJ"],//
phone: "22961000000",//
name: "John Doe",//
email: "[email protected]",//
reason: 'transaction reason',//
data: 'Fake data',//
sandbox: true,//
apikey: public_api_key,//
callback: successCallback,//
theme: defaultTheme, // Ex : "#222F5A",
partnerId: 'AxXxXXxId',
paymentMethods: ["momo","card"]
partnerId: 'AxXxXXxId',//
paymentMethods: ["momo","card"]//
);
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Kkiapay Sample'),
centerTitle: true,
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
backgroundColor: nColorPrimary,
title: Text('Kkiapay Sample'),
centerTitle: true,
),
body: KkiapaySample(),
),
body: KkiapaySample(),
));
);
}
}
class KkiapaySample extends StatelessWidget {
const KkiapaySample({
Key key,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child:
ButtonTheme(
minWidth: 500.0,
height: 100.0,
child: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Color(0xff222F5A)),
foregroundColor: MaterialStateProperty.all(Colors.white),
),
child: Text(
'Pay Now',
style: TextStyle(color: Colors.white),
),
onPressed: () {
if (kIsWeb) {
KKiaPayWeb.pay(kkiapay, (response) {
successCallback(response, context);
});
} else {
Navigator.push(context,
MaterialPageRoute(builder: (context) => kkiapay),
);
}
},
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ButtonTheme(
minWidth: 500.0,
height: 100.0,
child: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Color(0xff222F5A)),
foregroundColor: MaterialStateProperty.all(Colors.white),
),
child: const Text(
'Pay Now',
style: TextStyle(color: Colors.white),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => kkiapay),
);
},
),
)
],
)
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.5/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.9.1/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_android-6.1.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_android-3.12.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.7/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.6/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.8/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.20/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-10-23 10:15:16.934505","version":"3.13.7"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.9.2/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_android-6.2.0/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/webview_flutter_android-3.12.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.0/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.0/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/shegunmontcho/.pub-cache/hosted/pub.dev/url_launcher_web-2.2.0/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-11-02 10:31:19.275852","version":"3.13.7"}
32 changes: 16 additions & 16 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ void successCallback(response, context) {
}
}

final kkiapay = KKiaPay(
amount: 1000,//
countries: ["BJ"],//
phone: "22961000000",//
name: "John Doe",//
email: "[email protected]",//
reason: 'transaction reason',//
data: 'Fake data',//
sandbox: true,//
apikey: public_api_key,//
callback: successCallback,//
theme: defaultTheme, // Ex : "#222F5A",
partnerId: 'AxXxXXxId',//
paymentMethods: ["momo","card"]//
const kkiapay = KKiaPay(
amount: 1000,
countries: ["BJ"],
phone: "22961000000",
name: "John Doe",
email: "[email protected]",
reason: 'transaction reason',
data: 'Fake data',
sandbox: true,
apikey: public_api_key,
callback: successCallback,
theme: defaultTheme,
partnerId: 'AxXxXXxId',
paymentMethods: ["momo","card"]
);

class App extends StatelessWidget {
Expand All @@ -57,10 +57,10 @@ class App extends StatelessWidget {
home: Scaffold(
appBar: AppBar(
backgroundColor: nColorPrimary,
title: Text('Kkiapay Sample'),
title: const Text('Kkiapay Sample'),
centerTitle: true,
),
body: KkiapaySample(),
body: const KkiapaySample(),
),
);
}
Expand Down
38 changes: 19 additions & 19 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.6"
version: "1.2.7"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -288,66 +288,66 @@ packages:
dependency: transitive
description:
name: url_launcher
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev"
source: hosted
version: "6.1.14"
version: "6.2.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
version: "6.2.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f"
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
url: "https://pub.dev"
source: hosted
version: "6.1.5"
version: "6.2.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e
sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
version: "3.1.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.0.7"
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618"
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
version: "2.2.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.0.20"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069"
sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
version: "3.1.0"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -392,10 +392,10 @@ packages:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "30b9af6bdd457b44c08748b9190d23208b5165357cc2eb57914fee1366c42974"
sha256: b4b42295b3aa91ed22ba6d3dd7de56efbb8f3ab3d6e41d8b1615d13537c7801d
url: "https://pub.dev"
source: hosted
version: "3.9.1"
version: "3.9.2"
sdks:
dart: ">=3.1.3 <4.0.0"
flutter: ">=3.13.0"
Loading

0 comments on commit 11d063c

Please sign in to comment.