2017 © Pedro Peláez
 

library yii-paymentmanager

Payment manager for the Yii PHP framework.

image

nordsoftware/yii-paymentmanager

Payment manager for the Yii PHP framework.

  • Friday, October 17, 2014
  • by crisu83
  • Repository
  • 19 Watchers
  • 10 Stars
  • 90 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 25 Versions
  • 0 % Grown

The README.md

yii-paymentmanager

Payment manager for the Yii PHP framework., (*1)

The goal behind the payment manager is to provide an easy-to-use API for making payments through any payment gateway in Yii applications. It includes a bunch of models that holds unified data for payments that can be used to implement any payment gateway necessary. It leaves a lot of room for implementing the actual payment gateway, because every payment gateways works a bit differently., (*2)

Usage

Installation and configuration

The easiest way to install payment manager is to use Composer. Add the following to your composer.json file:, (*3)

.....
"require": {
    "nordsoftware/yii-paymentmanager": "1.0.*"
}
````

Run the following command to download the extension:

```bash
php composer.phar update

Add the following to your application configuration:, (*4)

.....
'components' => array(
    .....
    'payment' => array(
        'class' => 'PaymentManager',
        'contexts' => array(
            'context1' => array(
                'successUrl' => array('/context1/done'),
                'failureUrl' => array('/context1/failure'),
            ),
        ),
        'gateways' => array(
            .....
        ),
    ),
),
.....

Please note that the payment manager does not include any actual payment gateway implementations. For an example implementation see our Paytrail implementation at: http://github.com/nordsoftware/yii-paytrail, (*5)

If you are not using composer's autoload, then you need to add the following imports to your application configuration:, (*6)

.....
'import' => array(
    .....
    'webroot.vendor.nordsoftware.yii-paymentmanager.components.*',
    'webroot.vendor.nordsoftware.yii-paymentmanager.models.*',
    'webroot.vendor.nordsoftware.yii-paymentmanager.migrations.*',
    'webroot.vendor.nordsoftware.yii-audit.behaviors.*',
    'webroot.vendor.nordsoftware.yii-audit.models.*',
    'webroot.vendor.crisu83.yii-arbehaviors.behaviors.*',
    .....
),
.....

Please note that you need to change "webroot" to match your own configuration., (*7)

Create a transaction

With the payment manager it is easy to create a unified transaction and pay it using the payment gateway of your choice. Below you can find a simple example on how to create a transaction and process it using the payment manager., (*8)

$transaction = PaymentTransaction::create(
    array(
        'context' => 'context1', // the context name from the configuration
        'gateway' => 'paytrail', // requires the yii-paytrail extension
        'orderIdentifier' => 1, // order id or similar
        'description' => 'Test payment',
        'price' => 100.00,
        'currency' => 'EUR',
    )
);

$transaction->addShippingContact(
    array(
        'firstName' => 'Foo',
        'lastName' => 'Bar',
        'email' => 'foo@bar.com',
        'phoneNumber' => '1234567890',
        'mobileNumber' => '0400123123',
        'companyName' => 'Test company',
        'streetAddress' => 'Test street 1',
        'postalCode' => '12345',
        'postOffice' => 'Helsinki',
        'countryCode' => 'FIN',
    )
);

$transaction->addItem(
    array(
        'description' => 'Test product',
        'code' => '01234',
        'quantity' => 5,
        'price' => 19.90,
        'vat' => 23.00,
        'discount' => 10.00,
    )
);

$transaction->addItem(
    array(
        'description' => 'Another test product',
        'code' => '43210',
        'quantity' => 1,
        'price' => 49.90,
        'vat' => 23.00,
        'discount' => 50.00,
    )
);

Yii::app()->payment->process($transaction);

The Versions

17/10 2014

dev-master

9999999-dev

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

17/10 2014

dev-develop

dev-develop

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

17/10 2014

1.0.3

1.0.3.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

09/04 2014

1.0.2

1.0.2.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

09/04 2014

1.0.1

1.0.1.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

05/03 2014

1.0.0

1.0.0.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

18/02 2014

0.2.2

0.2.2.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

10/02 2014

0.2.1

0.2.1.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

10/02 2014

0.2.0

0.2.0.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

10/02 2014

dev-feature/refactor-transaction

dev-feature/refactor-transaction

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

05/02 2014

0.1.14

0.1.14.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

04/02 2014

0.1.13

0.1.13.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

03/02 2014

0.1.12

0.1.12.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.11

0.1.11.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.10

0.1.10.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.9

0.1.9.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.7

0.1.7.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.8

0.1.8.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.6

0.1.6.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.5

0.1.5.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.4

0.1.4.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.3

0.1.3.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.2

0.1.2.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

02/02 2014

0.1.1

0.1.1.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires

 

01/02 2014

0.1.0

0.1.0.0

Payment manager for the Yii PHP framework.

  Sources   Download

BSD-3-Clause

The Requires