californiamountainsnake / php-yandex-payment
此包已被废弃,不再维护。没有建议的替代包。
这是一个简单的用于处理Yandex.Money支付的php库
1.0.1
2019-03-28 15:02 UTC
Requires
- php: ^7.3.1
Requires (Dev)
- ext-dom: *
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2022-05-28 22:31:18 UTC
README
这是一个简单的用于处理Yandex.Money支付的php库!
安装
使用Composer安装此包
通过 Composer 安装此包。编辑您项目的 composer.json
文件以包含 californiamountainsnake/php-yandex-payment
{ "name": "yourproject/yourproject", "type": "project", "require": { "php": "^7.3.1", "californiamountainsnake/php-yandex-payment": "*" } }
并运行 composer update
或者
在您的命令行中运行此命令
composer require californiamountainsnake/php-yandex-payment
用法示例
<?php use CaliforniaMountainSnake\PhpYandexPayment\HttpPaymentNotice\YandexHttpPaymentNotice; use CaliforniaMountainSnake\PhpYandexPayment\Exceptions\PaymentException; try { $secretToken = 'your_secret_yandex_http_notice_token'; $notice = new YandexHttpPaymentNotice($_POST, $secretToken); } catch (PaymentException $e) { return $e->getMessage(); } // If we didn't get exceptions above it means that a payment is correct and we can get payment details. $notice->getAmount(); $notice->getCurrency(); $notice->getLabel();