Download the PHP package simplon/payment without Composer

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

     _                 _             
 ___(_)_ __ ___  _ __ | | ___  _ __  
/ __| | '_ ` _ \| '_ \| |/ _ \| '_ \ 
\__ \ | | | | | | |_) | | (_) | | | |
|___/_|_| |_| |_| .__/|_|\___/|_| |_|
                |_|                  
                                        _   
 _ __   __ _ _   _ _ __ ___   ___ _ __ | |_ 
| '_ \ / _` | | | | '_ ` _ \ / _ \ '_ \| __|
| |_) | (_| | |_| | | | | | |  __/ | | | |_ 
| .__/ \__,_|\__, |_| |_| |_|\___|_| |_|\__|
|_|          |___/                          

Simplon Payment

Version 0.5.8

Intro

Simplon Payment was built to host conform libraries for different payment service provider. At the moment of writing this module consist of two libraries: and . Both libraries were created by applying the Builder Pattern.

Make sure to create test accounts for both libraries. Setting up test accounts for PayPal is really easy.

Skrill is a bit more challenging. The setup for real- and test-accounts is the same. However, in order to activate an account as test-account you need to send an inquiry via email to the support. Include your account number. This takes some time. The easiest and fastest way though would be to contact your Skrill key account manager to handle the setup - provided that you have a key account manager.

Install

You can install Simplon/Payment either via package download from github or via Composer install. I encourage you to do the latter:

Note

This documentation is work in progress. Therefore, in case of any questions have a look in to the code or drop me a message.

PayPal

PayPal's checkout flow consists of three steps:

Requirements

PayPal demands for a set of authentication credentials which have to be registered with PayPal's Merchant Service. Upon successful registration the following credentials will be available:

Request checkout token

PayPal requires always authentication which is handled by our class:

Before we can send our request we need a product. This will be created by our class. As you will see we can create more than just one product. All product items will be store in a simple array:

Ok, lets finish this and request the :

We don't get really far with the token alone. We actually need PayPal's store URL:

Alright, this prints an anchor on our page which takes us to PayPal's store where we can enter our data.

Request checkout details

Our next step takes action as soon as the user entered all at PayPal's end. When everything went fine PayPal will call our prior defined with a GET parameter . The script which is behind our should do the following to fetch the :

The holds now all essential data from our call. Have a look at the class to see what else is available. The VO can be extended if necessary.

Request checkout payment

That's the last step in order to finalise the checkout. To run this last request we need three values from our just filled VO :

The order amount and the currency code have to match the values from our initial checkout request. Ok, lets assume we are still in the exact script as for our last example. Now, lets get some money:

If no exception occurs the checkout went through and we received some money. All what is left to conclude a PayPal checkout is to save the response data to a DB so that we have a persistent access.

Sandbox mode

Note that in sandbox mode the only currency accepted is . If you checkout by using another one PayPal will throw exceptions and you will never be able to finalise your test bookings.

Skrill

Skrill's checkout flow has two steps:

Requirements

Skrill requires an active merchant account which will be referenced by the merchant's email address. Also, you need to make sure that all payment methods are activated for your account. Credit cards require a special audit by Skrill.

In order to fetch all final checkout data we need to use Skrill's . For that we need a password which needs to be defined at your merchant account.

Request checkout token

When it comes to authentication Skrill only demands the merchant's email address. As for PayPal we also define our product via the class and cache it to an array:

Before we can request the checkout token we need to define which payment options we would like to offer to our customers. Since Skrill comes with quite some payment options, which differ by country, we need to find a way to easily define them. Well, lets use our again:

Ok, what happened here? First, we create an instance which has all possible payment options for . Then we enable the options , and .

Alright, now that we have all what is needed lets get the respectively the :

As we can see there are a couple of blanks we need to fill in:

If all went fine we should receive a . Redirecting to this url shows Skrill's form page with all required fields.

Upon successful data entry and all confirmations on Skrill's page the user will be redirected to .

Request checkout payment data

If we defined a Skrill will send us all booking data via . From there on its up to us on how to process these data.

Another way would be to set a or via . Skrill will send us all data either to the given or regardless of a transactions success. If you need another callback you can use . Same rules apply as for the prior method.

However, there is yet another alternative which allows us to fetch booking data at any time. For that we have to use the aforementioned in combination with our , and a .

Important note: The is the ID we passed to Skrill. In our example above it would be .

With that example we have finished the checkout cycle for Skrill payments.

Changelog

0.5.5

0.5.4


All versions of payment with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
fightbulc/php_curl Version 1.0.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 simplon/payment contains the following files

Loading the files please wait ....