wdwp/yandexmoney
Composer 安装命令:
composer require wdwp/yandexmoney
包简介
PHP library for Yandex money forms and buttons api
README 文档
README
Installation
Install this package through Composer. To your composer.json file, add:
{ "require": { "wdwp/yandexmoney": "^1.0" } }
Examples
Create payment:
use wdwp\yandexmoney\Payment; $payment = new Payment( '4100163332366', 'Payment', 100.0, 'shop', 'AC' ); $form = $payment->setFormcomment('Shop name') ->setDest('Payment for some goods') ->setLabel($order->id) ->setComment($order->comment) ->setSuccessUrl('http://yoursite.com/success.php') ->needFio(true) ->needEmail(true) ->needPhone(true) ->needAddress(true) ->getForm(); echo $form; // redirect to payment url $payment->send(); // get payment url $url = $payment->getUrl();
Check payment result:
// somewere in result url handler... ... use wdwp\yandexmoney\Payment; $result = Payment::validate($_POST, 'RX29rXHxOsR0exsBs6Hvi'); //secret word if ($result) { // payment is valid $order = Orders::find($result['label']); } ...
Success page:
... echo "Thank you for your payment!"; ...
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-15