Design Pattern : Dependency Injection
Download the code and implement in your project. Download code have 3 projects.
- Web Project
- Console Application
- Payment Library
In Payment Library, no need to change it.Please see the below class diagram. Yiu can implment other payment gatway also in this project. Only just create one more class in below folder
TestPaymentGatway\TestPaymentGatwayLib\BusinessLogic
Already two classes is there, ICICIHelper and CCAvenueHelper
When you run the Web Project with start "CustomerForm.aspx" under ICICIBank folder then screen will display like this
When you run the Web Project with start "CustomerForm.aspx" under CCAvenue Folder then screen will display like this
Remeber: change the setting according to setting
<appSettings>
<add key="ICICIPaymentGatewayPurchase" value="https://google.com/connect/gateway/processing"/>
<add key="ICICIPaymentGatewayRefund" value="https://google.com/ipgapi/services"/>
<add key="CcAvenueMerchantId" value="1234566"/>
<add key="CcAvenueWorkingKey" value="gfdgdfgdfgdfgdfgdfgfd"/>
<add key="CcAvenueAccessCode" value="fdgdfgdfgdfgdfgfdg"/>
<add key="CcAvenueCheckoutUrl" value="https://google.com/transaction/transaction.do?command=initiateTransaction"/>
</appSettings>