-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from whobutsb/feature/giftcard-adjustments
Gift Card Adjustment Resource
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* @author Tareq Mahmood <[email protected]> | ||
* Created at: 8/21/16 8:39 AM UTC+06:00 | ||
* | ||
* @see https://shopify.dev/docs/api/admin-rest/2023-01/resources/gift-card-adjustment Shopify API Reference for Gift Card Adjustment | ||
* @note - requires gift_card_adjustments access scope enabled by Shopify Support | ||
* | ||
* @usage: | ||
* | ||
$shopify = \PHPShopify\ShopifySDK::config($config); | ||
$gift_card_id = 88888888888; | ||
$gift_card_adjustment_id = 999999999999; | ||
// Get all gift card adjustments | ||
$shopify->GiftCard($gift_card_id)->Adjustment()->get(); | ||
// Get a single gift card adjustment | ||
$shopify->GiftCard($gift_card_id)->Adjustment($gift_card_adjustment_id)->get(); | ||
// Create a gift card adjustment | ||
$shopify->GiftCard($gift_card_id)->Adjustment()->post([ | ||
'amount' => 5, | ||
'note' => 'Add $5 to gift card' | ||
]); | ||
*/ | ||
|
||
namespace PHPShopify; | ||
|
||
|
||
class GiftCardAdjustment extends ShopifyResource | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
protected $resourceKey = 'adjustment'; | ||
} |
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