loovpayment / laravel-sdk
loov payment solution
Requires
- php: ^8.1
- ext-curl: *
- guzzlehttp/guzzle: ^7.2
- laravel/framework: ^10.10
- laravel/sanctum: ^3.2
- laravel/tinker: ^2.8
This package is auto-updated.
Last update: 2024-09-17 10:59:44 UTC
README
Introduction
Loov Solutions is an online payment tool.
Installation
Run this in your terminal to install loov from comand line
composer require loovpayment/laravel-sdk
Requirements
- amount: The payment amount in the specified currency.
- currency: The currency code of the payment amount.
- description: Description of the payment purpose.
- username: Customer name.
- email: Customer email.
- operator: The mobile operator code used for the payment (e.g., "orange-money-cm")
- phoneNumber: Customer phone number.
- return_url: URL to redirect after successful payment.
- cancel_url: URL to redirect if payment is canceled.
- callback_url: URL for payment notifications (webhook).
- payment_mode: The chosen payment mode. value: ALL, CARD, MOBILE_MONEY.
Pay In
<?php namespace App\Htpp\Controllers; use Loovpayment\LaravelSdk\LoovPay; class payment extends Controller{ public function payment(){ $data =[ 'amount' =>50000, 'currency' => 'XAF', 'payment_mode' => 'CARD', "return_url" => "https://google.com?state=return_url", "cancel_url" => "https://google.com?state=cancel", "callback_url" => "https://webhook.site/9c647add-6b43-4832-bd5d-db529c7c9b79", "description" => "test payment de service en ligne", "name" => "Arolle Fona", "email" =>"arolle000@gmail.com", "phoneNumber" => "237699009999" ]; $response = (new LoovPay())->setKeys(AppKey MerchantKey)->payIn($data); return $response; } }
Success Response
Upon successful payment initiation, the API will respond with a status code of 200 along with the following response body:
{ "status": 200, "message": "Payment initiated", "payment_url": "https://api.secure.payment.loov-solutions.com/payinit/oa7DZzEd8gwJ5PYQ", "reference": "LOC8SXoZuDVEvu1ODxs" }
Mobile SoftPay
<?php namespace App\Htpp\Controllers; use Loovpayment\LaravelSdk\LoovPay; class payment extends Controller{ public function payment(){ $data =[ 'amount' =>50000, 'operator' => 'XAF', "callback_url" => "https://webhook.site/9c647add-6b43-4832-bd5d-db529c7c9b79", "name" => "Arolle Fona", "email" =>"arolle000@gmail.com", "phoneNumber" => "237699009999" ]; $response = (new LoovPay())->setKeys(AppKey MerchantKey)->mobileSoftPay($data); return $response; } }
Success Response
Upon successfully initiating the mobile payment, the API will respond with a JSON object containing payment information.
{ "error": false, "status": "success", "amount": "500", "fees": 10, "message": "Confirm the payment by entering your PIN code and you will receive an SMS. Thank you for using Orange Money services.", "reference": "LOMoac3hqZXuBHUHKy8" }
Supported Operators
Pay Out
<?php namespace App\Htpp\Controllers; use Loovpayment\LaravelSdk\LoovPay; class payment extends Controller{ public function payment(){ $data =[ 'amount' =>50000, "operator": "orange-money-cm", 'phoneNumber' => '237699009999', "currency" => "XAF" ]; $response = (new LoovPay())->setKeys(AppKey MerchantKey)->payOut($data); return $response; } }
Success Response
Upon successfully initiating the mobile payment, the API will respond with a JSON object containing payment information.
{ "error": false, "status": "success", "amount": "50000", "reference": "MOMAVzvTY7DLyiRCR38", "message": "Transfer of 500 XAF transferred to 237699009999" }
Check Status
<?php namespace App\Htpp\Controllers;L use Loovpayment\LaravelSdk\LoovPay; class payment extends Controller{ public function payment(){ $response = (new LoovPay())->setKeys(AppKey MerchantKey)->checkStatus($reference); return $response; } }
Success Response
Upon successfully retrieving the payment status, the API will respond with a JSON object containing the payment status information.
{ "error": false, "reference": "MOMAVzvTY7DLyiRCR38", "amount": "500", "currency": "XAF", "status": "initiated", "date": "2023-08-08 09:08:17", "customer": null }
Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Arolle Fona via fona.arolle@mounir-holding.com. All security vulnerabilities will be promptly addressed.
License
The Laravel framework is open-sourced software licensed under the MIT license.