Example #1
0
            public Models.CardAddress Create(string cardId, Models.AddressNetwork network)
            {
                var address = new Models.NewCardAddress()
                {
                    network = network.ToString()
                };

                return(_client.RequestPost <Models.NewCardAddress, Models.CardAddress>($"/v0/me/cards/{cardId}/addresses", address));
            }
Example #2
0
            public Models.Card Create(string label, string currency)
            {
                var card = new Models.NewCard()
                {
                    label = label, currency = currency
                };

                return(_client.RequestPost <Models.NewCard, Models.Card>("/v0/me/cards", card));
            }
Example #3
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="cardId"></param>
            /// <param name="currency"></param>
            /// <param name="amount"></param>
            /// <param name="destination">The destination of the transaction, which can be in the form of a bitcoin address, an email address, an account id, an application id or an Uphold username.</param>
            /// <returns></returns>
            public Models.Transaction Create(string originCardId, string currency, decimal amount, string destination, string message)
            {
                // create
                var trn = new Models.NewTransaction()
                {
                    denomination = new Models.NewTransactionDenomination()
                    {
                        amount = amount, currency = currency
                    }, destination = destination
                };
                var newTrn = _client.RequestPost <Models.NewTransaction, Models.Transaction>($"/v0/me/cards/{originCardId}/transactions", trn);

                //commit
                var cmt = new Models.TransactionCommit()
                {
                    Message = message
                };

                return(_client.RequestPost <Models.TransactionCommit, Models.Transaction>($"/v0/me/cards/{originCardId}/transactions/{newTrn.Id}/commit", cmt));
            }