PHPackages                             payway/payway - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. payway/payway

ActiveLibrary

payway/payway
=============

This will allow you to integrate payway in your laravel based shopping cart application.

v1.0.9(7y ago)32223[3 issues](https://github.com/shah-shreya/payway-test-package/issues)MITPHP

Since Jan 16Pushed 7y agoCompare

[ Source](https://github.com/shah-shreya/payway-test-package)[ Packagist](https://packagist.org/packages/payway/payway)[ RSS](/packages/payway-payway/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)DependenciesVersions (11)Used By (0)

### **Prerequisite:-**

[](#prerequisite-)

Laravel setup is required to use this plugin.

### **Laravel Payway (Payment Gateway) Installation steps:-**

[](#laravel-payway-payment-gateway-installation-steps-)

**1.** For Laravel payway integration, first install the payway package in your application using the composer command. Once package get installed, vendor publish command is required to make the package work. Open your command prompt and paste the following command under project directory.

**Composer Command :- composer require payway/payway**

**Vendor publish command :- php artisan vendor:publish --provider="payway\\payway\\PaywayServiceProvider"**

**2. Create Payway Account:-**

Create a Payway developer mode and create a sandbox account to get important credentials like api\_key, api\_url and merchant\_id for integration with your Laravel app.

**URL for reference :- **

**3. Provide following details into .env file:-**

After creating your payway account, you will get api\_key, api\_url , merchant\_id and url for js &amp; css. Copy these credentials and paste them in your .env file.

**PAYWAY\_API\_KEY=**

**PAYWAY\_API\_URL=**

**PAYWAY\_MERCHANT\_ID=**

**PAYWAY\_JS\_URL=**

**PAYWAY\_CSS\_URL=**

**4. Payway Form View:-**

-For view Go to laravelproject\\resources\\views\\vendor\\payway, you will get **paywithpayway.blade.php**

-Edit the file according to your requirement, just take care about the must have things for payway to work. Following is the list of must have things :-

- Jquery is required to be added.
- Following are the parameters which must be passed in hidden fields.

    1. tran\_id (string)
    2. amount (decimal)
    3. hash (string)
- Checkout button is required to be added for checkout proccess. By clicking on it , popup for payway checkout will be shown to process payment.
- Scripts for adding Payway Js and Css are required to be added.
- Js for opening checkout popup on click of checkout button is required to be added.
- Payway accept amount in USD, so if you are using any other currency then amount must be converted in USD before passing it in payway.

---

```

            @if(isset($payment['items']))

            @endif

                @if(isset($payment['items_arr']) and !empty($payment['items_arr']))

                Item
                Quantity
                Price

                @foreach($payment['items_arr'] as $item)

                {{$item['name']}}
                {{$item['quantity']}}
                {{$item['price']}}

                @endforeach

                @endif
                TOTAL: {{$payment['amount']}} USD

    $(document).ready(function () {
            $('#payway_checkout_button').click(function () {
                    AbaPayway.checkout();
            });
    });

```

---

**5. Payway Payment Controller:-**

-For controller, Go to laravelproject\\app\\Http\\Controllers\\payway\\ , here you will get **PaywayController.php.**

-Perform your logic related to getting payment information and status.

---

```
 namespace App\Http\Controllers\payway;

 use App\Http\Controllers\Controller;

 use Illuminate\Http\Request;

 use payway\payway\PaywayHelper;

 class PaywayController extends Controller {

    public function payway(Request $request){
     //Create object to use payway helper methods
     $payway_helper = new PaywayHelper();

     /* Perform your logic to get your Product/item related data over here.
      final product/item array should be in below format
      Example: item[x][name], item[x][quantity], item[x][price]
      x is the item number, starting with 0 and increasing by one for each item that is added.  */
      $items = array();
      $items[0]['name'] = 'Item1';
      $items[0]['quantity'] = 2;
      $items[0]['price'] = 10;
      $items[1]['name'] = 'Item2';
      $items[1]['quantity'] = 4;
      $items[1]['price'] = 5;
      //Product/item array End
      //Logic to calculate amaount based on item price and quantity
      $total_amount = 0.00;
      if(isset($items) && !empty($items)){
         foreach($items as $item)
         {
             $total_amount += $item['quantity']*$item['price'];
         }
     }
     //Amount logic End

     // Pass your Product,Payment and user related data like items,amount and user information from your system.
     $payment = array();
     // tran_id (string)(required) – unique tran_id < 20 characters , you can pass it according to your requirement.
     $payment['transactionId'] = $payway_helper->getUniqueTranId();
     // amount (decimal)(required) – total amount of items (valid format: 0.00)
     // amount currancy will be USD. So, if you are using any other currency, convert it into USD before passing it to payway.
     $payment['amount'] = number_format($total_amount,2);
     // firstname – (optional)
     $payment['firstName'] = 'ABC';
     // lastname – (optional)
     $payment['lastName'] = 'XYZ';
     // phone – (optional)
     $payment['phone'] = '1234567890';
     // email – (optional)
     $payment['email'] = 'your.email@test.com';
     // items – (optional)  base64_encode(json_encode(array item))
     $payment['items'] =  base64_encode(json_encode($items));
     // pass items array
     $payment['items_arr'] = $items;
     // hash (string) (required) – This will be auto-generated. (encrypt "merchant_id+tran_id+amount+items(optional) key" with hash_hmac sha512 after that convert the output using Base64. merchant_id and key - ABA Bank will be provided when client sign contract.)
     $payment['hashedTransactionId'] = $payway_helper->getHash($payment['transactionId'], $payment['amount'],$items);
     // get the api URL specified in .env file
     $payment['api_url'] = $payway_helper->getApiUrl();
     // get the merchant ID specified in .env file
     $payment['merchant_id'] = $payway_helper->getMerchantId();
     // get the api Key specified in .env file
     $payment['api_key'] = $payway_helper->getApiKey();

     return view('payway::paywithpayway',compact('payment'));
    }

    public function getPaywayStatus(Request $request){
  	//payway will return json string like - {"tran_id":"TRAN_ID_TEST123","status":0} to call back url.
   	$payway_response = $request->response;

	if(isset($payway_response)){
	   $payway_response_array = json_decode($payway_response, true);
		if(isset($payway_response_array['status']) && $payway_response_array['status'] == 0){
		// Apply  your Logic to perform after successful payment over here...
		    $message = 'Pyament has been done and your Transaction ID is : '.$payway_response_array['tran_id'];
		    //mail("useremail@test.com","Your Payment Using Payway","$message");
		}
		else{
			// Apply  your Logic to perform for failed Transaction over here...
			 $message = 'Payment has failed.';
		}
	}
	else{
	    $message = 'It is not for browser please! It is to be set as Push Back Notification URL in your Payway account to 				get the response from Payway.';
	    die($message);
       }
   }
}

```

---

**6. Continue Purchase URL and Push Back Notification URL Settings:-**

```
-Change Continue Purchase URL and Push Back Notification URL according to your application.

1. Login to Payway Portal :- https://payway-staging.ababank.com/login/
2. Go to URL :- https://payway-staging.ababank.com/transaction-management/
3. Go to Settings -> Setup SMTP
4. Set Continue Purchase URL to : your-site-url/shop_page (ex: www.yoursite.com/shop)
5. Set Push Back Notification URL to : your-site-url/payway_status (ex: www.yoursite.com/payway_status)

```

**7. How to access payment page :-**

You can access your checkout page from this url:

**your-site-url/paywithpayway** (ex: [www.yoursite.com/paywithpayway](http://www.yoursite.com/paywithpayway))

**For detail description and snaps refer to [Payway Document](https://github.com/shah-shreya/payway-test-package/blob/master/PaywayDocument.docx)**

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~15 days

Total

10

Last Release

2607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff02ffb78b8937a6df954d70e9f3859f36f0fa61336078e59549d2ba8838ea93?d=identicon)[shah-shreya](/maintainers/shah-shreya)

---

Top Contributors

[![shah-shreya](https://avatars.githubusercontent.com/u/46746184?v=4)](https://github.com/shah-shreya "shah-shreya (67 commits)")

### Embed Badge

![Health badge](/badges/payway-payway/health.svg)

```
[![Health](https://phpackages.com/badges/payway-payway/health.svg)](https://phpackages.com/packages/payway-payway)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
