public void MakeWithdrawal(Money amount, string address, Member user, WithdrawalSourceBalance withdrawalSource) { decimal amountInCryptocurrency = Decimal.Zero; Money amountInMoney = Money.Zero; if (withdrawalSource == WithdrawalSourceBalance.MainBalance) { amountInCryptocurrency = ConvertFromMoney(amount); amountInMoney = amount; } else //Wallets { amountInCryptocurrency = amount.ToDecimal(); amountInMoney = ConvertToMoney(amountInCryptocurrency); } CryptocurrencyApiFactory.GetWithdrawalApi(this).TryWithDrawCryptocurrencyFromWallet(amountInCryptocurrency, address, Type); BitcoinIPNManager.AddIPNLog(AppSettings.ServerTime, OperationType.Withdrawal, null, user.Id, address, amountInCryptocurrency, amountInMoney, this.WithdrawalApiProcessor, true); if (withdrawalSource == WithdrawalSourceBalance.MainBalance) { PaymentProportionsManager.MemberPaidOut(amountInMoney, CryptocurrencyTypeHelper.ConvertToPaymentProcessor(Type), user); } AddPaymentProof(amount, user); }
public void MarkAsPaidInBatchPayment() { MarkAsPaid(); BitcoinIPNManager.AddIPNLog(AppSettings.ServerTime, OperationType.Withdrawal, null, UserId, Address, CryptocurrencyObject.ConvertFromMoney(Amount), Amount, CryptocurrencyObject.WithdrawalApiProcessor, true); }