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?
- 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.
- The installation's process is more simply.
- 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.
- How works the plans subscriptions in Midrub
- How to create new placeholders for an invoice's template
- Please don't ask me to add new payments gateways
- How works the fields and options in the Midrub Payments system
- How to custom or change the payments gateway's icon
- How and where to use a payments gateway library
- Add a view file to your Payments gateway
- set_js_urls - add js links for payment gateways
- set_css_urls - add styles links in a payment gateway
- set_the_title for payments gateway