Exemplo n.º 1
0
        static async Task <BunqApi> SetupSession(HttpClient httpClient, string apiKey, string privateKeyPem, string serverPublicKey, string installationToken)
        {
            var bunqApi = new BunqApi(httpClient, apiKey, privateKeyPem, serverPublicKey, installationToken);
            await bunqApi.SetupSession();

            return(bunqApi);
        }
Exemplo n.º 2
0
        static async Task ListPayments(BunqApi bunqApi, long monetaryAccountId)
        {
            var payments = await bunqApi.ListPayments(monetaryAccountId);

            foreach (var payment in payments)
            {
                Console.WriteLine($"{payment.id} ");
            }
        }
Exemplo n.º 3
0
        static async Task <MonetaryAccountBank> ListMonetaryAccountBanks(BunqApi bunqApi)
        {
            var accounts = await bunqApi.ListMonetaryAccountBanks();

            foreach (var account in accounts)
            {
                Console.WriteLine($"{account.id} {account.balance.currency} {account.balance.value} {account.status}");
            }
            return(accounts.FirstOrDefault(x => x.status == "ACTIVE"));
        }
Exemplo n.º 4
0
 static async Task SendSomeMoney(BunqApi bunqApi, long monetaryAccountId, string value, string iban, string name)
 {
     var amount = new Amount {
         currency = "EUR", value = value
     };
     var counterparty = new Pointer {
         value = iban, type = "IBAN", name = name
     };
     await bunqApi.Payment(amount, counterparty, "sent you some", monetaryAccountId);
 }
Exemplo n.º 5
0
        static async Task GetSomeMoney(BunqApi bunqApi, long monetaryAccountId)
        {
            var amount = new Amount {
                currency = "EUR", value = "500.00"
            };                                                              // not more than 500
            var counterparty = new Pointer {
                value = "*****@*****.**", type = "EMAIL"
            };
            await bunqApi.RequireInquiry(amount, counterparty, "get me some", monetaryAccountId);

            await Task.Delay(1000); // give server some time to process
        }
Exemplo n.º 6
0
 static async Task SetupDevice(HttpClient httpClient, string apiKey, string privateKeyPem, string serverPublicKey, string installationToken)
 {
     var bunqApi = new BunqApi(httpClient, apiKey, privateKeyPem, serverPublicKey, installationToken);
     await bunqApi.SetupDevice();
 }