antonkomarev/php-funpay-sms-parser
Composer 安装命令:
composer require antonkomarev/php-funpay-sms-parser
包简介
FunPay Transaction Verification SMS Parser written for contrived emulator.
README 文档
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)MoneyAmountNotFoundPinNotFoundYandexAccountNotFoundYandexAccountInvalid
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.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-03
