Square Payment - CreatePaymentAsync please help

We use GoDaddy to host our website to talk with Square thru the API.
We have been taking credit card payments for the past couple of months and yesterday we started getting exceptions with the CreatePaymentAsync not returning.
I have contacted Square and they said nothing is coming thru and GoDaddy said no issues. We have not changed the code. Any help would be greatly appreciated. This is the code we are using.

We get an exception from the TakePaymentHelper without any exception information.
Additionally the
Task.WaitAll(result) doesn’t seem to complete.

I have no idea what could have changed or where to start. Our code just stopped working? GoDaddy problem? Square issue?
Please help since this is for a neighborhood pool and we can’t take payments.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Newtonsoft.Json.Converters;
using Square;
using Square.Utilities;
using Square.Http.Client;
using Square.Http.Response;
using Square.Apis;
using Square.Exceptions;

namespace SquareSDKHelperClassLibrary
{
public class SquareHelper
{
ApiException Except;

    public Square.Models.CreatePaymentResponse TakePaymentHelper(String Nonce, Double Amount, String Reference, String Description, String CustomerID, String CustomerEmail, ref ApiException SquExcept)
    {
        try
        {
            Except = null;
            Square.Models.CreatePaymentResponse PaymentResponse = null;

            Task<Square.Models.CreatePaymentResponse> result = TakePayment(Nonce, Amount, Reference, Description, CustomerID, CustomerEmail);
            Task.WaitAll(result);
            if (result.Result != null)
            {
                PaymentResponse = result.Result;
                //TextBoxError.Text = PaymentResponse.ToString();
            }
            SquExcept = Except;
            return PaymentResponse;
        }
        catch (Exception ex)
        {
            Console.WriteLine("Failed to make the request");
            Console.WriteLine("Exception " + ex.Message);
            return null;
        }
        // Dim payment As Models.CreatePaymentResponse = result.Result
    }


    async Task<Square.Models.CreatePaymentResponse> TakePayment(String Nonce, Double Amount, String Reference, String Description, String CustomerID, String CustomerEmail)
    {
        SquareClient client = new SquareClient.Builder()
            .Environment(Square.Environment.Production)
            .AccessToken("sq0atp-removed") //production
            .Build();

        String LocationStr = "removed"; //production
                                              
        String PaymentGUID = Guid.NewGuid().ToString();
        IPaymentsApi paymentsApi = client.PaymentsApi;

        long IntAmount = Convert.ToInt64(Amount * 100.0); //Convert to Square value
        var bodyAmountMoney = new Square.Models.Money.Builder()
            .Amount(IntAmount)
            .Currency("USD")
            .Build();

        var body = new Square.Models.CreatePaymentRequest.Builder(
                Nonce,
                PaymentGUID,
                bodyAmountMoney)
            .Autocomplete(true)
            .CustomerId(CustomerID)
            .LocationId(LocationStr)
            .ReferenceId(Reference)
            .Note(Description)
            .BuyerEmailAddress(CustomerEmail)
            .Build();

        Square.Models.CreatePaymentResponse result = null;
        try
        {
            result = await paymentsApi.CreatePaymentAsync(body);
            return result;
        }
        catch (ApiException e)
        {
            Except = e;
            return result;
        };

    }

}

What’s your Square app id? I can confirm in our logs if we’re seeing anything. Are you able to confirm if the TakePayment function is successfully being executed? Is it just getting “stuck” at result = await paymentsApi.CreatePaymentAsync(body);?

sq0idp-k8rjoDEYGYZn1IExjwznMA

There be some hits for yesterday running on my local server.
The hits from square are in question.
I can try again if it will help.

Dave Peterson
www.petesconsulting.com
970.213.2361

I did a simpler test this morning to get the location and got this error.
“Error calling Charge: The request was aborted: Could not create SSL/TLS secure channel.”
Did something change with Square on May 25 or 26?

i still have no idea why our website stopped connecting to Square, and Square and GoDaddy say nothing changed…

in the square developer settings,

  • i updated my access token because it said it was old.
  • i set the production api version to the latest, it said i was 23 revs back.

I updated our website to use Square SDK v11.
i was able to get the location id and post a payment running with the visual studio IIS server on my local computer.

When i run from the GoDaddy server, i would get a message a that secure connection to Square could not be established.

i changed our code to force TLS 1.2 before the Square connection attempt and it worked.