Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The following Workflow will enable an account on payment.

If you are unfamiliar with Workflows in EngageIP see: EngageIP Workflow Engine Overview

Configuration

This script checks the users balance when a payment is made, if the balance is equal to or less than zero, the customer will be enabled.

Workflow Event
Name – “Payment”
Event Code – Payment.Create

Action Script
Name – “Enable customer on payment”

Payment pay = Payment.GetByID(Convert.ToInt32(context["PaymentID"]));
User user = User.GetByID(pay.GetUser().ID);
ViewUserBalanceFuture vubf = ViewUserBalanceFuture.SearchByUserID(user.ID)[0];

if (vubf.Balance <= 0)
{
    user.UserStatusTypeID = user.GetActingOwner().SearchUserStatusTypeByName("Enabled")[0].ID;
    user.Update();
}
return true;

  • No labels