antonkomarev / php-funpay-sms-parser
FunPay Transaction Verification SMS Parser written for contrived emulator.
                                    Fund package maintenance!
                                                                            
                                                                                                                                        paypal.me/antonkomarev
                                                                                    
                                                                
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/antonkomarev/php-funpay-sms-parser
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7.2
This package is auto-updated.
Last update: 2025-10-05 02:09:16 UTC
README
Introduction
PHP FunPay SMS Parser library allows to parse SMS messages from transaction confirmation gateway.
This package was developed as a part of an FunPay interview, I'm not affiliated with FunPay in any way.
Contents
Installation
Install as package
Pull in the package through Composer in your application:
$ composer install antonkomarev/php-funpay-sms-parser
Standalone
Clone or download project from PHP FunPay SMS Parser git repository.
$ git clone git@github.com:antonkomarev/php-funpay-sms-parser.git && cd ./php-funpay-sms-parser
Generate class autoload file and install PHPUnit.
$ composer install
Demo
Demo script could be executed using PHP CLI:
$ php public/demo.php
You could experiment with $message variable value.
More examples could be found in tests/ParserTest.php file.
Usage
Instantiate Parser
$message = ' Пароль: 0823 Спишется 100,85р. Перевод на счет 410017080996934 '; $parsedMessage = new \AK\FunPay\SmsParser\Parser($message);
Available Methods
Get Yandex.Money account number
$parsedMessage->account(): string
Get transaction money amount
$parsedMessage->moneyAmount(): float
Get confirmation pin-code
$parsedMessage->pin(): string
Exceptions
- ParserException(abstract)
- MoneyAmountNotFound
- PinNotFound
- YandexAccountNotFound
- YandexAccountInvalid
Testing
Run the tests with:
$ vendor/bin/phpunit
Author
| Anton Komarev | 
|---|
License
- PHP FunPay SMS Parserpackage is open-sourced software licensed under the MIT license by Anton Komarev.
- Decompositionimage licensed under Creative Commons 3.0 by Arthur Shlain.
