-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constants following PascalCase convention #71
base: develop
Are you sure you want to change the base?
Changes from 8 commits
d50b8b8
46214e0
8fd7136
3fbb0e1
9b16490
17d446c
f405de3
4a90c80
c43eb8c
d53ea29
d453229
2da16bf
d66b682
2279dc8
5f8e799
c153018
1aa819d
9962a6d
f10e0d3
50a81c3
4240c77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ local.properties | |
x64/ | ||
build/ | ||
[Oo]bj/ | ||
/.vs | ||
|
||
# MSTest test Results | ||
[Tt]est[Rr]esult*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,28 +9,28 @@ namespace Bunq.Sdk.Samples | |
{ | ||
public class CardDebitSample : ISample | ||
{ | ||
private const string NAME_YOUR_COMPANY = "USER_COMPANY_NAME"; // Put your user name here | ||
private const string PIN_CODE = "0461"; | ||
private const string POINTER_TYPE_EMAIL = "EMAIL"; | ||
private const string EMAIL_YOUR_COMPANY = "[email protected]"; // Put your user email here | ||
private const string POINTER_NAME_TEST = "test pointer"; | ||
private const int USER_ITEM_ID = 0; // Put your user ID here | ||
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, NAME_YOUR_COMPANY}, | ||
{CardDebit.FIELD_NAME_ON_CARD, NameYourCompany}, | ||
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()}, | ||
{CardDebit.FIELD_PIN_CODE, PIN_CODE}, | ||
{CardDebit.FIELD_PIN_CODE, PinCode}, | ||
{ | ||
CardDebit.FIELD_ALIAS, | ||
new Pointer(POINTER_TYPE_EMAIL, EMAIL_YOUR_COMPANY) {Name = POINTER_NAME_TEST} | ||
new Pointer(PointerTypeEmail, EmailYourCompany) {Name = PointerNameTest} | ||
}, | ||
}; | ||
|
||
Console.WriteLine(CardDebit.Create(apiContext, requestMap, USER_ITEM_ID)); | ||
Console.WriteLine(CardDebit.Create(apiContext, requestMap, UserItemId)); | ||
} | ||
|
||
private static string GenerateRandomSecondLine() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ namespace Bunq.Sdk.Samples | |
{ | ||
public class PaymentBatchSample : ISample | ||
{ | ||
private const string PAYMENT_AMOUNT = "0.01"; | ||
private const string PAYMENT_CURRENCY = "EUR"; | ||
private const string COUNTERPARTY_POINTER_TYPE = "EMAIL"; | ||
private const string COUNTERPARTY_EMAIL = "[email protected]"; | ||
private const string PAYMENT_DESCRIPTION = "This is a generated payment batch!"; | ||
private const int USER_ITEM_ID = 0; // Put your user ID here | ||
private const int MONETARY_ACCOUNT_ITEM_ID = 0; // Put your monetary account ID here | ||
private const string PaymentAmount = "0.01"; | ||
private const string PaymentCurrency = "EUR"; | ||
private const string CounterpartyPointerType = "EMAIL"; | ||
private const string CounterpartyEmail = "[email protected]"; | ||
private const string PaymentDescription = "This is a generated payment batch!"; | ||
private const int UserItemId = 0; // Put your user ID here | ||
private const int MonetaryAccountItemId = 0; // Put your monetary account ID here | ||
|
||
public void Run() | ||
{ | ||
|
@@ -28,21 +28,21 @@ public void Run() | |
{ | ||
new Dictionary<string, object> | ||
{ | ||
{Payment.FIELD_AMOUNT, new Amount(PAYMENT_AMOUNT, PAYMENT_CURRENCY)}, | ||
{Payment.FIELD_AMOUNT, new Amount(PaymentAmount, PaymentCurrency)}, | ||
{ | ||
Payment.FIELD_COUNTERPARTY_ALIAS, | ||
new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL) | ||
new Pointer(CounterpartyPointerType, CounterpartyEmail) | ||
}, | ||
{Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION} | ||
{Payment.FIELD_DESCRIPTION, PaymentDescription} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
var paymentBatchId = PaymentBatch.Create(apiContext, paymentBatchMap, USER_ITEM_ID, | ||
MONETARY_ACCOUNT_ITEM_ID).Value; | ||
var paymentBatchId = PaymentBatch.Create(apiContext, paymentBatchMap, UserItemId, | ||
MonetaryAccountItemId).Value; | ||
|
||
Console.WriteLine(PaymentBatch.Get(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, paymentBatchId)); | ||
Console.WriteLine(PaymentBatch.Get(apiContext, UserItemId, MonetaryAccountItemId, paymentBatchId)); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,44 +12,44 @@ public class PaymentListSample : ISample | |
/// <summary> | ||
/// Message constants. | ||
/// </summary> | ||
private const string MESSAGE_LATEST_PAGE_IDS = "Latest page IDs: "; | ||
private const string MESSAGE_SECOND_LATEST_PAGE_IDS = "Second latest page IDs: "; | ||
private const string MESSAGE_NO_PRIOR_PAYMENTS_FOUND = "No prior payments found!"; | ||
private const string MessageLatestPageIds = "Latest page IDs: "; | ||
private const string MessageSecondLatestPageIds = "Second latest page IDs: "; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plural -> MessageSecondLatestPageAllPaymentId |
||
private const string MessageNoPriorPaymentsFound = "No prior payments found!"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plural -> |
||
|
||
/// <summary> | ||
/// Size of each page of payment listing. | ||
/// </summary> | ||
private const int PAGE_SIZE = 3; | ||
private const int PageSize = 3; | ||
|
||
/// <summary> | ||
/// Constants to be changed to run the example. | ||
/// </summary> | ||
private const int USER_ITEM_ID = 0; // Put your user ID here | ||
private const int MONETARY_ACCOUNT_ITEM_ID = 0; // Put your monetary account ID here | ||
private const int UserItemId = 0; // Put your user ID here | ||
private const int MonetaryAccountItemId = 0; // Put your monetary account ID here | ||
|
||
public void Run() | ||
{ | ||
var apiContext = ApiContext.Restore(); | ||
var paginationCountOnly = new Pagination | ||
{ | ||
Count = PAGE_SIZE, | ||
Count = PageSize, | ||
}; | ||
Console.WriteLine(MESSAGE_LATEST_PAGE_IDS); | ||
var paymentResponse = Payment.List(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, | ||
Console.WriteLine(MessageLatestPageIds); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MessageLatestPageAllPaymentId |
||
var paymentResponse = Payment.List(apiContext, UserItemId, MonetaryAccountItemId, | ||
paginationCountOnly.UrlParamsCountOnly); | ||
PrintPayments(paymentResponse.Value); | ||
var pagination = paymentResponse.Pagination; | ||
|
||
if (pagination.HasPreviousPage()) | ||
{ | ||
Console.WriteLine(MESSAGE_SECOND_LATEST_PAGE_IDS); | ||
var previousPaymentResponse = Payment.List(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, | ||
Console.WriteLine(MessageSecondLatestPageIds); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename (check for other occurrences too of renamed constants) |
||
var previousPaymentResponse = Payment.List(apiContext, UserItemId, MonetaryAccountItemId, | ||
pagination.UrlParamsPreviousPage); | ||
PrintPayments(previousPaymentResponse.Value); | ||
} | ||
else | ||
{ | ||
Console.WriteLine(MESSAGE_NO_PRIOR_PAYMENTS_FOUND); | ||
Console.WriteLine(MessageNoPriorPaymentsFound); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,30 +9,30 @@ namespace Bunq.Sdk.Samples | |
{ | ||
public class PaymentSample : ISample | ||
{ | ||
private const int USER_ITEM_ID = 0; // Put your user ID here | ||
private const int MONETARY_ACCOUNT_ITEM_ID = 0; // Put your monetary account ID here | ||
private const string PAYMENT_AMOUNT = "0.01"; | ||
private const string PAYMENT_CURRENCY = "EUR"; | ||
private const string COUNTERPARTY_POINTER_TYPE = "EMAIL"; | ||
private const string COUNTERPARTY_EMAIL = "[email protected]"; | ||
private const string PAYMENT_DESCRIPTION = "This is a generated payment!"; | ||
private const int UserItemId = 0; // Put your user ID here | ||
private const int MonetaryAccountItemId = 0; // Put your monetary account ID here | ||
private const string PaymentAmount = "0.01"; | ||
private const string PaymentCurrency = "EUR"; | ||
private const string CounterpartyPointerType = "EMAIL"; | ||
private const string CounterpartyEmail = "[email protected]"; | ||
private const string PaymentDescription = "This is a generated payment!"; | ||
|
||
public void Run() | ||
{ | ||
var apiContext = ApiContext.Restore(); | ||
var paymentMap = new Dictionary<string, object> | ||
{ | ||
{Payment.FIELD_AMOUNT, new Amount(PAYMENT_AMOUNT, PAYMENT_CURRENCY)}, | ||
{Payment.FIELD_AMOUNT, new Amount(PaymentAmount, PaymentCurrency)}, | ||
{ | ||
Payment.FIELD_COUNTERPARTY_ALIAS, | ||
new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL) | ||
new Pointer(CounterpartyPointerType, CounterpartyEmail) | ||
}, | ||
{Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION} | ||
{Payment.FIELD_DESCRIPTION, PaymentDescription} | ||
}; | ||
|
||
var paymentId = Payment.Create(apiContext, paymentMap, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID).Value; | ||
var paymentId = Payment.Create(apiContext, paymentMap, UserItemId, MonetaryAccountItemId).Value; | ||
|
||
Console.WriteLine(Payment.Get(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, paymentId)); | ||
Console.WriteLine(Payment.Get(apiContext, UserItemId, MonetaryAccountItemId, paymentId)); | ||
|
||
// Save the API context to account for all the changes that might have occurred to it | ||
// during the sample execution | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,31 +9,31 @@ namespace Bunq.Sdk.Samples | |
{ | ||
public class RequestSample : ISample | ||
{ | ||
private const string REQUEST_AMOUNT = "12.30"; | ||
private const string REQUEST_CURRENCY = "EUR"; | ||
private const string COUNTERPARTY_POINTER_TYPE = "EMAIL"; | ||
private const string COUNTERPARTY_EMAIL = "[email protected]"; | ||
private const string REQUEST_DESCRIPTION = "This is a generated request!"; | ||
private const int USER_ITEM_ID = 0; // Put your user ID here | ||
private const int MONETARY_ACCOUNT_ITEM_ID = 0; // Put your monetary account ID here | ||
private const string STATUS_REVOKED = "REVOKED"; | ||
private const string RequestAmount = "12.30"; | ||
private const string RequestCurrency = "EUR"; | ||
private const string CounterpartyPointerType = "EMAIL"; | ||
private const string CounterpartyEmail = "[email protected]"; | ||
private const string RequestDescription = "This is a generated request!"; | ||
private const int UserItemId = 0; // Put your user ID here | ||
private const int MonetaryAccountItemId = 0; // Put your monetary account ID here | ||
private const string StatusRevoked = "REVOKED"; | ||
|
||
public void Run() | ||
{ | ||
var apiContext = ApiContext.Restore(); | ||
var requestMap = new Dictionary<string, object> | ||
{ | ||
{RequestInquiry.FIELD_AMOUNT_INQUIRED, new Amount(REQUEST_AMOUNT, REQUEST_CURRENCY)}, | ||
{RequestInquiry.FIELD_COUNTERPARTY_ALIAS, new Pointer(COUNTERPARTY_POINTER_TYPE, COUNTERPARTY_EMAIL)}, | ||
{RequestInquiry.FIELD_DESCRIPTION, REQUEST_DESCRIPTION}, | ||
{RequestInquiry.FIELD_AMOUNT_INQUIRED, new Amount(RequestAmount, RequestCurrency)}, | ||
{RequestInquiry.FIELD_COUNTERPARTY_ALIAS, new Pointer(CounterpartyPointerType, CounterpartyEmail)}, | ||
{RequestInquiry.FIELD_DESCRIPTION, RequestDescription}, | ||
{RequestInquiry.FIELD_ALLOW_BUNQME, true} | ||
}; | ||
var requestId = RequestInquiry.Create(apiContext, requestMap, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID).Value; | ||
Console.WriteLine(RequestInquiry.Get(apiContext, USER_ITEM_ID, MONETARY_ACCOUNT_ITEM_ID, requestId)); | ||
var requestId = RequestInquiry.Create(apiContext, requestMap, UserItemId, MonetaryAccountItemId).Value; | ||
Console.WriteLine(RequestInquiry.Get(apiContext, UserItemId, MonetaryAccountItemId, requestId)); | ||
|
||
var requestUpdateMap = new Dictionary<string, object> {{RequestInquiry.FIELD_STATUS, STATUS_REVOKED}}; | ||
var requestUpdated = RequestInquiry.Update(apiContext, requestUpdateMap, USER_ITEM_ID, | ||
MONETARY_ACCOUNT_ITEM_ID, requestId); | ||
var requestUpdateMap = new Dictionary<string, object> {{RequestInquiry.FIELD_STATUS, StatusRevoked}}; | ||
var requestUpdated = RequestInquiry.Update(apiContext, requestUpdateMap, UserItemId, | ||
MonetaryAccountItemId, requestId); | ||
Console.WriteLine(requestUpdated); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plural -> MessageLatestPageAllPaymentId