| Package Data | |
|---|---|
| Maintainer Username: | adrianbarbos |
| Maintainer Contact: | ady.barbos@gmail.com (adrianbarbos) |
| Package Create Date: | 2017-04-06 |
| Package Last Update: | 2024-08-06 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-06 15:07:40 |
| Package Statistics | |
|---|---|
| Total Downloads: | 6,317 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 19 |
| Total Watchers: | 6 |
| Total Forks: | 22 |
| Total Open Issues: | 5 |
Laravel 5 mobilpay wrapper around omnipay with omnipay-mobilpay driver Edit Add topics
Add Laravel Localization to your composer.json file.
{
"require": {
"omnipay/common": "~2.0",
"business-mastery/omnipay-mobilpay": "~1.0",
"adrianbarbos/mobilpay": "~1.0.0"
}
}
Run composer update to get the latest version of the package.
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.
Open config/app.php and find the providers key. Add MobilpayServiceProvider to the array.
...
Adrianbarbos\Mobilpay\MobilpayServiceProvider::class,
...
Add the required aliases to the list of class aliases in the same file.
...
'Omnipay' => Omnipay\Omnipay::class,
'Mobilpay' => Adrianbarbos\Mobilpay\Mobilpay::class,
...
Publish config.
php artisan vendor:publish --provider="Adrianbarbos\Mobilpay\MobilpayServiceProvider"
// controller function
Mobilpay::setOrderId(1)
->setAmount('10.00')
->setDetails('Some details')
->purchase();
// 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;
}
/**
* @param $value string
* @return $this
*/
public function setOrderId($value)
/**
* @param $value string
* @return $this
*/
public function setAmount($value)
/**
* @param $value string
* @return $this
*/
public function setCurrency($value)
/**
* @param $value string
* @return $this
*/
public function setDetails($value)
/**
* @param $value string
* @return $this
*/
public function setConfirmUrl($value)
/**
* @param $value string
* @return $this
*/
public function setReturnUrl($value)
/**
* @param $value boolean
* @return $this
*/
public function setTestMode($value)
/**
* @param $value array
* @return $this
*/
public function setAdditionalParams($value)