Download the PHP package lelyfoto/mypos-cashregisterremote without Composer
On this page you can find all versions of the php package lelyfoto/mypos-cashregisterremote. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mypos-cashregisterremote
Cash Register Remote API implementation for MyPos
This is a simple PHP implementation of the MyPos Cash Register Remote API as described on the MyPos website.
Requirements
- PHP 8.1+
- PHP extensions: bcmath, soap
- Composer 2
- MyPos account and physical payment terminal
Usage
First make sure you have met the requirements of the API from MyPos. See the requirements section on the developer site from MyPos. And store your private key securely in your project. Also add the public key you received from MyPos.
Next require this library with composer:
Then create a Config-object:
The config object can now be used to pair your terminal:
Go to your terminal and go to settings->pair device and enter the returned security code.
To make a payment:
Store the returned RequestId, you will need this to check the status of the payment. On your terminal you hit the "Enter"-key, and you can do the payment. You can further use the methods "checkPayment" or "cancelPayment" to interact with this payment.
Finally, when you want to disconnect your terminal, you can call "requestPairCodeForUnsubscribe" and enter the security code into the device.
Known issues and limitations
The biggest missing thing in this library is the lack of validation of the responses from MyPos. This will be addressed in a future release and is my top priority.
Also, there is no unit testing at this moment and also there isn't a lot of error checking. I build this library fast because I needed it soon, however I will make time to complete it soon.
Keep also in mind that I don't have a development terminal/account at MyPos, so I have to do all the testing in the production environment. The Refund and LastTxnVoid calls are untested by me at this moment.
All versions of mypos-cashregisterremote with dependencies
ext-bcmath Version *
ext-soap Version *
phpro/soap-client Version ^2.2|^3.0