Posted in by Tudipat 09:02Comments Off on How to integrate eWAY payment in a .Net project ?
How to integrate eWAY payment in a .Net project ?
Tudip
12 February 2020
Robust, Reliable, Safe andSecure
Robust and highly available, eWAY’s infrastructure delivers industry-leading uptime. Working closely with leading technology partners worldwide
eWAY seamlessly integrates with hundreds of leading eCommerce shopping cart platforms and a network of custom integration development partners providing a competitive advantage for any business that wants to grow through accepting digital payments.
Combining all the most popular payment solutions in a single package, eWAY Rapid API includes fraud prevention, hosted payments, transparent redirect, and direct connection to help developers create secure, perfectly rendered payment pages on all devices.
Here are the steps to integrate eWAY API into the .NET projects :
Creating Testing/Sandbox Environment
Hit the https://sandbox.myeway.com.au/Login.aspx link and log in with your account. If you don’t have the account you can easily sign up for it.
Now you can get the API key by navigating to the Account tab on the sandbox page and select the API Key option. Here you will get the API key. Click on the Generate Password to get the password. Each time when you click on the Generate Password you will get a new password so the same password you would need to update on the code level.
About eWAY Rapid APIs.
eWAY Rapid API includes fraud prevention, hosted payments, transparent redirect, and direct connection to help developers create secure, perfectly rendered payment pages on all devices.
There are various platforms like REST (JSON), SOAP, RPC (XML or JSON) etc., for requests and responses from the eWAY APIs.
For any API request, you need to pass the API Key and generated password along with the endpoint i.e. “Sandbox” or “Production” in the header. Some important points about eWAY Rapid APIs
eWAY’s Rapid APIs provides six different types of Transaction Methods i.e.
Direct Connection
Transparent Redirect
Responsive Shared Page
IFrame
Secure Fields
Secure Panel.
Each method can have three types of Transaction Types i.e. Purchase, MOTO, and Recurring. For more details, you can go to the eWAY APIs Reference page of https://eway.io/api-v3/
Through eWAY Payment API there can be three types of Payment Methods
Process Payment: This method allows merchants to process a standard payment.
Authorise: This transaction will hold an amount on the customer’s card without charging it until a Capture request is sent.
Token Payment: This method allows merchants to process payments using Token customers.
Creating methods to Authenticate Card, Save Card or Charge Card
First set the API Key and Password inside the <AppSetting> element of the WebConfig file and call these before sending the request to the API. On the backend, you will have to write the methods for calling the API for authentication if you need card’s details for authentication purpose only. If you are saving the card you don’t need to call the API for the authentication as it saves the card after authenticating itself.
For the authentication, you can refer to the link https://eway.io/api-v3/?csharp#pre-auth.
For saving the card data you need to call the API for creating the customer and need to pass the card and customer details, it will return the TokenCustomerID as the response and you can save this TokenCustomerID for the future transaction. For more details, you can refer to the link https://eway.io/api-v3/?csharp#token-payments
For charging the card you need to set the Transaction Type as Purchase and you can make the charge by passing the TokenCustomerID or the details of the card. Refer to the link https://eway.io/api-v3/?csharp#direct-connection for more details.Many more APIs are available like Refunds, TransactionQuery, RecurringPayments etc., which can also be used.
Error Handling
When any kind of errors occurred during the transaction process the API returns the respective Error Code in the response. eWAY returns the error message if you request using the error code and the preferred language code. You can also show a custom error message by creating a method where you can write your custom error message for the respective error code and call that method inside the error/exception handling code. You can refer to the link https://eway.io/api-v3/#response-amp-error-codes for the various error codes. To make development even faster and easier, eWAY provides Software Development Kits for . NET (C#). These provide native structures and functions to do the heavy lifting for you. All eWAY SDKs are free, MIT licensed and open source.
The eWAY Rapid C# .NET package is available in NuGet – it can be added using Visual Studio’s package manager. Simply search for “eWAY” and add the package to your project. Alternatively, you can use the Package Manager Console and run Install-Package eWAY.Rapid. NuGet will automatically include the required dependencies.Hope this would help you to develop a payment gateway using eWAY in your project. Happy Coding!
All content provided on this blog is for informational purposes only. Tudip Technologies provides no endorsement and makes no representations as to accuracy, reliability, completeness, suitability or validity of any information or content on, distributed through or linked, downloaded or accessed from this site. Tudip Technologies will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use of the information on this site. All information is provided on an as-is basis without any obligation to make improvements or to correct errors or omissions. This site may contain links to other websites. Tudip Technologies makes no guarantees or promises regarding these websites and does not necessarily endorse or approve of their content. You may not modify any part of the blog. The inclusion of any part of this blog in another work, whether in printed or electronic or other form, or inclusion of any part of the blog in another website by linking, framing or otherwise without the express permission of Tudip Technologies is prohibited. This site may not be used for any illegal or illicit purpose and Tudip Technologies reserves the right, at its sole discretion and without notice of any kind, to remove anything posted to this site. By using this site, you hereby acknowledge that any reliance upon any materials shall be at your sole risk.