Skip to content

added draftorder basics #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lib/DraftOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Created by PhpStorm.
* @author Thomas Hondema <thomashondema@live.com>
* Created at 8/14/19 18:28 PM UTC+02:00
*
* @see https://help.shopify.com/api/reference/draftorder Shopify API Reference for DraftOrder
*/

namespace PHPShopify;



/**
* --------------------------------------------------------------------------
* DraftOrder -> Custom actions
* --------------------------------------------------------------------------
* @method array send_invoice() Send the invoice for a DraftOrder
* @method array complete() Complete a DraftOrder
*
*/
class DraftOrder extends ShopifyResource
{
/**
* @inheritDoc
*/
protected $resourceKey = 'draft_order';

/**
* @inheritDoc
*/
protected $customPostActions = array(
'send_invoice',
'complete',
);
}
41 changes: 22 additions & 19 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
* @property-read Customer $Customer
* @property-read CustomerSavedSearch $CustomerSavedSearch
* @property-read Discount $Discount
* @property-read DraftOrder $DraftOrder
* @property-read PriceRule $PriceRule
* @property-read Event $Event
* @property-read FulfillmentService $FulfillmentService
Expand Down Expand Up @@ -115,6 +116,7 @@
* @method Customer Customer(integer $id = null)
* @method CustomerSavedSearch CustomerSavedSearch(integer $id = null)
* @method Discount Discount(integer $id = null)
* @method DraftOrder DraftOrder(integer $id = null)
* @method PriceRule PriceRule(integer $id = null)
* @method Event Event(integer $id = null)
* @method FulfillmentService FulfillmentService(integer $id = null)
Expand Down Expand Up @@ -143,25 +145,6 @@
*/
class ShopifySDK
{
/**
* @var float microtime of last api call
*/
public static $microtimeOfLastApiCall;

/**
* @var float Minimum gap in seconds to maintain between 2 api calls
*/
public static $timeAllowedForEachApiCall = .5;

/**
* Shop / API configurations
*
* @var array
*/
public static $config = array(
'ApiVersion' => '2019-04'
);

/**
* List of available resources which can be called from this client
*
Expand All @@ -180,6 +163,7 @@ class ShopifySDK
'Customer',
'CustomerSavedSearch',
'Discount',
'DraftOrder',
'Event',
'FulfillmentService',
'GiftCard',
Expand Down Expand Up @@ -208,6 +192,25 @@ class ShopifySDK
'GraphQL'
);

/**
* @var float microtime of last api call
*/
public static $microtimeOfLastApiCall;

/**
* @var float Minimum gap in seconds to maintain between 2 api calls
*/
public static $timeAllowedForEachApiCall = .5;

/**
* Shop / API configurations
*
* @var array
*/
public static $config = array(
'ApiVersion' => '2019-04'
);

/**
* List of resources which are only available through a parent resource
*
Expand Down