Skip to content

Instantly share code, notes, and snippets.

View sparkweb's full-sized avatar

David Hollander sparkweb

View GitHub Profile
@sparkweb
sparkweb / get-multiple-orders.php
Last active September 18, 2021 15:54
Order Desk API: Order Methods
<?php
//Order Desk API: Get Order List
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Setup Query
$args = array(
@sparkweb
sparkweb / gist:c6a5a21ab44a23589b9c
Last active September 18, 2021 15:54
Order Desk PHP Client
<?php
class OrderDeskApiClient
{
private $store_id;
private $api_key;
private $base_url = "https://app.orderdesk.me/api/v2";
public $last_status_code = "";
public function __construct($store_id, $api_key) {
@sparkweb
sparkweb / process-orderdesk-json.php
Last active December 7, 2020 18:17
Sample Code For Processing and Securing Order Desk Post JSON
<?php
//Check For Order
if (!isset($_POST['order'])) {
header(':', true, 400);
die('No Data Found');
}
//Cbeck Store ID
//Be sure to set your store ID. Ask Order Desk support if you aren't sure what it is.
if (!isset($_SERVER['HTTP_X_ORDER_DESK_STORE_ID']) || $_SERVER['HTTP_X_ORDER_DESK_STORE_ID'] != "YOUR-STORE-ID") {
@sparkweb
sparkweb / addorder.php
Created April 3, 2014 20:23
VeraCore SOAP AddOrder
<?php
//Setup Items
$order_items = array();
$order_items[] = array(
"Offer" => array(
"Header" => array(
"ID" => "FC-Money",
),
),
@sparkweb
sparkweb / order.json
Last active May 22, 2019 13:00
Order Desk Order Data Array
{
"id": "26211",
"email": "test@orderdesk.com",
"shipping_method": "FedEx Home Delivery",
"quantity_total": 1,
"weight_total": 1,
"product_total": 10,
"shipping_total": 11.17,
"handling_total": 0.5,
"tax_total": 1.2,
@sparkweb
sparkweb / api-adding-shipment.php
Last active July 24, 2016 18:20
Order Desk API: Adding Shipments
<?php
//Order Desk API: Insert New Shipments
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Build Shipment Here
$new_shipments = array(
@sparkweb
sparkweb / api-returning-inventory-items.php
Last active July 24, 2016 18:20
Order Desk API: Get Inventory Items
<?php
//Order Desk API: Get Inventory Items
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Setup cURL Variables
$url = "https://app.orderdesk.me/api/inventory_items";
@sparkweb
sparkweb / api-deleting-shipment.php
Created January 11, 2015 22:34
Order Desk API: Deleting Shipments
<?php
//Order Desk API: Delete Shipments
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Required: source_id or order_id
//Required: tracking_number or shipment_id
@sparkweb
sparkweb / gist:27fc6c0e5dda1959abb8
Last active August 29, 2015 14:18
FoxyShop Reverse Login - JSONP Version
{% if is_anonymous == 0 %}
{% set timestamp = checkout_date|date_modify("+5 minutes")|date("U") %}
<script type="text/javascript">
jQuery.ajax({
url: 'http://YOURSITE.COM/foxycart-checkout-complete/?fc_auth_token={{ generate_sso_token(timestamp) }}&timestamp={{ timestamp }}&foxycart_customer_id={{ customer_id }}',
dataType: 'jsonp'
});
</script>
{% endif %}
@sparkweb
sparkweb / gist:92012734196537603390
Created April 2, 2015 19:29
FoxyShop Reverse Login - Button Version
{% if is_anonymous == 0 %}
{% set timestamp = checkout_date|date_modify("+5 minutes")|date("U") %}
<script type="text/javascript">
jQuery(".fc-receipt-action--continue a.fc-button").attr("href", "http://YOURSITE.COM/foxycart-checkout-complete/?fc_auth_token={{ generate_sso_token(timestamp) }}&timestamp={{ timestamp }}&foxycart_customer_id={{ customer_id }}");
</script>
{% endif %}