public async Task can_depositfunds() { SetupServerSingleResponse(Deposit1); var create = new DepositFunds { Amount = 10.0m, Currency = "USD", PaymentMethod = "B28EB04F-BD70-4308-90A1-96065283A001" }; var r = await client.Deposits.DepositFundsAsync("fff", create); var truth = new Response <Deposit> { Data = Deposit1Model }; truth.Should().BeEquivalentTo(r); server.ShouldHaveRequestBody( @"{""amount"":10.0,""currency"":""USD"",""payment_method"":""B28EB04F-BD70-4308-90A1-96065283A001"",""commit"":false}"); server.ShouldHaveExactCall($"https://api.coinbase.com/v2/accounts/fff/deposits") .WithVerb(HttpMethod.Post); }
public void EnactCommand(DepositFunds command) { RecordEvent(new FundsDeposited { Amount = command.Amount }); }
public void EnactCommand(DepositFunds command) { RecordEvent(new FundsDeposited { Amount = command.Amount }); }
public void EnactCommand(DepositFunds command) { var created = new FundsDeposited { Amount = command.Amount }; RecordEvent(created); }
public DepositForm(int id) { InitializeComponent(); DepositFunds deposit = new DepositFunds(); txtId.Text = id.ToString(); deposit = deposit.GetAccountBalance(id); txtAccountNumber.Text = deposit.AccountNumber.ToString(); txtBal.Text = deposit.Balance.ToString(); }
public void InitiateDeposit() { string[] fields = { amount.text }; Validate.CheckEmptyFields(fields, (message) => { menuManager.StartCoroutine(menuManager.showPopUpT(message, "error")); }, () => { SetLoading(deposit_loading, deposit_form, deposit_back_button, true); float_amount = float.Parse(amount.text); DepositFunds.DepositUserFunds( new DepositPayload(float_amount), (response) => { DepositResponse depositResponse = (DepositResponse)response; Application.OpenURL(depositResponse.url); SetLoading(deposit_loading, deposit_form, deposit_back_button, false); ResetDeposit(); DepositPanel.SetActive(false); LogoPanel.SetActive(true); }, (statusCode, error) => { SetLoading(deposit_loading, deposit_form, deposit_back_button, false); if (statusCode == StatusCodes.CODE_VALIDATION_ERROR) { ValidationError validationError = (ValidationError)error; menuManager.StartCoroutine(menuManager.showPopUpT(validationError.errors.First().Value[0], "error")); } else { GenericError genericError = (GenericError)error; menuManager.StartCoroutine(menuManager.showPopUpT(genericError.message, "error")); } } ); }); }
/// <inheritdoc /> Task <Response <Deposit> > IDepositsEndpoint.DepositFundsAsync(string accountId, DepositFunds depositFunds, CancellationToken cancellationToken) { return(this.AccountsEndpoint .AppendPathSegments(accountId, deposits) .WithClient(this) .PostJsonAsync(depositFunds, cancellationToken) .ReceiveJson <Response <Deposit> >()); }