Download the PHP package bnmetrics/laravel-shopify-api without Composer

On this page you can find all versions of the php package bnmetrics/laravel-shopify-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-shopify-api

Laravel Shopify API Wrapper

Build Status Latest Stable Version

This Package provides a easy way for you to building Shopify Apps with Laravel 5. The OAuth authentication is extended upon Laravel's Socialite.

This package supports both public and private apps, including billing.

Installation

You can install this package via composer with:

Or add to your Laravel project composer.json file:

To publish the shopify.php configuration file to app/config run:

Configuration

Set shopify environment variables your .env file:

Register the service provider in your app/config/app.php:

Also add the Shopify facade in your aliases array in app/config/app.php:

Basic Usage

Now, you are ready to make a shopify app! here is an example of how it might be used in a controller to retrieve information from a shop via GET request to the API endpoint:

Alternatively, if you already have a token to a specific shopify domain. You can retrieve the API response by using the retrieve() method like so:

Next you will need to make two routes:

CRUD requests to the API endpoints

As of version 1.0.3, GET, PUT, POST, DELETE requests are supported for this package. To make requests, simply call the respective methods following the URL structure of of each endpoints, adding suffix such as "All", "Count", "ById".

API endpoints are referred to as "tiers", for example,

Below is an example of how to make requests to endpoints:

Config file

More endpoints can also be added to shopify.php config file $endpoints array following the same pattern.

Billing

As of version 1.0.2, billing support has been added to this package. It supports all three of the billing options shopify provides: RecurringCharge, ApplicationCharge and UsageCharge.

If you are to use Billing for your Shopify app, Add the following onto your config/app.php file:

Register the service provider in your app/config/app.php:

Also add the ShopifyBilling facade in your aliases array in app/config/app.php:

Billing Usage

As all shopify charges will need to be activated after creation, we will add a route called activate:

For our previous example controller, you can change the getResponse method like so:

create() method accepts an validated Shopify object or a User Object, and the options for the charge. Refer to the Property section for different options you can pass in:

RecurringBilling, ApplicationCharge, UsageCharge,

Then we would need to add the activate method():

activate method handles all "status", not only 'accepted', but also when user declines the charge;

Usage Charge

For usage charges, as it is based uppon an existing recurring charge, an activated recurring charge instance must be passed before creating a usage charge.

The recurring charge also require to have 'capped_amount' and 'terms'.

We can modify our activate() method in our controller like so:


All versions of laravel-shopify-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/support Version ~5.4
guzzlehttp/guzzle Version ~6.0
laravel/socialite Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bnmetrics/laravel-shopify-api contains the following files

Loading the files please wait ....