IOT Virtual Conference - Register now to book your ticket and get updates
x
WIN Surface Laptop 4, i7 Processor, 16GB RAM, 512GB SSD
x
CONGRATULATIONS! C# Corner Q1, 2021 MVPs Announced
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forumguidelines
Braja Lal Mahanty
2k
28
1.9k
How to make a payment gateway from square.com in my c# mvc p
Oct 22 2016 10:08 AM
I want to add payment gateway from square.com in my c# mvc project. I already tried lots of things from google but unable to find proper solution.
Here is my controller code I already tried
public ActionResult Squre()
{
_transactionApi = new TransactionApi();
var client = new RestSharp.RestClient();
var request = new RestSharp.RestRequest("https://connect.squareup.com/v1/me/payments", RestSharp.Method.GET);
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddHeader("Authorization", "Bearer sq0atp-zHuWWPD4ds9J6YoVlEoYZg");
setHeaders(request);
var Response = client.Execute(request);
HttpWebResponse response = null;
string responseMessage = null;
response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
using (Stream stream = response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(stream))
{
responseMessage = reader.ReadToEnd();
}
}
}
return View();
}
namespaces i have used mentioned below here
using System.Runtime.Serialization.Json;
using Square.Connect.Api;
using Square.Connect.Model
I want to make a payment gateway from square in my site. i need full tutorial for this can anyone help me please. What should i do??
Which things i have to modified in my code. Can anyone modify my code please or please give me the proper code
Reply
Answers (
2
)
Encrypt string and save in DB
User should be able to add remove update using mvc4 /5