The GiroCheckout SDK for .NET allows for an easy integration of our GiroCheckout API into all sorts of .NET-based applications. The SDK includes all interfaces that the GiroCheckout API by GiroSolution GmbH offers for the creation of requests and the processing of their responses. The SDK takes care of all the technical details, such as hash checksum calculation and thread-safe processing.
Complementing this documentation, you may find additional information both in the separate documentation package linked to in the download section, and on http://api.girocheckout.de.
An important requirement for the usage of GiroCheckout is the creation of a user account and corresponding payment projects on https://www.girocockpit.de.
GiroCheckout uses two parallel channels for the communication between the GiroCheckout server and the Shop: The notification (or notify for short) and the redirect. The notify is a server to server call in the background, whereas the redirect runs over the customer's browser, showing him the transaction result at the end. Both paths must function separately and independently from each other, in case one of them doesn't reach its destination. This way, the transaction is also successful if the notification happens to not arrive at the shop for whatever reason (so only the redirect could be successful) or if the customer interrupts the redirection to the shop site (so only the notify gets through). But of course a check is required on both sides whether the order has already been processed in the shop, in order to avoid a duplicate processing.
Please also see API Basics.
Add references to the GiroCheckout.dll and Newtonsoft.Json.dll to your project.
Note: If Newtonsoft.Json.dll is already present on your system in an older release, please update accordingly.
For all calls to the GiroCheckout API you require a reference to your merchant account and to the payment project used..
Merchant merchant = new Merchant(ihreHändlerID, logger); Project project = merchant.createProject(ihreProjektID, ihrProjektPasswort);
When sending a request towards GiroCheckout, begin by defining the data required for the transaction and then create the corresponding request on the Project object.
Example: Giropay payment
GiropayTransactionRequest request = project.createGiropayTransactionRequest(merchantTxId, amount, currency, purpose, bic, iban, info1Label, info2Label, info3Label, info4Label, info5Label, info1Text, info2Text, info3Text, info4Text, info5Text, urlRedirect, urlNotify);
Each request has an execute method that returns the corresponding response object.
GiropayTransactionResponse response = request.execute(); Console.WriteLine("redirect: [" + response.Redirect + "]"); Console.WriteLine("reference: [" + response.Reference + "]");
If there are problems during the communication with the GiroCheckout API, a GiroCheckoutProtocolException is thrown, which contains further information about the error. Furthermore, the
GiroCheckoutException displays internal errors. Your can find a list of all error numbers here.
The result of a payment is either contained in the notify/redirect URL or, in case of direct payments, in the correspnding response class. The code 4000 always signifies a successful transaction. All other codes give more information about what problem occurred. A list of all result codes can be found here.