public static PaymentType ConvertToDto(this MarginPaymentType paymentType) { switch (paymentType) { case MarginPaymentType.Swift: return(PaymentType.Swift); case MarginPaymentType.Transfer: return(PaymentType.Transfer); } throw new ArgumentOutOfRangeException(nameof(paymentType), paymentType, string.Empty); }
public async Task <bool> WithdrawFromAccount(string clientId, string accountId, double amount, MarginPaymentType paymentType) { var request = new AccountDepositWithdrawRequest { AccountId = accountId, ClientId = clientId, Amount = amount, PaymentType = paymentType.ConvertToDto() }; var result = await Api.ApiBackofficeMarginTradingAccountsWithdrawPostWithHttpMessagesAsync(_settings.ApiKey, request); return(result.Body == true); }