Download the PHP package philipbrown/merchant without Composer

On this page you can find all versions of the php package philipbrown/merchant. 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 merchant

Merchant (DEPRECATED)

Ecommerce abstraction for dealing with products, orders and sales

Build Status

Merchant is a simple abstraction for working with products, orders and sales within an ecommerce application. It aims to solve the problem of dealing with multiple product orders and the associated data that you will be required to store and use within the lifecycle of a customer.

Installation

Add philipbrown/merchant as a requirement to composer.json:

Update your packages with composer update.

Usage

The primary purpose of Merchant is a way to store and organise the data about each individual product with an order or a sale and then to find the aggregate totals using a simple interface.

Regions

Due to the fragmented situation of the world's financial rules and regulations, Merchant is broken into individual regions. Each region has specific data set as properties that are applicable in that region.

For example, England is represented as:

If you would like to add your region to Merchant:

Money and Currency

Money and Currency in Merchant is abstracted to Money. For full details, usage and documentation please see that repository.

Briefly:

Creating a new Merchant instance

To create a new Merchant instance to work with, simply pass the Region you want to create to the order method:

Adding a product

Adding a product to your order is as simple as specifying a SKU and the value of the product as an integer:

The values for tax (if applicable) as well as the correct Currency instance will automatically be handled for you from the Region you specified when you created the Merchant instance.

The add method also accepts a third optional parameter of either an array or a closure. The third parameter allows you to perform actions on the product such as setting a discount, making this particular product not taxable, a freebie or setting a coupon:

Removing a product

To remove a product simply pass the sku to the remove method:

Updating a product

When you update a product, first the product instance is removed and then replaced with the new data that you pass:

Order totals

As you add, update or remove products from your order Merchant will be automatically calculating the various totals that you will need to record in your database and display on reciepts and invoices. Each total is an instance of Money:

Future developments

Currently Merchant does not deal with any physical attributes of selling online. For example, delivery charges, international shipping etc, etc, etc.

I have no plans to add any of these attributes as I don't have the requirment. If you do and you want to extend Merchant, feel free to open a Pull Request.

License

The MIT License (MIT)

Copyright (c) 2014 Philip Brown

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of merchant with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
philipbrown/money Version 1.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 philipbrown/merchant contains the following files

Loading the files please wait ....