-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakePayment.cs
43 lines (35 loc) · 1.45 KB
/
MakePayment.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 Bunq.Sdk.Model.Generated.Endpoint;
using Bunq.Sdk.Model.Generated.Object;
using Tinker.Utils;
using TinkerSrc.Lib;
namespace TinkerSrc
{
public class MakePayment : ITinker
{
public void Run(string[] args)
{
var environmentType = ShareLib.DetermineEnvironmentType(args);
ShareLib.PrintHeader();
var bunq = new BunqLib(environmentType);
var amount = ShareLib.GetAmountFromArgsOrStdIn(args);
var recipient = ShareLib.GetRecipientFromArgsOrStdIn(args);
var description = ShareLib.GetDescriptionFromArgsOrStdIn(args);
Console.Out.WriteLine();
Console.Out.WriteLine($" | Sending: € {amount}");
Console.Out.WriteLine($" | To: {recipient}");
Console.Out.WriteLine($" | Description: {description}");
Console.Out.WriteLine();
Console.Out.WriteLine(" ...");
Console.Out.WriteLine();
Payment.Create(new Amount(amount, "EUR"), new Pointer("EMAIL", recipient), description);
Console.Out.WriteLine();
Console.Out.WriteLine(" | Payment sent");
Console.Out.WriteLine();
Console.Out.WriteLine(" | Check your changed overview");
Console.Out.WriteLine();
Console.Out.WriteLine();
bunq.UpdateContext();
}
}
}