From 2b3840392973bc9961b4f9558e26e00922e0edbf Mon Sep 17 00:00:00 2001 From: Shegun Montcho Date: Thu, 11 Apr 2024 13:08:07 +0100 Subject: [PATCH] [Issues Fix] - #38 Exposed credentials --- CHANGELOG.md | 5 +++++ README.md | 5 +++-- example/lib/main.dart | 9 +++++---- lib/utils/config.dart | 5 +++-- pubspec.yaml | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4763c15..bbe9a5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.3.0-dev.2 + +- Remove public_api_key +- Update callback + ## 1.3.0-dev.1 - Update sdk loader ui diff --git a/README.md b/README.md index 2157903..95b1111 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ import './successScreen.dart'; void main() => runApp(App()); -void successCallback(response, context) { +void callback(response, context) { switch ( response['status'] ) { case PAYMENT_CANCELLED: @@ -102,6 +102,7 @@ void successCallback(response, context) { break; default: + debugPrint(UNKNOWN_EVENT); break; } } @@ -116,7 +117,7 @@ final kkiapay = KKiaPay( data: 'Fake data',// sandbox: true,// apikey: public_api_key,// - callback: successCallback,// + callback: callback,// theme: defaultTheme, // Ex : "#222F5A", partnerId: 'AxXxXXxId',// paymentMethods: ["momo","card"]// diff --git a/example/lib/main.dart b/example/lib/main.dart index e0e3bde..87e33b4 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -4,7 +4,7 @@ import 'success_screen.dart'; void main() => runApp(const App()); -void successCallback(response, context) { +void callback(response, context) { switch (response['status']) { case PAYMENT_CANCELLED: debugPrint(PAYMENT_CANCELLED); @@ -51,21 +51,22 @@ void successCallback(response, context) { break; default: + debugPrint(UNKNOWN_EVENT); break; } } const kkiapay = KKiaPay( amount: 1000, - countries: ["BJ","CI"], + countries: ["BJ","CI","SN","TG"], phone: "22961000000", name: "John Doe", email: "email@mail.com", reason: 'transaction reason', data: 'Fake data', sandbox: false, - apikey: "LprYUAyMpfAjq4z2yTHPiY0b6XktIQ", - callback: successCallback, + apikey: public_api_key, + callback: callback, theme: defaultTheme, partnerId: 'AxXxXXxId', paymentMethods: ["momo", "card"]); diff --git a/lib/utils/config.dart b/lib/utils/config.dart index 3134dc9..b8a5239 100644 --- a/lib/utils/config.dart +++ b/lib/utils/config.dart @@ -1,8 +1,8 @@ import 'dart:convert'; import 'dart:ui'; -/// developer account api key -const public_api_key = '4afb8d60021211edadbe55ee0346ea8f'; +/// developer account public api key +const public_api_key = '###'; /// widget default theme const defaultTheme = "#4E6BFC"; @@ -53,6 +53,7 @@ const PAYMENT_SUCCESS = 'PAYMENT_SUCCESS'; const PAYMENT_CANCELLED = 'PAYMENT_CANCELLED'; const PAYMENT_END = 'PAYMENT_END'; const RETRY_PAYMENT = 'RETRY_PAYMENT'; +const UNKNOWN_EVENT = 'UNKNOWN_EVENT'; const WAVE_LINK = 'WAVE_LINK'; diff --git a/pubspec.yaml b/pubspec.yaml index bc2fa58..addd2e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: kkiapay_flutter_sdk description: KKiaPay allows businesses to safely receive payments by mobile money, credit card and bank account. -version: 1.3.0-dev.1 +version: 1.3.0-dev.2 homepage: "https://kkiapay.me/" environment: