bunq / sdk_csharp

C# SDK for bunq API
MIT License
35 stars 22 forks source link

Payment example doesn't work without a name for the pointer #54

Closed WouterJanson closed 6 years ago

WouterJanson commented 6 years ago

Steps to reproduce:

Follow payment sample

What should happen:

should work just fine

What happens:

Bunq.Sdk.Exception.BadRequestException has been thrown
Pointer has no name set

Extra info:

Adding a name parameter to the constructor would fix it, sample should be rewritten to accommodate the new parameter. see #53

OGKevin commented 6 years ago

Hey @WouterJanson, The sample, as you can see by these constants

        private const string COUNTERPARTY_POINTER_TYPE = "EMAIL";
        private const string COUNTERPARTY_EMAIL = "bravo@bunq.com";

is written to make a payment to an email address :thumbsup:.

Based on the error message you're getting I'm guessing that you tried to make a payment to an IBAN. In this case you must set the pointer name by doing the following:

            var pointer = new Pointer("The IBAN nr", "IBAN");
            pointer.Name = "The name of the receiver";

Because this is not an actual bug, ill close this issue. Feel free to comment nevertheless :rainbow:.