square/square-dotnet-sdk

No Builder Class

Closed this issue · 3 comments

Hi,

I use MVC 5.

When I add this code, I get this error:

`using System;
using Square;
using Square.Models;
using Square.Exceptions;

namespace Example
{
public class Example
{

    static void Main(string[] args)
    {
        SquareClient client = new SquareClient.Builder()
            .Environment(Square.Environment.Sandbox)
            .AccessToken("YOUR_SANDBOX_ACCESS_TOKEN")
            .Build();

`

Builder does not exist in SquareClient. Builder() does not appear to exist in any class from Square. My code also says SquareClient does not exist. I am using Square.Connect 2.25. Am I missing an assembly reference?

If you're using Square.Connect 2.25, then that's not even this SDK; that's the now deprecated Connect SDK (https://github.com/square/connect-csharp-sdk). I suggest updating to use this one (Square .NET SDK) to have access to builders and latest features.

Thanks. I made the update. Should I query the order endpoint for the customer address info? If I just query the payments endpoint, is there a way to pull the customer's info?

image

Depending on how the payment was taken it could potentially be in either the Order or Payment object as a customer_id. You could then retrieve the customer from the Customers API to get the full info on the customer.