assignVoucherCode method
Future<void>
assignVoucherCode(
- String poolUuid, {
- required void onSuccess(),
- required void onError(
- SyneriseError error
This method assigns a voucher from a pool identified by UUID to the customer. Every request returns a different code until the pool is empty.
Args:
poolUuid (String): The parameter poolUuid is a unique identifier for a voucher pool. It is
used to assign a voucher code from the specified pool to a user.
Implementation
Future<void> assignVoucherCode(String poolUuid,
{required void Function(AssignVoucherResponse) onSuccess,
required void Function(SyneriseError error) onError}) async {
SyneriseResult<AssignVoucherResponse> result =
await _methods.assignVoucherCode(poolUuid);
result.onSuccess((result) {
onSuccess(result);
}).onError((error) {
onError(error);
});
}