activatePromotionByCode method

Future<void> activatePromotionByCode(
  1. String code, {
  2. required void onSuccess(),
  3. required void onError(
    1. 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);
  });
}