eWAY is the easiest way to accept payments in your app or on your website. Get integrated and start selling more, faster - in a range of languages using the eWAY SDKs, helpful documentation, and 24/7 support from real humans. eWAY - with you every step of the way.
Accept payments quickly and easily with eWAY and .NET (C#) using the eWAY Rapid .NET SDK. Using the eWAY .NET SDK provides convenient access to all the features of eWAY’s Rapid API, so you can create transactions, process refunds, query transactions, create token customers, and more!
InstallationThe eWAY .NET SDK is available from NuGet, a .NET package manager. Installing with NuGet means you will also fetch the eWAY .NET SDK dependencies, plus receive notification of any package updates.
To install with the NuGet Package Manager Console, simply run
Alternatively, use the NuGet dialog and search for eWAY to add the package to your solution.
To make development and testing with eWAY easy, get a free partner account which provides access to the eWAY Sandbox.
Now you are all set to build your eWAY integration! You can find code samples for integrating various eWAY functions as part of the eWAY Rapid API reference.
To demonstrate adding the eWAY .NET SDK, this example will show how to accept a payment with the Responsive Shared Page.
This example assumes that Visual Studio with NuGet is being used. To keep things simple, only the eWAY specific code is shown so it can be added to your preferred network.
1. Add the eWAY .NET SDK
First add the eWAY .NET SDK to your project using NuGet. Open the Package Manager Console in Visual Studio by going to Tools, then Library or NuGet Package Manager and then click Package Manager Console. Once open, enter
Then NuGet will download and add the eWAY .NET SDK and its dependencies.
2. Load the eWAY Client
3. Create a Shared Payment URL
In order to send a customer to the Responsive Shared Page, a URL must be generated using the create function. This accepts a PaymentMethod and a Transaction object.
The PaymentMethod determines how the card data will be accepted (in this case ResponsiveShared) while the Transaction object contains customer and invoice details – more details of the variables that can be passed can be found in the Rapid API reference.
To make sure everything went well, check that the Errors list is empty. If it isn’t, UserDisplayMessage can be used to convert any error codes to human readable messages:
4. Redirect the Customer
Once the shared page URL has been created, the customer can be redirected. How this is done will depend on the Java framework and workflow. For example, in an ASP.NET MVC application:
So now a Responsive Shared Page URL has been created and the customer is redirected to complete their payment.
5. Fetch the Result
Once the customer has gone to the Responsive Shared Page and submitted their payment information, they will be redirected back to the RedirectUrl specified in the request. This page should use the AccessCode (passed as a query variable) to fetch the result of the transaction.
That’s it – a complete Responsive Shared Page integration!
For more information on the functions available in the eWAY .NET SDK, check out the eWAY Rapid API Reference.