Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonkomarev/php-funpay-sms-parser
FunPay Transaction Confirmation SMS Parser written for contrived emulator.
https://github.com/antonkomarev/php-funpay-sms-parser
emulator parser php sms transaction verification
Last synced: 3 days ago
JSON representation
FunPay Transaction Confirmation SMS Parser written for contrived emulator.
- Host: GitHub
- URL: https://github.com/antonkomarev/php-funpay-sms-parser
- Owner: antonkomarev
- License: mit
- Created: 2018-07-03T02:19:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-04T12:27:41.000Z (about 5 years ago)
- Last Synced: 2024-10-11T07:14:04.002Z (26 days ago)
- Topics: emulator, parser, php, sms, transaction, verification
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP FunPay SMS Parser
![ak-php-funpay-sms-parser](https://user-images.githubusercontent.com/1849174/42195292-ec2e0330-7e80-11e8-9069-6046946ccb25.png)
## 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](#installation)
- [Install as composer package](#install-as-package)
- [Standalone](#standalone)
- [Demo](#demo)
- [Usage](#usage)
- [Instantiate Parser](#instantiate-parser)
- [Available Methods](#available-methods)
- [Exceptions](#exceptions)
- [Testing](#testing)
- [Author](#author)
- [License](#license)## Installation
### Install as package
Pull in the package through Composer in your application:
```sh
$ composer install antonkomarev/php-funpay-sms-parser
```### Standalone
Clone or download project from [PHP FunPay SMS Parser git repository](https://github.com/antonkomarev/php-funpay-sms-parser).
```sh
$ git clone [email protected]:antonkomarev/php-funpay-sms-parser.git && cd ./php-funpay-sms-parser
```Generate class autoload file and install PHPUnit.
```sh
$ composer install
```## Demo
Demo script could be executed using PHP CLI:
```sh
$ php public/demo.php
```You could experiment with `$message` variable value.
More examples could be found in `tests/ParserTest.php` file.
## Usage
### Instantiate Parser
```php
$message = '
Пароль: 0823
Спишется 100,85р.
Перевод на счет 410017080996934
';$parsedMessage = new \AK\FunPay\SmsParser\Parser($message);
```### Available Methods
#### Get Yandex.Money account number
```php
$parsedMessage->account(): string
```#### Get transaction money amount
```php
$parsedMessage->moneyAmount(): float
```#### Get confirmation pin-code
```php
$parsedMessage->pin(): string
```### Exceptions
- `ParserException` (abstract)
- `MoneyAmountNotFound`
- `PinNotFound`
- `YandexAccountNotFound`
- `YandexAccountInvalid`## Testing
Run the tests with:
```sh
$ vendor/bin/phpunit
```## Author
| ![@antonkomarev](https://avatars.githubusercontent.com/u/1849174?s=110)
Anton Komarev |
| :---: |## License
- `PHP FunPay SMS Parser` package is open-sourced software licensed under the [MIT license](LICENSE) by [Anton Komarev].
- `Decomposition` image licensed under [Creative Commons 3.0](https://creativecommons.org/licenses/by/3.0/us/) by Arthur Shlain.[Anton Komarev]: https://komarev.com