Skip to content

Commit dfeee2b

Browse files
Initial Commit
Initial commit based on code from rjacobso
1 parent a233b8d commit dfeee2b

File tree

5 files changed

+103
-1
lines changed

5 files changed

+103
-1
lines changed

lib/Balance.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace PHPShopify;
4+
5+
/**
6+
* --------------------------------------------------------------------------
7+
* ShopifyPayment -> Child Resources
8+
* --------------------------------------------------------------------------
9+
*
10+
*
11+
*/
12+
class Balance extends ShopifyResource
13+
{
14+
/**
15+
* @inheritDoc
16+
*/
17+
protected $resourceKey = 'balance';
18+
19+
/**
20+
* Get the pluralized version of the resource key
21+
*
22+
* Normally its the same as $resourceKey appended with 's', when it's different, the specific resource class will override this function
23+
*
24+
* @return string
25+
*/
26+
protected function pluralizeKey()
27+
{
28+
return $this->resourceKey;
29+
}
30+
31+
/**
32+
* If the resource is read only. (No POST / PUT / DELETE actions)
33+
*
34+
* @var boolean
35+
*/
36+
public $readOnly = true;
37+
38+
/**
39+
* @inheritDoc
40+
*/
41+
protected $childResource = array(
42+
'Transactions'
43+
);
44+
}

lib/Payouts.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Robert Jacobson <rjacobson@thexroadz.com>
5+
* Created at 11/11/19 12:26 PM UTC-05:00
6+
*
7+
* @see https://help.shopify.com/en/api/reference/shopify_payments/payout Shopify API Reference for Shopify Payment Payouts
8+
*/
9+
10+
namespace PHPShopify;
11+
12+
/**
13+
* --------------------------------------------------------------------------
14+
* ShopifyPayment -> Child Resources
15+
* --------------------------------------------------------------------------
16+
*
17+
*
18+
*/
19+
class Payouts extends ShopifyResource
20+
{
21+
/**
22+
* @inheritDoc
23+
*/
24+
protected $resourceKey = 'payout';
25+
}

lib/ShopifyPayment.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ class ShopifyPayment extends ShopifyResource
2626
*/
2727
public $resourceKey = 'shopify_payment';
2828

29+
/**
30+
* If the resource is read only. (No POST / PUT / DELETE actions)
31+
*
32+
* @var boolean
33+
*/
34+
public $readOnly = true;
35+
2936
/**
3037
* @inheritDoc
3138
*/
3239
protected $childResource = array(
33-
'Dispute'
40+
'Balance',
41+
'Dispute',
42+
'Payouts',
3443
);
3544
}

lib/ShopifySDK.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
* @method ScriptTag ScriptTag(integer $id = null)
147147
* @method ShippingZone ShippingZone(integer $id = null)
148148
* @method Shop Shop(integer $id = null)
149+
* @method ShopifyPayment ShopifyPayment()
149150
* @method SmartCollection SmartCollection(integer $id = null)
150151
* @method Theme Theme(int $id = null)
151152
* @method User User(integer $id = null)
@@ -235,16 +236,20 @@ class ShopifySDK
235236
protected $childResources = array(
236237
'Article' => 'Blog',
237238
'Asset' => 'Theme',
239+
'Balance' => 'ShopifyPayment',
238240
'CustomerAddress' => 'Customer',
241+
'Dispute' => 'ShopifyPayment',
239242
'Fulfillment' => 'Order',
240243
'FulfillmentEvent' => 'Fulfillment',
241244
'OrderRisk' => 'Order',
245+
'Payouts' => 'ShopifyPayment',
242246
'ProductImage' => 'Product',
243247
'ProductVariant' => 'Product',
244248
'DiscountCode' => 'PriceRule',
245249
'Province' => 'Country',
246250
'Refund' => 'Order',
247251
'Transaction' => 'Order',
252+
'Transactions' => 'Balance',
248253
'UsageCharge' => 'RecurringApplicationCharge',
249254
);
250255

lib/Transactions.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace PHPShopify;
4+
5+
6+
class Transactions extends ShopifyResource
7+
{
8+
/**
9+
* @inheritDoc
10+
*/
11+
protected $resourceKey = 'transaction';
12+
13+
/**
14+
* If the resource is read only. (No POST / PUT / DELETE actions)
15+
*
16+
* @var boolean
17+
*/
18+
public $readOnly = true;
19+
}

0 commit comments

Comments
 (0)