Link to home
Start Free TrialLog in
Avatar of Ajoy Mondal
Ajoy Mondal

asked on

Paypal capture payment issue

I am working with paypal Authorize and capture payment into may asp.net application.
I have done successfully authorize part of the payment, but when try to capture give error
"The request was aborted: Could not create SSL/TLS secure channel".
My code below

Dim cart As String = "xxxxxxxxxxxxx"
            Dim AuthorizationToken As String = "xxxxxxxxxxxxxx"
            Dim counturl As String = "https://api.sandbox.paypal.com/v1/payments/authorization/" & cart & "/capture"

            Dim Request As WebRequest = WebRequest.Create(New Uri(counturl))
            Dim json As String = "{'Amount': { 'Currency': '\'USD\'', 'Total': '50' },'is_final_capture': 'True'}"

            Request.ContentType = "application/json"
            Request.Headers.Add("Authorization", "Bearer " & AuthorizationToken)
            Request.Method = "POST"
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls

            Dim aa As StreamWriter = New StreamWriter(Request.GetRequestStream())

            aa.Write(json)
            aa.Flush()
            aa.Close()

            Dim HttpResponse As HttpWebResponse = Request.GetResponse()
            Dim streamReader As StreamReader = New StreamReader(HttpResponse.GetResponseStream())

            Dim result As String = streamReader.ReadToEnd()

Open in new window



I am using .net framework 4.0

How can I solve this problem. Thanks...
ASKER CERTIFIED SOLUTION
Avatar of A Q Choudary
A Q Choudary
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks