checker method
dynamic
checker({})
Implementation
checker({
required bool testMode,
required String apiKey,
String? customer,
required String customerId,
required void Function(Map<String, dynamic>) onError,
required void Function(String customerID, String customerRefrensID) onDone,
required void Function(CreateCustomerModel data) newCustomer,
}) async {
if (customer != null) await ThawaniCustomer.add(customerID: customer);
SharedPreferences share = await SharedPreferences.getInstance();
String? savedCustomerId = share.getString('customerId');
if (savedCustomerId != null) {
onDone(savedCustomerId, customerId);
} else {
create(
testMode: testMode,
apiKey: apiKey,
customerId: customerId,
onError: onError,
onDone: (data) {
newCustomer(data);
onDone(data.data!.id!, data.data!.customerClientId!);
});
}
}