Thursday, August 11, 2016

Working with Authorize.net using Sandbox Account

Here is the way by which we can work with authorize.net. You can also work with Create New Sandbox and then Login to Sandbox Account. The steps provided here are worked for me and for code implementation, I used "Authorize Credit Card" which worked for me to my Sandbox Account.

Few things that you need to have to work with this is
(1) API Login ID
You will find login id from your account under Login to Sandbox --> Account Menu --> Security Settings --> General Security Settings --> Click on "API Credentials & Keys" link

(2) Transaction Key
You will find this transaction key from your account under Login to Sandbox --> Account Menu --> Security Settings General Security Settings --> Click on "Manage Public Client Key" link

From the same menu Login to Sandbox --> Account Menu --> Security Settings General Security Settings, you can also set
(3) MD5-Hash

(4) Test Mode - While your account is in Test Mode there will be only processing occurred not exact operation will be performed, but to work with live account after testing to charge/authorize your payment it should be in live mode.

Alternatively, you can also set few more things like
(1) Receipt Page :- Used to send payment information with all required information like API Login Id/Transaction Key/Payment information etc.

(2) Response/Receipt URLs :- Used when operation has been completed from Step-(1) and it sends response of the transaction indicating whether it is success/failure of the transaction.


by navigating to Login to Sandbox --> Account Menu --> Transaction Format Settings --> Transaction Response Settings

Set all this stuff to your sandbox account, You will get C# Sample Code as well. In that set required information to the code and set method of payment which you want to do like you can Charge Credit Card, Authorize Credit Card and so on.

Once this configuration and code with your account configuration execute with code provided based on the method(Charge Credit Card, Authorize Credit Card) selected you will find that thing under Login to Sandbox --> Search Menu --> Unsettled Transactions on success of your transaction.

Once you will are success with Sandbox account, for your live account you can check same thing under "Test Mode" account and to check with your actual transaction make it "Live" from "Test" mode.

That's it for the authorize.net implementation.

Thursday, August 4, 2016

Authorize.net Links

Authorize.Net enables merchants to authorize, settle and manage credit card and electronic check transactions via Web sites, retail stores, mail order/telephone order (MOTO) call centers and mobile devices.

Here is some links about the authorize.net.

(1) Authorize.Net Site

(2) Authorize.Net Sample Code

(3) AuthorizeNet/sdk-dotnet

(4) Direct Post Method(DPM)

(5) AuthorizeNet/sdk-dotnet DPM

(6) Authorize.Net - GitHub

(7) FAQs

(8) Transaction Reporting

(9) Authorize.net Environment Setup

(10) API Reference

Here is few more links for Working with Cold Fusion.


(1) Charge Credit Cards using Authorize.net and ColdFusion

(2) AN-DPM-CFM

(3) Need Help for ColdFusion SessionToken and AIM for Authorize.net

(4) Integration and Testing



Thursday, April 14, 2016

Working Events of Telerik Grid View Windows Controls

Here is some events where you can do some operations while working with telerik gridview.

(1) Cell double click :- You can do some functionality while clicking over cell of the grid item, it could be anything like opening a another form in edit mode or anything.
Private Sub grid_CellDoubleClick(sender As Object, e As EventArgs) Handles grid.CellDoubleClick
'Your code goes here        
End Sub

(2) Row Formatting :- When you want to do some operations on your grid items this event comes to you. for me, on some operation i need to show items color to red, i checked its column value and if it meets requirement make it red else reset value of the.
Private Sub rgdAvailResult_RowFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RowFormattingEventArgs) Handles rgdAvailResult.RowFormatting
    If e.RowElement.RowInfo.Cells("column1").Value Then
       e.RowElement.ForeColor = System.Drawing.Color.Red
    Else
       e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local)
    End If
End Sub

(3) View Row Formatting :- for rows related general event to work with different items of the grid. For me, to show filter bar in different color format, i use this event. So, if the item is filterrow then change is color else reset value to original.
Private Sub grid_ViewRowFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RowFormattingEventArgs)
        If TypeOf e.RowElement Is GridFilterRowElement Then
            e.RowElement.BackColor = Color.NavajoWhite
        Else
            e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
        End If
    End Sub

So, these are some events which are i found for my resolution. 

Wednesday, April 13, 2016

Export Telerik Windows GridView Control Data to Excel File

Here is some code snippet which will generate excel file of the telerik windows grid view. I assuming that you already bind data to your telerik grid on your windows application form and performing export to excel on any event.

- Declare new save file dialog in which you will enter your file name
Dim saveFileDialog As New System.Windows.Forms.SaveFileDialog()
- Below code snippet filters your file to be saved for xls only
saveFileDialog.Filter = "Excel (*.xls)|*.xls"
If saveFileDialog.ShowDialog() <> DialogResult.OK Then
    Return
End If
- Below code snippet checks whether file name has been entered or not
If saveFileDialog.FileName.Equals([String].Empty) Then
    RadMessageBox.SetThemeName(MyBase.ThemeName)
    RadMessageBox.Show("Please enter a file name.")
    Return
End If
- Below code snippet acceps name you entered and some default entries to generate your file
Dim fileName As String = saveFileDialog.FileName
Dim excelExporter As New ExportToExcelML("GridName")
excelExporter.SummariesExportOption = SummariesOption.ExportAll
excelExporter.SheetMaxRows = ExcelMaxRows._1048576
excelExporter.RunExport(fileName)
RadMessageBox.SetThemeName(MyBase.ThemeName)
- Below code snippet asks dialog to open saved file 
Dim dr As DialogResult = RadMessageBox.Show("The data in the grid was exported successfully. Do you want to open the file?", "Export to Excel", MessageBoxButtons.YesNo, RadMessageIcon.Question)
If dr = DialogResult.Yes Then
    System.Diagnostics.Process.Start(fileName)
End If

This way you can export your telerik windows control grid view data to excel file in default format.

Tuesday, April 12, 2016

Add an Item to Context Menu of Telerik Windows Grid View

Here is some code to work with Context Menu of Grid View of Telerik Windows Controls for Windows Forms

How to add an item to context menu of Grid View : To add custom item to context menu of the telerik grid view follow the steps below. For this code, I assume you are using Telerik Grid View for your Windows Forms and you have performed all necessary steps to bind your grid.

- Add an event handler 
AddHandler radGridView1.ContextMenuOpening, AddressOf radGridView1_ContextMenuOpening1

- Create contet menu event
Private Sub radGridView1_ContextMenuOpening1(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs)
        Dim menuItemExportToSpreadsheet As RadMenuItem = New RadMenuItem()
        menuItemExportToSpreadsheet.Text = "Export to Spreadsheet"
        AddHandler menuItemExportToSpreadsheet.Click, AddressOf ExportToSpreadsheet

        Dim separator As RadMenuSeparatorItem = New RadMenuSeparatorItem()
        e.ContextMenu.Items.Add(separator)
        e.ContextMenu.Items.Add(menuItemExportToSpreadsheet)
    End Sub

- Create click event of the newly added context menu item
Private Sub ExportToSpreadsheet(ByVal sender As Object, ByVal e As System.EventArgs)
'Your code goes here
End Sub

So, after doing this, each time you are on your grid view and you are opening your context menu you will see a new item get added to your context menu named "Expor to Spreadsheet", and on click of this you can perform logic written under its handler. 

This way you can add new menu item under your Telerik Grid Context Menu.