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
//my cursor is set as a url variable ($_GET['albumoffset']) | |
$albumStore = new \GDS\Store('Tracks'); | |
$obj_store->query("SELECT * FROM Albums"); | |
$obj_store->setCursor(rawurldecode($_GET['albumoffset'])); | |
$entity = $obj_store->fetchPage(1); | |
//do stuff with my new entity | |
//meta refresh the page with the new cursor. |
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
//Get locaiton id | |
<cfset jsonString = serializejson(request.params)> | |
<cfset requestPath = "connect.squareup.com/v2/locations">; | |
<cfhttp url="#requestPath#" method="get" result="response"> | |
<cfhttpparam type="HEADER" name="Accept" value="application/json"> | |
<cfhttpparam type="HEADER" name="Content-Type" value="application/json"> | |
<cfhttpparam type="HEADER" name="Authorization" value="Bearer myid"> | |
<cfhttpparam type="body" name="params" value="#jsonString#"> | |
</cfhttp> | |
<cfset v_result = deserializeJSON(response.FileContent)> |
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 | |
//Use the access token from the session to access the API | |
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken($_SESSION['at']); | |
$customersApi = new SquareConnect\Api\CustomersApi(); | |
try { | |
$result = $customersApi->listCustomers(); ?> | |
<div id="table" style="display:flex;flex-direction:column;"> | |
<div class="row"> | |
<div>Created at</div> |
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
function deleteCustomer(element){ | |
if(!confirm('Are you sure you want to delete this customer?')){ | |
return false; | |
} | |
var location = document.getElementById('location-id').value; | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function() { | |
if (this.readyState == 4 && this.status == 200) { | |
if(this.responseText=='deleted'){ | |
alert('deleted'); |
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 | |
//Start a session with the client | |
session_start(); | |
require('vendor/autoload.php'); | |
//Check for some basic errors. | |
if (!isset($_POST['customerId'])) { | |
echo "No customer id was supplied"; | |
} |
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
"info": { | |
"version": "2.0", | |
"title": "Square Connect API", | |
"description": "Client library for accessing the Square Connect APIs", | |
"termsOfService": "https://connect.squareup.com/tos", | |
"contact": { | |
"name": "Square Developer Platform", | |
"email": "[email protected]", | |
"url": "https://squareup.com/developers" | |
}, |
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
"/v2/locations/{location_id}/transactions/{transaction_id}/refund": { | |
"post": { | |
"tags": [ | |
"Transactions" | |
], | |
"summary": "CreateRefund", | |
"operationId": "CreateRefund", | |
"description": "Initiates a refund for a previously charged tender.\n\nYou must issue a refund within 120 days of the associated payment. See\n(this article)[https://squareup.com/help/us/en/article/5060] for more information\non refund behavior.", | |
"x-oauthpermissions": [ | |
"PAYMENTS_WRITE" |
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
"CreateRefundResponse": { | |
"type": "object", | |
"properties": { | |
"errors": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Error" | |
}, | |
"description": "Any errors that occurred during the request." | |
}, |
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(); | |
$body = array( | |
'idempotency_key'=>uniqid(), | |
'object'=>array( | |
'type'=>'ITEM', | |
'id'=>'#temp-item-id', | |
'item_data'=>array( | |
'name'=>'Brass Tube', | |
'description'=>'Great for models', |
OlderNewer