Exemplo n.º 1
0
        public SquareHelper(SquareLocationModel location)
        {
            _env         = location.ApplicationId.StartsWith("sandbox") ? Square.Environment.Sandbox : Square.Environment.Production;
            _accessToken = location.AccessToken;
            LocationId   = location.LocationId;

            Client = new SquareClient.Builder()
                     .Environment(_env)
                     .AccessToken(_accessToken)
                     .Build();
        }
        public ProcessPaymentModel(Microsoft.Extensions.Configuration.IConfiguration configuration)
        {
            var environment = configuration["AppSettings:Environment"] == "sandbox" ?
                              Square.Environment.Sandbox : Square.Environment.Production;

            client = new SquareClient.Builder()
                     .Environment(environment)
                     .AccessToken(configuration["AppSettings:AccessToken"])
                     .Build();

            locationId = configuration["AppSettings:LocationId"];
        }
        public _Default()
        {
            // Get environment
            Square.Environment environment = ConfigurationManager.AppSettings["Environment"] == "sandbox" ?
                                             Square.Environment.Sandbox : Square.Environment.Production;

            // Build base client
            client = new SquareClient.Builder()
                     .Environment(environment)
                     .AccessToken(ConfigurationManager.AppSettings["AccessToken"])
                     .Build();
        }
Exemplo n.º 4
0
        public CheckoutSquare()
        {
            // Get environment
            Square.Environment environment = WebConfigurationManager.AppSettings["SQUARE_Environment"] == "sandbox" ? Square.Environment.Sandbox : Square.Environment.Production;

            // Build base client
            client = new SquareClient.Builder()
                     .Environment(environment)
                     .AccessToken(WebConfigurationManager.AppSettings["SQUARE_AccessToken"])
                     .Build();

            locationId = WebConfigurationManager.AppSettings["SQUARE_LocationId"];
        }
Exemplo n.º 5
0
        public CheckoutModel(Microsoft.Extensions.Configuration.IConfiguration configuration, DropShipModels.MyContext context)
        {
            dbContext = context;

            // Get environment
            Square.Environment environment = configuration["AppSettings:Environment"] == "sandbox" ?
                                             Square.Environment.Sandbox : Square.Environment.Production;

            // Build base client
            client = new SquareClient.Builder()
                     .Environment(environment)
                     .AccessToken(configuration["AppSettings:AccessToken"])
                     .Build();

            locationId = configuration["AppSettings:LocationId"];
        }
Exemplo n.º 6
0
        public IndexModel(Microsoft.Extensions.Configuration.IConfiguration configuration)
        {
            var environment = configuration["AppSettings:Environment"] == "sandbox" ?
                              Square.Environment.Sandbox : Square.Environment.Production;

            ApplicationId = configuration["AppSettings:ApplicationId"];
            LocationId    = configuration["AppSettings:LocationId"];

            WebPaymentsSdkUrl = environment == Square.Environment.Sandbox ?
                                "https://sandbox.web.squarecdn.com/v1/square.js" : "https://web.squarecdn.com/v1/square.js";


            client = new SquareClient.Builder()
                     .Environment(environment)
                     .AccessToken(configuration["AppSettings:AccessToken"])
                     .Build();
        }
Exemplo n.º 7
0
        static ProviderUtils()
        {
            _settings = ProviderUtils.GetProviderSettings();
            var accessToken = NBrightCore.common.Security.Decrypt(PortalController.Instance.GetCurrentSettings().GUID.ToString(), _settings.GetXmlProperty("genxml/textbox/accesstoken"));
            var sandboxMode = _settings.GetXmlPropertyBool("genxml/checkbox/sandboxmode");

            var env = Square.Environment.Production;

            if (sandboxMode)
            {
                env = Square.Environment.Sandbox;
            }

            _client = new Square.SquareClient.Builder()
                      .Environment(env)
                      .AccessToken(accessToken).Build();

            // Get the default location or an exact name match
            // as specified in the plugin settings
            _locationId = GetLocation(_settings.GetXmlProperty("genxml/textbox/locationname")).Id;
        }
Exemplo n.º 8
0
 public UserClient()
 {
     AccessToken = "sq0atp-MliszJ0T1MWnn8cHUTKYow";
     _client     = new SquareClient(AccessToken);
 }
Exemplo n.º 9
0
 public void Visit(SquareClient client)
 {
     client.Picture = new DrawingResult();
 }
Exemplo n.º 10
0
 public void Visit(SquareClient client)
 {
     client.AnglesCount = 4;
 }