How To Create Payment Gateway In Asp Net C#
- Remove From My Forums
-
Question
-
User1997788493 posted
Hello..,
I'm Creating Hotel booking website,User can book hotel room for stay here , so how to add payment gateway to my website,..once he booked that specific hotel how to add that room cost to payment gateway ..? i want about payment from starting ,i dont know about this concept ,can anybody please tell me about payment gateway step by step.
Answers
-
User-2099109049 posted
Hi DDNaidu,
You can use PayPal Gateway Integration in ASP.NET.
Here you have to give information regarding your PayPal account, your PayPal email ID , PayPal submit URL, your website success URL, failure URL, etc.<appSettings> <add key="token" value="PW1BDVNqVPVanwduF_Tb2Ey91aT1Uhx1kL7HPc-7e8S-6AnUwSSHyasolSe"/> <add key="paypalemail" value="k.tapankumar@gmail.com"/> <!--Here i used sandbox site url only if you hosted in live change sandbox to live paypal URL--> <add key="PayPalSubmitUrl" value="https://www.paypal.com/cgi-bin/webscr"/> <add key="FailedURL" value="http://www.mrsoft.co.in/ProceedToPayment.aspx"/> <add key="SuccessURL" value="http://www.mrsoft.co.in/ProceedToPayment.aspx"/> </appSettings>
Implemented all the details that a user should enter while making the payment, such as Name, Address, Subject, Mobile No, Email Address, Amount, Currency etc.
<div style="color: #324143; margin: 30px 0 0 60px; font-family: Arial;"> <span style="font-size: small;">Your Name:</span> <asp:TextBox runat="server" ValidationGroup="save" ID="txtName" Style="margin-left: 30px; width: 200px; background-image: url('../images/txtBoxbg.jpg') no-repeat;"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtPurpose" ErrorMessage="Please enter your Name" runat="server" ValidationGroup="save" ForeColor="red"></asp:RequiredFieldValidator> <br /> <br /> <span style="font-size: small;">Your Email Id:</span><asp:TextBox runat="server" ValidationGroup="save" Style="margin-left: 20px;width: 200px; background-image: url('../images/txtBoxbg.jpg') no-repeat;" ID="txtEmailId"></asp:TextBox> <asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtEmailId" ValidationGroup="save" ErrorMessage="Invalid Email Format" ForeColor="red"></asp:RegularExpressionValidator><br /> <br /> <span style="font-size: small;">Your Phone No:</span> <asp:TextBox runat="server" ID="txtPhone" ValidationGroup="save" Style="margin-left: 6px; width: 200px; background-image: transparent url('../images/txtBoxbg.jpg') no-repeat;"></asp:TextBox> <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtPhone" ForeColor="red" ErrorMessage="Invalid Phone No" ValidationGroup="save" ValidationExpression="^([0-9\(\)\/\+ \-]*)$"></asp:RegularExpressionValidator> <br /> <br /> <span style="font-size: small;">Enter Amount:</span><asp:TextBox runat="server" ID="txtAmount" ValidationGroup="save" Style="margin-left: 16px; width: 200px; background-image: url('../images/txtBoxbg.jpg') no-repeat;"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtAmount" runat="server" ForeColor="red" ErrorMessage="Please enter the amount."></asp:RequiredFieldValidator> <br /> <br /> <span style="font-size: small;">Currency:</span> <asp:DropDownList runat="server" ID="ddlCurrency" Style="margin-left: 42px; width: 204px; background-image: transparent url('../images/txtBoxbg.jpg') no-repeat;"> <asp:ListItem>- Select -</asp:ListItem> <asp:ListItem>INR</asp:ListItem> <asp:ListItem>USD</asp:ListItem> <asp:ListItem>EURO</asp:ListItem> <asp:ListItem>Pound</asp:ListItem> </asp:DropDownList> <br /> <br /> <span style="font-size: small;">Your Purpose:</span><asp:TextBox TextMode="MultiLine" Rows="10" runat="server" ID="txtPurpose" Height="50px" Style="margin-left: 17px; margin-left: 19px; width: 200px; background-image: url('../images/txtBoxbg.jpg') no-repeat;"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="txtPurpose" ErrorMessage="Can not be left blank" ValidationGroup="save" runat="server" ForeColor="red"></asp:RequiredFieldValidator> <br /> <asp:Button ID="btnPay" runat="server" Text="Pay Now" CssClass="button" Style="font-size: 12px; cursor: pointer; height: 27px; margin-left: 207px; margin-top: 10px; width: 93px;" OnClick="btnPay_AsPerYourChoice" ValidationGroup="save"></asp:Button> </div>Using the live URL of PayPal as this functionality is implemented in my live server. You can use the Sandbox URL of PayPal for testing purposes.
protected void PayWithPayPal(string amount, string itemInfo, string name, string phone, string email, string currency) { string redirecturl = ""; //Mention URL to redirect content to paypal site redirecturl += "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + ConfigurationManager.AppSettings["paypalemail"].ToString(); //First name i assign static based on login details assign this value redirecturl += "&first_name=" + name; //City i assign static based on login user detail you change this value redirecturl += "&city=bhubaneswar"; //State i assign static based on login user detail you change this value redirecturl += "&state=Odisha"; //Product Name redirecturl += "&item_name=" + itemInfo; //Product Name redirecturl += "&amount=" + amount; //Phone No redirecturl += "&night_phone_a=" + phone; //Product Name redirecturl += "&item_name=" + itemInfo; //Address redirecturl += "&address1=" + email; //Business contact id // redirecturl += "&business=k.tapankumar@gmail.com"; //Shipping charges if any redirecturl += "&shipping=0"; //Handling charges if any redirecturl += "&handling=0"; //Tax amount if any redirecturl += "&tax=0"; //Add quatity i added one only statically redirecturl += "&quantity=1"; //Currency code redirecturl += "¤cy=" + currency; //Success return page url redirecturl += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString(); //Failed return page url redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString(); Response.Redirect(redirecturl); }Reference URL HERE
- Marked as answer by Thursday, October 7, 2021 12:00 AM
-
User-821857111 posted
Step 1: Find a payment provider.
Step 2: Read their integration documentationThat's it.
There are a lot of payment providers to choose from. You should research them to see what their charges are, what their integration options are etc, and then choose one that suits your needs. How you integrate with them will vary, but they should all offer good integration documentation, sample code and possibly also technical support.
Normally, the safest way to approach this kind of thing is to let the payment provider handle the taking of payment details and to complete the transaction. Typically, you will provide required details to the payment provider, such as the order id, amount, your merchant id and they will then take payment and notify you if the payment was processed successfully. This is usually done with simple form posts. You should never have to ask anyone for their payment details or store them yourself.
This is not the right forum to ask for recommendations for payment providers. You need to do your own research on that because they are often restricted to geographical regions and certain types of businesses.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
How To Create Payment Gateway In Asp Net C#
Source: https://social.msdn.microsoft.com/Forums/en-US/066e562e-33dd-46b5-8d52-711d58de4151
Posted by: rutledgepaus1952.blogspot.com

0 Response to "How To Create Payment Gateway In Asp Net C#"
Post a Comment