-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCardDebitSample.cs
43 lines (38 loc) · 1.48 KB
/
CardDebitSample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using Bunq.Sdk.Context;
using Bunq.Sdk.Model.Generated.Endpoint;
using Bunq.Sdk.Model.Generated.Object;
using Bunq.Sdk.Samples.Utils;
namespace Bunq.Sdk.Samples
{
public class CardDebitSample : ISample
{
private const string NameYourCompany = "USER_COMPANY_NAME"; // Put your user name here
private const string PinCode = "0461";
private const string PointerTypeEmail = "EMAIL";
private const string EmailYourCompany = "[email protected]"; // Put your user email here
private const string PointerNameTest = "test pointer";
private const int UserItemId = 0; // Put your user ID here
public void Run()
{
var apiContext = ApiContext.Restore();
var requestMap = new Dictionary<string, object>
{
{CardDebit.FIELD_NAME_ON_CARD, NameYourCompany},
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()},
{CardDebit.FIELD_PIN_CODE, PinCode},
{
CardDebit.FIELD_ALIAS,
new Pointer(PointerTypeEmail, EmailYourCompany) {Name = PointerNameTest}
},
};
Console.WriteLine(CardDebit.Create(apiContext, requestMap, UserItemId));
}
private static string GenerateRandomSecondLine()
{
var random = new Random();
return random.Next(0, (int) Math.Pow(10, 21) - 1).ToString();
}
}
}