Search for Resources and Solutions

How and where to use a payments gateway library

To process the payments, many online payments services provides a library which can be used inside a script to process easy the payments. In Midrub's i've used at the begin only the library for Stripe but when i've created the new payments system, i've decided to not touch more the main vendor directory. All payments libraries should be inside the gateway's directory.

How you ca install the payment's library from Github in your payment gateway folder?

  • Press the Shift key and right click inside the payment gateway folder,
  • Select Open Command window here.
  • Enter composer require and the pack name from Github.
  • Will be created the vendor inside the¬†payment gateway folder and you have to read the documentation how to use it.

Please remember the guide above is for Windows and you should have the Composer software installed and a PHP server on your computer.

What are the benefits to have the payment's library in your payment gateway folder?

  1. You don't need to worry about the old version with deprecated features because you can anytime provide a new update for the payment gateway with updated library.
  2. The installation's process is more simply.
  3. Anytime you can update the library when you're updating the gateway and user won't take care to update the vendor.


I recommend to not touch the main vendor directory. 

Was this article helpful?