From 710317889fd32f439f33d5b6968daa227ef2fc7e Mon Sep 17 00:00:00 2001 From: Vince Ramces Oliveros Date: Sat, 10 Jul 2021 11:29:00 +0800 Subject: [PATCH] add assert --- lib/src/utils/http.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/utils/http.dart b/lib/src/utils/http.dart index c810739..79f885d 100644 --- a/lib/src/utils/http.dart +++ b/lib/src/utils/http.dart @@ -21,7 +21,11 @@ import '../src.dart'; class PayMongoSDK { /// {@macro paymonggosdk} PayMongoSDK(this.secret, {this.http, String apiUrl = 'api.paymongo.com'}) - : _apiUrl = apiUrl; + : _apiUrl = apiUrl, + assert( + secret.isNotEmpty, + "API KEY must be provided, go to PayMongo Dashboard", + ); /// key generated from paymongo dashboard /// you can use `--dart-define` command to store your private key.