activatePromotionByCode method
Future<void>
activatePromotionByCode(
- String code, {
- required void onSuccess(),
- required void onError(
- SyneriseError error
This function activates a promotion by a given code.
Args: code (String): The parameter "code" is a String that represents the promotion code that needs to be activated.
Implementation
Future<void> activatePromotionByCode(String code,
{required void Function() onSuccess,
required void Function(SyneriseError error) onError}) async {
SyneriseResult<void> result = await _methods.activatePromotionByCode(code);
result.onSuccess((result) {
onSuccess();
}).onError((error) {
onError(error);
});
}