Skip to content
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

PS2-140 - GetSingleStatus always returns null #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
295 changes: 149 additions & 146 deletions BuckarooSdk.Tests/Services/EMandate/EMandateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,152 +8,155 @@

namespace BuckarooSdk.Tests.Services.EMandate
{
[TestClass]
public class EMandateTests
{
private SdkClient _buckarooClient;
private string TestName => nameof(EMandateTests).ToUpper();

[TestInitialize]
public void Setup()
{
this._buckarooClient = new SdkClient(TestSettings.Logger);
}

[TestMethod]
public void CreateMandateTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionbase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{ TestName }_{ DateTime.Now.Ticks }",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentmethod you want to use
.CreateMandate(new EMandateCreateMandateRequest // choose the action you want to use and provide the payment method specific info.
{
EMandateReason = string.Empty,
SequenceType = 0,
PurchaseId = string.Empty,
DebtorBankId = string.Empty,
MandateId = string.Empty,
DebtorReference = string.Empty,
Language = string.Empty,

});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}
[TestMethod]
public void GetIssuerListTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionbase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{ TestName }_{ DateTime.Now.Ticks }",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentmethod you want to use
.GetIssuerList(new EMandateGetIssuerListRequest // choose the action you want to use and provide the payment method specific info.
{

});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}
[TestMethod]
public void GetStatusTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionbase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{ TestName }_{ DateTime.Now.Ticks }",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentmethod you want to use
.GetStatus(new EMandateGetStatusRequest // choose the action you want to use and provide the payment method specific info.
{
MandateId = string.Empty,
});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}
[TestMethod]
public void ModifyMandateTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionbase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{ TestName }_{ DateTime.Now.Ticks }",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentmethod you want to use
.ModifyMandate(new EMandateModifyMandateRequest // choose the action you want to use and provide the payment method specific info.
{
OriginalIBAN = string.Empty,
PurchaseId = string.Empty,
OriginalDebtorBankId = string.Empty,
EMandateReason = string.Empty,
SequenceType = 0,
OriginalMandateId = string.Empty,
DebtorBankId = string.Empty,
Language = string.Empty,
DebtorReference = string.Empty,
});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}

[TestCleanup]
public void TearDown()
{
this._buckarooClient = null;
}
}
[TestClass]
public class EMandateTests
{
private SdkClient _buckarooClient;
private string TestName => nameof(EMandateTests).ToUpper();

[TestInitialize]
public void Setup()
{
this._buckarooClient = new SdkClient(TestSettings.Logger);
}

[TestMethod]
public void CreateMandateTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionBase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{TestName}_{DateTime.Now.Ticks}",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentMethod you want to use
.CreateMandate(new EMandateCreateMandateRequest // choose the action you want to use and provide the payment method specific info.
{
EMandateReason = string.Empty,
SequenceType = 0,
PurchaseId = string.Empty,
DebtorBankId = string.Empty,
MandateId = string.Empty,
DebtorReference = string.Empty,
Language = string.Empty,

});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}

[TestMethod]
public void GetIssuerListTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.DataRequest() // One of the request type options.
.SetBasicFields(new DataBase // The transactionBase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{TestName}_{DateTime.Now.Ticks}",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentMethod you want to use
.GetIssuerList(new EMandateGetIssuerListRequest // choose the action you want to use and provide the payment method specific info.
{

});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}

[TestMethod]
public void GetStatusTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.DataRequest() // One of the request type options.
.SetBasicFields(new DataBase // The database contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{TestName}_{DateTime.Now.Ticks}",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentMethod you want to use
.GetStatus(new EMandateGetStatusRequest // choose the action you want to use and provide the payment method specific info.
{
MandateId = string.Empty,
});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}

[TestMethod]
public void ModifyMandateTest()
{
var request =
this._buckarooClient.CreateRequest(new StandardLogger()) // Create a request.
.Authenticate(TestSettings.WebsiteKey, TestSettings.SecretKey, false, new CultureInfo("nl-NL"))
.TransactionRequest() // One of the request type options.
.SetBasicFields(new TransactionBase // The transactionBase contains the base information of a transaction.
{
Currency = "EUR",
Description = $"SDK_{TestName}_{DateTime.Now.Ticks}",
ReturnUrl = TestSettings.ReturnUrl,
ReturnUrlCancel = TestSettings.ReturnUrlCancel,
ReturnUrlError = TestSettings.ReturnUrlError,
ReturnUrlReject = TestSettings.ReturnUrlReject,

})
.EMandate() // Choose the paymentMethod you want to use
.ModifyMandate(new EMandateModifyMandateRequest // choose the action you want to use and provide the payment method specific info.
{
OriginalIBAN = string.Empty,
PurchaseId = string.Empty,
OriginalDebtorBankId = string.Empty,
EMandateReason = string.Empty,
SequenceType = 0,
OriginalMandateId = string.Empty,
DebtorBankId = string.Empty,
Language = string.Empty,
DebtorReference = string.Empty,
});

var response = request.Execute();

// Process.Start(response.RequiredAction.RedirectURL);
// Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
}

[TestCleanup]
public void TearDown()
{
this._buckarooClient = null;
}
}
}