This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 376
Usage
Tyler King edited this page Aug 23, 2018
·
20 revisions
Here's some helpful tips on using this package's facade.
Using the facade:
// Returns instance of \OhMyBrew\ShopifyApp\Models\Shop
ShopifyApp::shop()
// Returns instance of \OhMyBrew\BasicShopifyAPI (ohmybrew/basic-shopify-api)
$shop = ShopifyApp::shop();
$shop->api()->request(...);
Example:
$shop = ShopifyApp::shop();
$request = $shop->api()->request('GET', '/admin/shop.json');
echo $request->body->shop->name;
For single/recurring/credit type charges, you can access them via the Charge model's retrieve
method for charges which exist in the database for a shop.
Example:
$shop = ShopifyApp::shop();
$charge = $shop->charges()->get()->last();
print_r($charge->retrieve); // Returns an object of the API data for the charge
road map
Welcome to the wiki!
Please see the homepage for a list of relevant pages.