2017 © Pedro Peláez
 

library mobilpay

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

image

andrei930/mobilpay

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  • Thursday, June 28, 2018
  • by andrei930
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Mobilpay

Laravel 5 (5.6 supported) mobilpay wrapper around omnipay with omnipay-mobilpay driver, (*1)

Table of Contents

Installation

Composer

Add to your composer.json file., (*2)

{
    "require": {
        "andrei930/mobilpay": "^1.1.0"
    }
}

Run composer update to get the latest version of the package., (*3)

Laravel

Mobilpay comes with a service provider for Laravel. You'll need to add it to your composer.json as mentioned in the above steps, then register the service provider with your application., (*4)

Open config/app.php and find the providers key. Add MobilpayServiceProvider to the array., (*5)

...
Adrianbarbos\Mobilpay\MobilpayServiceProvider::class,
...

Add the required aliases to the list of class aliases in the same file., (*6)

...
'Omnipay' => Omnipay\Omnipay::class,
'Mobilpay'  => Adrianbarbos\Mobilpay\Mobilpay::class,
...

Publish config., (*7)

php artisan vendor:publish --provider="Adrianbarbos\Mobilpay\MobilpayServiceProvider"

Basic Usage

Initiating Payment Request

// controller function

Mobilpay::setOrderId(1)
        ->setAmount('10.00')
        ->setDetails('Some details')
        ->purchase();

Handle Reponse

// controller function

$response = Mobilpay::response();

$data = $response->getData(); //array

switch($response->getMessage())
{
    case 'confirmed_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "pending"

        break;
    case 'paid_pending': // transaction is pending review. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "pending"

        break;
    case 'paid': // transaction is pending authorization. After this is done, a new IPN request will be sent with either confirmation or cancellation

        //update DB, SET status = "open/preauthorized"

        break;
    case 'confirmed': // transaction is finalized, the money have been captured from the customer's account

        //update DB, SET status = "confirmed/captured"

        break;
    case 'canceled': // transaction is canceled

        //update DB, SET status = "canceled"

        break;
    case 'credit': // transaction has been refunded

        //update DB, SET status = "refunded"

        break;
}                   

Options

Order id

/**
 * @param $value string
 * @return $this
 */

public function setOrderId($value)

Amount

/**
 * @param $value string
 * @return $this
 */

public function setAmount($value)

Currency

/**
 * @param $value string
 * @return $this
 */

public function setCurrency($value)

Details

/**
 * @param $value string
 * @return $this
 */

public function setDetails($value)

Confirm Url

/**
 * @param $value string
 * @return $this
 */

public function setConfirmUrl($value)

Return Url

/**
 * @param $value string
 * @return $this
 */

public function setReturnUrl($value)

Test Mode

/**
 * @param $value boolean
 * @return $this
 */

public function setTestMode($value)

Additional Params

/**
 * @param $value array
 * @return $this
 */

public function setAdditionalParams($value)

The Versions

28/06 2018

dev-master

9999999-dev

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

28/06 2018

1.1.1

1.1.1.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

27/06 2018

1.0.10

1.0.10.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

27/06 2018

1.1.0

1.1.0.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

27/06 2018

1.0.9

1.0.9.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

27/06 2018

1.0.8

1.0.8.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

23/11 2017

1.0.7

1.0.7.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

14/05 2017

1.0.6

1.0.6.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.5

1.0.5.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.4

1.0.4.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.3

1.0.3.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.2

1.0.2.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.1

1.0.1.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos

06/04 2017

1.0.0

1.0.0.0

Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver

  Sources   Download

MIT

The Requires

 

by Avatar adrianbarbos