Skip to content

Conversation

Copy link

Copilot AI commented Oct 22, 2025

Overview

This PR completes the migration of all Alliance SDK functionality from the official PHP Alliance SDK to the C# SDK, addressing issue #XX which requested a comparison and migration of missing functions.

What's Changed

Added 12 new Alliance API methods that were present in the PHP SDK but missing in the C# implementation:

Merchant Management (7 methods)

  • GetMerchants - Retrieve a list of merchants with optional state filtering (new/accepted/deleted)
  • Suspend/Unsuspend - Manage merchant account suspension status
  • SetPackage - Change merchant package tier (Alliance/AlliancePlus)
  • MarkReady - Mark merchant as ready for activation
  • AddClearing - Add clearing transactions for merchants
  • AddBankAccount - Add bank account with iDEAL verification flow

Service Management (4 methods)

  • GetCategories - Retrieve available website categories
  • GetAvailablePaymentOptions - List available payment methods for a service
  • EnablePaymentOption - Enable payment methods with optional settings
  • DisablePaymentOption - Disable payment methods for a service

Document Management (1 method)

  • AddDocument - Upload documents with base64 encoding (supports multiple files)

Technical Details

All new methods follow the established SDK patterns:

  • Consistent with existing code structure and naming conventions
  • Proper parameter validation using PayNlException
  • XML documentation for all public APIs
  • Request/Result class pairs for each endpoint
  • Version-specific API endpoints matching PHP SDK

Testing

  • Added 12 comprehensive unit tests covering all new methods
  • All 102 tests passing (up from 90)
  • No security vulnerabilities detected (CodeQL verified)
  • No build errors or new warnings introduced

Example Usage

var client = new Client();
var alliance = new Alliance(client);

// Get list of new merchants
var merchants = alliance.GetMerchants(new GetMerchants.Request { State = "new" });

// Enable iDEAL payment for a service
var result = alliance.EnablePaymentOption(new EnablePaymentOption.Request 
{ 
    ServiceId = "SL-1234-5678",
    PaymentProfileId = "10"
});

// Upload a document
var docRequest = new AddDocument.Request 
{ 
    DocumentId = "D-1234-5678",
    Filename = "registration.pdf"
};
docRequest.AddContent(base64EncodedContent);
var docResult = alliance.AddDocument(docRequest);

Feature Parity

The C# SDK now has 100% feature parity with the official PHP Alliance SDK. All merchant, service, and document management capabilities from the PHP implementation are now available in C#.

Future Considerations

The original issue also mentioned creating a separate Alliance project to avoid requiring alliance functions when not needed. This architectural change was intentionally not included to keep changes minimal and focused. It could be considered as a future enhancement in a separate PR.

Files Changed

  • 24 new API request/result files
  • 2 updated core files (IAlliance.cs, Alliance.cs)
  • 1 updated test file with 12 new tests
  • Total: 27 files changed, 1,416 insertions(+)
Original prompt

This section details on the original issue you should resolve

<issue_title>create alliance project & migrate php alliance sdk</issue_title>
<issue_description>Ik vond de officiele alliance sdk (geschreven in PHP): https://github.com/paynl/sdk-alliance/tree/master/src

Kan je nakijken welke functies we missen on onze alliance sdk en deze toevoegen?
Ik ben ook aan het denken om de sdk in een apart project te trekken zodat je standaard niet de alliance functies mee binnen moet trekken als je deze library gebruikt. Dat gaat ook een aantal zaken vereenvoudigen omdat het document endpoint voor de alliance anders gaat werken dan de algemene document api gok ik.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #37


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Create alliance project and migrate PHP alliance SDK Migrate missing Alliance SDK methods from PHP SDK to C# Oct 22, 2025
Copilot AI requested a review from dampee October 22, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create alliance project & migrate php alliance sdk

2 participants