Skip to content

Added ShopifyPayment Dispute resource #162

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
Jun 2, 2020
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ Some resources are available directly, some resources are only available through
- [Shop](https://help.shopify.com/api/reference/shop) _(read only)_
- [SmartCollection](https://help.shopify.com/api/reference/smartcollection)
- SmartCollection -> [Event](https://help.shopify.com/api/reference/event/)
- [ShopifyPayment](https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/)
- ShopifyPayment -> [Dispute](https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/dispute/) _(read only)_
- [Theme](https://help.shopify.com/api/reference/theme)
- Theme -> [Asset](https://help.shopify.com/api/reference/asset/)
- [User](https://help.shopify.com/api/reference/user) _(read only, Shopify Plus Only)_
Expand Down
30 changes: 30 additions & 0 deletions lib/Dispute.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Created by PhpStorm.
* @author Victor Kislichenko <v.kislichenko@gmail.com>
* Created at 01/06/2020 16:45 AM UTC+03:00
*
* @see https://shopify.dev/docs/admin-api/rest/reference/shopify_payments/dispute Shopify API Reference for Dispute
*/

namespace PHPShopify;


/**
* --------------------------------------------------------------------------
* ShopifyPayment -> Child Resources
* --------------------------------------------------------------------------
* @property-read ShopifyResource $DiscountCode
*
* @method ShopifyResource DiscountCode(integer $id = null)
*
*/
class Dispute extends ShopifyResource
{
/**
* @inheritDoc
*/
public $resourceKey = 'dispute';


}
35 changes: 35 additions & 0 deletions lib/ShopifyPayment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* Created by PhpStorm.
* @author Victor Kislichenko <v.kislichenko@gmail.com>
* Created at 01/06/2020 16:45 AM UTC+03:00
*
* @see https://shopify.dev/docs/admin-api/rest/reference/shopify_payments Shopify API Reference for ShopifyPayment
*/

namespace PHPShopify;


/**
* --------------------------------------------------------------------------
* ShopifyPayment -> Child Resources
* --------------------------------------------------------------------------
* @property-read ShopifyResource $Dispute
*
* @method ShopifyResource Dispute(integer $id = null)
*
*/
class ShopifyPayment extends ShopifyResource
{
/**
* @inheritDoc
*/
public $resourceKey = 'shopify_payment';

/**
* @inheritDoc
*/
protected $childResource = array(
'Dispute'
);
}
2 changes: 1 addition & 1 deletion lib/ShopifyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public function processResponse($responseArray, $dataKey = null)
$httpCode = CurlRequest::$lastHttpCode;

if ($httpCode != null && $httpCode != $httpOK && $httpCode != $httpCreated && $httpCode != $httpDeleted) {
throw new Exception\CurlException("Request failed with HTTP Code $httpCode.");
throw new Exception\CurlException("Request failed with HTTP Code $httpCode.", $httpCode);
}
}

Expand Down
2 changes: 2 additions & 0 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
* @property-read ShippingZone $ShippingZone
* @property-read Shop $Shop
* @property-read SmartCollection $SmartCollection
* @property-read ShopifyPayment $ShopifyPayment
* @property-read Theme $Theme
* @property-read User $User
* @property-read Webhook $Webhook
Expand Down Expand Up @@ -196,6 +197,7 @@ class ShopifySDK
'ShippingZone',
'Shop',
'SmartCollection',
'ShopifyPayment',
'Theme',
'User',
'Webhook',
Expand Down