Esempio n. 1
0
    /// <summary>
    /// FROM AP
    /// </summary>
    /// <param name="request"></param>
    public static void RejectRequest(PayoutRequest request)
    {
        Member User = new Member(request.Username);

        try
        {
            PaymentProcessor processor = PaymentAccountDetails.GetFromStringType(request.PaymentProcessor);
            PaymentProportionsManager.UndoMemberPaidOut(request.Amount, processor, User);
        }
        catch
        {
            //processor = custom processor
        }

        request.IsPaid           = true;
        request.PaymentProcessor = "REJECTED";
        request.Save();

        User.MoneyCashout -= request.Amount;
        User.AddToMainBalance(request.Amount, "Payout rejected");
        User.Save();

        History.AddCashoutRejection(User.Name, request.Amount.ToString());
    }