Download the PHP package 9orky/espago-api-php without Composer

On this page you can find all versions of the php package 9orky/espago-api-php. 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 espago-api-php

Espago API (PHP) Build Status

Unofficial client of the Espago API written in PHP7.

Installation

To install via Composer just type in your console:

and you're done!

Usage

To avoid one huge file with all API methods, client was split into smaller functional pieces. The facade APIs are behind is at: Gorky\Espago\Factory\ApiFactory

Bootstrap

All you need to do is to instantiate an API Factory with:

How does this look in a code?

Conducting a simplest transaction

Ok, now with our Api Factory handy we can proceed to make our first transaction. What we needed is to ask a Customer for his card details and charge him.

Obtaining a Token

First step to our simple transaction is to generate a special Token which will be a Card's representation in Espago.

Token's model is a Response object so, together with others, it resides at: Gorky\Espago\Model directory. Explore the area to be familiar with what system can handle.

Making a Charge

We have a Token so now it's time to charge a Customer. To do this we have to call Charges API and provide some payment details.

Yes, it was actually that easy :-)

Remembering the Card in Espago

At this moment payment transaction is executed and Customer is charged. But wait, he just forgot to buy his wife some flowers for their anniversary. Oh no, he must type all these numbers and letters once again! But no worries though, we can actually save Customer's Card in Espago for us to use it when needed.

To match Card with a Customer we need to create a Client. We have do this with a little help of our friend Token.

All you have to do now is to persist a Client's ID and from now on you can charge Customer on demand. It's very convenient when your Customers are returning ones.

Fancy

There is a simple Console Application to play with using your sandbox account! :-) To make it usable we have to make some preparations.

Making credentials file

In a main directory create PHP file called: credentials.php:

Time to play

Create new Client:

Charge Client:

or

Capture Authorization hold:

Refund Charge:

Cancel Charge:

Note: Remember that you can always use --interactive switch which is more convenient:

API documentation is right here: https://developers.espago.com/en/v3#201-preliminary-assumptions


All versions of espago-api-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
guzzlehttp/guzzle Version ~6.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 9orky/espago-api-php contains the following files

Loading the files please wait ....