getPromotionByCode method
Future<void>
getPromotionByCode(
- String code, {
- required void onSuccess(),
- required void onError(
- SyneriseError error
This function returns a promotion object by its code.
Args: code (String): The parameter "code" is a string that represents the code of a promotion.
Implementation
Future<void> getPromotionByCode(String code,
{required void Function(Promotion) onSuccess,
required void Function(SyneriseError error) onError}) async {
SyneriseResult<Promotion> result = await _methods.getPromotionByCode(code);
result.onSuccess((result) {
onSuccess(result);
}).onError((error) {
onError(error);
});
}