cgm/zf2-tip-me
Composer 安装命令:
composer require cgm/zf2-tip-me
包简介
ZF2 module for accepting tips/donations with Stripe
README 文档
README
Version 1.0.0 / Created by Christopher Martin / BSD-3-Clause License
Introduction
Accept donations directly on your site with Zend Framework 2 and a free Stripe account.
Features
- Notification emails can be sent after successful payments.
- Test mode toggle, with a list of test credit cards for various testing scenarios.
- Designed for easy customization. Donation items are configurable. Event hooks available.
- Failed transactions are logged.
- No PCI data is sent to or stored on your server, thanks to Stripe.
Stripe currently is only available in United States and Canada.
Get notified of when Stripe is available in your country.
Installation
Composer / Packagist Install
Add "minimum-stability": "dev" to your composer.json file, and run:
# From project's base directory... % composer.phar require cgm/zf2-tip-me Please provide a version constraint for the cgm/config-admin requirement: dev-master
Enable the ZF2TipMe Module
Edit your application.config.php and enable the ZfcBase and ZF2TipMe modules:
return array( 'modules' => array( // ... 'ZfcBase', 'ZF2TipMe', ), // ... );
Create Directories and Symbolic Links
Out of the box, this module is configured to write log files to
./data/log and ./data/mail. The mail logs are used when you have
chosen not to use a mail server.
# From project's base directory... % cd data % mkdir log mail % chmod 777 log mail # Or set the appropriate group permissions to be writable by the webserver
There is an asset folder with CSS and JavaScript files.
You can link them to ./public/tip-me-assets, or potentially
use a asset management module:
# From the project's base dir... % cd public % ln -s ../vendor/cgm/zf2-tip-me/public tip-me-assets
Edit the Configuration
Copy the .global and .local dist files from the module config directory:
# From project's base directory... % cd config/autoload % cp ../../vendor/cgm/zf2-tip-me/config/zf2tipme.global.php.dist ./zf2tipme.global.php % cp ../../vendor/cgm/zf2-tip-me/config/zf2tipme.local.php.dist ./zf2tipme.local.php
Edit the zf2tipme.global.php file to taste:
<?php return array( 'zf2tipme' => array( 'error_log' => './data/log/tipme.log', 'recipient_name' => '{{{RECIPIENT}}}', // Your name 'admin_email' => '{{{admin@email.address}}}', // Displayed for refunds, and used for mail notifications 'statement_descriptor' => '{{{STATEMENT_DESCRIPTOR}}}', // Stripe account setting 'tip_options' => array( // Customize away... 'coffee' => array( 'title' => 'Cup of Starbucks coffee (12 oz)', 'amount' => 2.50, 'img_src' => 'http://placehold.it/200x150', ), 'redbull' => array( 'title' => 'Red Bull (20 oz, sugar free)', 'amount' => 4.48, 'img_src' => 'http://placehold.it/200x150', ), 'music' => array( 'title' => 'MP3 music (album)', 'amount' => 9.99, 'img_src' => 'http://placehold.it/200x150', ), ), 'mail_transport_options' => array( // Used with default 'zf2tipme_mailtransport' factory in Module.php 'path' => './data/mail/', ), ), );
Edit the zf2tipme.local.php file with your Stripe API keys:
<?php $testMode = true; return array( 'zf2tipme' => array( 'test_mode' => $testMode, 'stripe_secret_key' => ($testMode) ? '{{{TEST_SECRET_KEY_HERE}}}' : '{{{LIVE_SECRET_KEY_HERE}}}', 'stripe_publish_key' => ($testMode) ? '{{{TEST_PUBLISHABLE_KEY_HERE}}}' : '{{{LIVE_PUBLISHABLE_KEY_HERE}}}', ), );
Verify it works
Point your browser to /tip-me and use the "Fill Test Data" dropdown
for testable credit cards.
Like this module?
Tip me a coffee ☕ ;)
cgm/zf2-tip-me 适用场景与选型建议
cgm/zf2-tip-me 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32 次下载、GitHub Stars 达 6, 最近一次更新时间为 2013 年 01 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zend」 「zf2」 「module」 「tips」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cgm/zf2-tip-me 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cgm/zf2-tip-me 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cgm/zf2-tip-me 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Polyfill for mb_ereg(), mb_eregi(), mb_ereg_match(), and mb_ereg_replace*() functions; primary use case is for mbstring on Windows 7.4+
Zend Framework module to leverage the symfony dependency injection container
RCM User HTML views/pages
Zend Framework 1 Http package
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2013-01-17
