Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .nuget/nuget.exe
Binary file not shown.
16 changes: 16 additions & 0 deletions PAYNLSDK/API/Alliance/AddBankAccount/AddBankAccountResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace PAYNLSDK.API.Alliance.AddBankAccount
{
/// <summary>
/// Result class for AddBankAccount call
/// </summary>
public class AddBankAccountResult : ResponseBase
{
/// <summary>
/// The URL to redirect the user to for iDEAL verification
/// </summary>
[JsonProperty("issuerUrl")]
public string IssuerUrl { get; set; }
}
}
75 changes: 75 additions & 0 deletions PAYNLSDK/API/Alliance/AddBankAccount/Request.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using System.Collections.Specialized;
using PAYNLSDK.Exceptions;
using PAYNLSDK.Utilities;

namespace PAYNLSDK.API.Alliance.AddBankAccount
{
/// <summary>
/// Request to add a bank account for a merchant with iDEAL verification
/// </summary>
public class Request : RequestBase
{
/// <inheritdoc />
protected override int Version => 7;
/// <inheritdoc />
protected override string Controller => "Alliance";
/// <inheritdoc />
protected override string Method => "addBankaccount";

/// <summary>
/// The merchant ID
/// </summary>
public string MerchantId { get; set; }

/// <summary>
/// The URL to redirect the user to after the iDEAL verification is completed
/// </summary>
public string ReturnUrl { get; set; }

/// <summary>
/// Optional: the bank ID, if omitted, the user will be asked for the bank
/// </summary>
public string BankId { get; set; }

/// <summary>
/// Optional: the ID of the payment profile (standard iDEAL)
/// </summary>
public string PaymentOptionId { get; set; }

/// <inheritdoc />
public override NameValueCollection GetParameters()
{
if (ParameterValidator.IsEmpty(MerchantId))
{
throw new PayNlException("MerchantId is required");
}
if (ParameterValidator.IsEmpty(ReturnUrl))
{
throw new PayNlException("ReturnUrl is required");
}

var retval = new NameValueCollection
{
{ "merchantId", MerchantId },
{ "returnUrl", ReturnUrl }
};

if (!string.IsNullOrEmpty(BankId))
{
retval.Add("bankId", BankId);
}
if (!string.IsNullOrEmpty(PaymentOptionId))
{
retval.Add("paymentOptionId", PaymentOptionId);
}

return retval;
}

/// <inheritdoc />
protected override void PrepareAndSetResponse()
{
// do nothing
}
}
}
13 changes: 13 additions & 0 deletions PAYNLSDK/API/Alliance/AddClearing/AddClearingResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace PAYNLSDK.API.Alliance.AddClearing
{
/// <summary>
/// Result class for AddClearing call
/// </summary>
public class AddClearingResult : ResponseBase
{
/// <summary>
/// Returns true if clearing was successfully added
/// </summary>
public bool Success => Request?.Result == true;
}
}
65 changes: 65 additions & 0 deletions PAYNLSDK/API/Alliance/AddClearing/Request.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System.Collections.Specialized;
using PAYNLSDK.Exceptions;
using PAYNLSDK.Utilities;

namespace PAYNLSDK.API.Alliance.AddClearing
{
/// <summary>
/// Request to add clearing for a merchant
/// </summary>
public class Request : RequestBase
{
/// <inheritdoc />
protected override int Version => 4;
/// <inheritdoc />
protected override string Controller => "Merchant";
/// <inheritdoc />
protected override string Method => "addClearing";

/// <summary>
/// The amount in cents
/// </summary>
public int Amount { get; set; }

/// <summary>
/// The merchant ID (optional)
/// </summary>
public string MerchantId { get; set; }

/// <summary>
/// The content category ID (optional)
/// </summary>
public string ContentCategoryId { get; set; }

/// <inheritdoc />
public override NameValueCollection GetParameters()
{
if (Amount <= 0)
{
throw new PayNlException("Amount is required and must be greater than 0");
}

var retval = new NameValueCollection
{
{ "amount", Amount.ToString() }
};

if (!string.IsNullOrEmpty(MerchantId))
{
retval.Add("merchantId", MerchantId);
}
if (!string.IsNullOrEmpty(ContentCategoryId))
{
retval.Add("contentCategoryId", ContentCategoryId);
}

return retval;
}

/// <inheritdoc />
protected override void PrepareAndSetResponse()
{
// do nothing
}
}
}
22 changes: 22 additions & 0 deletions PAYNLSDK/API/Alliance/AddDocument/AddDocumentResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;

namespace PAYNLSDK.API.Alliance.AddDocument
{
/// <summary>
/// Result class for AddDocument call
/// </summary>
public class AddDocumentResult : ResponseBase
{
/// <summary>
/// Returns true if document was successfully uploaded
/// </summary>
[JsonProperty("result")]
public bool Result { get; set; }

/// <summary>
/// Document ID if successful
/// </summary>
[JsonProperty("documentId")]
public string DocumentId { get; set; }
}
}
88 changes: 88 additions & 0 deletions PAYNLSDK/API/Alliance/AddDocument/Request.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using PAYNLSDK.Exceptions;
using PAYNLSDK.Utilities;

namespace PAYNLSDK.API.Alliance.AddDocument
{
/// <summary>
/// Request to upload a document
/// </summary>
public class Request : RequestBase
{
/// <inheritdoc />
protected override int Version => 1;
/// <inheritdoc />
protected override string Controller => "Document";
/// <inheritdoc />
protected override string Method => "add";

/// <summary>
/// The document ID
/// </summary>
public string DocumentId { get; set; }

/// <summary>
/// The filename
/// </summary>
public string Filename { get; set; }

/// <summary>
/// Base64 encoded document content(s)
/// </summary>
public List<string> Content { get; set; } = new List<string>();

/// <summary>
/// Add base64 encoded content
/// </summary>
/// <param name="base64Content">Base64 encoded document content</param>
public void AddContent(string base64Content)
{
Content.Add(base64Content);
}

/// <inheritdoc />
public override NameValueCollection GetParameters()
{
if (ParameterValidator.IsEmpty(DocumentId))
{
throw new PayNlException("DocumentId is required");
}
if (ParameterValidator.IsEmpty(Filename))
{
throw new PayNlException("Filename is required");
}
if (Content == null || Content.Count == 0)
{
throw new PayNlException("Content is required");
}

var retval = new NameValueCollection
{
{ "documentId", DocumentId },
{ "filename", Filename }
};

if (Content.Count == 1)
{
retval.Add("documentFile", Content[0]);
}
else
{
for (int i = 0; i < Content.Count; i++)
{
retval.Add($"documentFile[{i}]", Content[i]);
}
}

return retval;
}

/// <inheritdoc />
protected override void PrepareAndSetResponse()
{
// do nothing
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace PAYNLSDK.API.Alliance.DisablePaymentOption
{
/// <summary>
/// Result class for DisablePaymentOption call
/// </summary>
public class DisablePaymentOptionResult : ResponseBase
{
/// <summary>
/// Returns true if the payment option was successfully disabled
/// </summary>
public bool Success => Request?.Result == true;
}
}
56 changes: 56 additions & 0 deletions PAYNLSDK/API/Alliance/DisablePaymentOption/Request.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System.Collections.Specialized;
using PAYNLSDK.Exceptions;
using PAYNLSDK.Utilities;

namespace PAYNLSDK.API.Alliance.DisablePaymentOption
{
/// <summary>
/// Request to disable a payment option for a service
/// </summary>
public class Request : RequestBase
{
/// <inheritdoc />
protected override int Version => 4;
/// <inheritdoc />
protected override string Controller => "Service";
/// <inheritdoc />
protected override string Method => "disablePaymentOption";

/// <summary>
/// The service ID
/// </summary>
public string ServiceId { get; set; }

/// <summary>
/// The payment profile ID (payment method ID)
/// </summary>
public string PaymentProfileId { get; set; }

/// <inheritdoc />
public override NameValueCollection GetParameters()
{
if (ParameterValidator.IsEmpty(ServiceId))
{
throw new PayNlException("ServiceId is required");
}
if (ParameterValidator.IsEmpty(PaymentProfileId))
{
throw new PayNlException("PaymentProfileId is required");
}

var retval = new NameValueCollection
{
{ "serviceId", ServiceId },
{ "paymentProfileId", PaymentProfileId }
};

return retval;
}

/// <inheritdoc />
protected override void PrepareAndSetResponse()
{
// do nothing
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace PAYNLSDK.API.Alliance.EnablePaymentOption
{
/// <summary>
/// Result class for EnablePaymentOption call
/// </summary>
public class EnablePaymentOptionResult : ResponseBase
{
/// <summary>
/// Returns true if the payment option was successfully enabled
/// </summary>
public bool Success => Request?.Result == true;
}
}
Loading