maree / urway
package to pay with urway payment services
dev-main
2023-09-14 20:27 UTC
This package is auto-updated.
Last update: 2025-04-14 23:35:41 UTC
README
Installation
You can install the package via Composer.
composer require maree/urway
Publish your urway config file with
php artisan vendor:publish --provider="maree\urway\UrwayServiceProvider" --tag="urway"
then change your urway config from config/urway.php file
"merchantKey" => "" , "name" => "" , "password" => "" ,
Usage
- with [ visa - master - mada ]
use maree\urway\Urway; $customerInfo = ['email' => 'customer@site.com']; Urway::checkout($amount = 1.0 , $customerInfo);
- with [ stc ]
use maree\urway\Urway; //$params= ['email' => 'customer@site.com','response_url' => route('your_callback_function')] Urway::checkoutStc($amount = 1.0 , $params);
note
- define (callback) the checkout return response url route with request $params[response_url] EX: https://mysite.com/paymentresponse
- create route for response url 'paymentresponse' EX: Route::get('paymentresponse', 'PaymentsController@paymentresponse')->name('paymentresponse');
- create function for checkout response 'paymentresponse'
- use that function to check if payment failed or success
inside 'paymentresponse' function use:
use maree\urway\Urway; $response = Urway::checkoutResponseStatus();
return response like:
['key' => 'success' ,'msg' => 'checkout success' ,'result' => $result ,'data' => $_GET ]
or
['key' => 'fail' , 'msg' => 'checkout failed','result' => $result ,'data' => $_GET ]
note: you can use response from data to save transactions in database - 'data' key contain params like 'amount' and 'TranId' => transaction id
- Test Card Details
- Card Number: Master:5123450000000008 - Visa: 4508 7500 1574 1019
- CVV: 100
- Expiry Date: 05/23
- Card Name: Test Family
- Custom ECI: Leave Blank
- Custom CAVV: Leave Blank
for code errors open urway documentaion file.
current urway package payment ways :
- visa
- master
- mada
- stc