getAllPromotions method

Future<void> getAllPromotions({
  1. required void onSuccess(
    1. PromotionResponse
    ),
  2. required void onError(
    1. SyneriseError error
    ),
})

This method retrieves all available promotions that are defined for a customer.

Implementation

Future<void> getAllPromotions(
    {required void Function(PromotionResponse) onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<PromotionResponse> result =
      await _methods.getAllPromotions();

  result.onSuccess((result) {
    onSuccess(result);
  }).onError((error) {
    onError(error);
  });
}