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" => "" ,
- with [ visa - master - mada ]
use maree\urway\Urway;
$customerInfo = ['email' => '[email protected]'];
Urway::checkout($amount = 1.0 , $customerInfo);
- with [ stc ]
use maree\urway\Urway;
$customerInfo = ['email' => '[email protected]'];
Urway::checkoutStc($amount = 1.0 , $customerInfo);
- define (callback) the checkout return response url route with urway team 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
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
- visa
- master
- mada
- stc