This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$location_id = 'location_id'; | |
$api_instance = new SquareConnect\Api\V1ItemsApi(); | |
$body = array( | |
'name'=>'Pots', | |
'description'=> 'Containers for gardening', | |
'variations'=> array( | |
array( | |
'name'=>'Large', | |
'price_money'=>array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Hello World" | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
// Configure OAuth2 access token for authorization: oauth2 | |
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('xxx'); | |
$api_instance = new SquareConnect\Api\CatalogApi(); | |
$body = new \SquareConnect\Model\UpsertCatalogObjectRequest( | |
array("idempotency_key"=>uniqid(), | |
"object"=>array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Square Register API Web example</title> | |
<style type="text/css"> | |
body { | |
background-color: #DDD; | |
margin: 10px; | |
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$location_id = 'XXXXXXXX'; | |
$item_id = "XXXXXXXXX"; // string | The item's ID. | |
$api_instance = new SquareConnect\Api\V1ItemsApi(); | |
try { | |
$result = $api_instance->retrieveItem($location_id, $item_id); | |
print_r($result); | |
} catch (Exception $e) { | |
echo 'Exception when calling V1ItemsApi->retrieveItem: ', $e->getMessage(), PHP_EOL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$api_instance = new SquareConnect\Api\CatalogApi(); | |
$object_id = "XXXXXX"; | |
$include_related_objects = true; | |
try { | |
$result = $api_instance->retrieveCatalogObject($object_id, $include_related_objects); | |
print_r($result); | |
} catch (Exception $e) { | |
echo 'Exception when calling CatalogApi->retrieveCatalogObject: ', $e->getMessage(), PHP_EOL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Flags that we are using certbot on a different computer than the host. | |
manual | |
# Tells certbot where we want to store the ouput of respective processes | |
config-dir = ./config | |
logs-dir = ./logs | |
work-dir = ./work | |
#Specifies the domains that we want to create certificates for. | |
domains = example.com,www.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "writing file to ../letsencrypt/$CERTBOT_TOKEN.txt" | |
echo $CERTBOT_VALIDATION > ../letsencrypt/${CERTBOT_TOKEN}.txt | |
gcloud app deploy ../app.yaml --project=xxx --quiet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST/v2/locations/LOCATION_ID/orders | |
{ | |
"idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad120", | |
"reference_id": "my-order-001", | |
"line_items": [ | |
{ | |
"catalog_object_id": "7WBTDGGMYEJYU2GINA7HHKO2", | |
"note": "catalog-note", | |
"quantity": "1", | |
"discounts": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load the gem | |
require 'square_connect' | |
# setup authorization with a personal access token | |
SquareConnect.configure do |config| | |
config.access_token = 'sq0atp-XXXXXXXXXXXXX' | |
end | |
#create a new API instance | |
api_instance = SquareConnect::CustomersApi.new |