davidjeddy / stripe-command-bus-interface
Stripe 命令总线接口
0.0.6
2018-02-10 15:41 UTC
Requires
- php: ^7
- stripe/stripe-php: ^4
Requires (Dev)
- codeception/codeception: ^2.0
- codeception/specify: ^0.4.3
- codeception/verify: ^0.3.0
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-09-16 03:59:41 UTC
README
徽章
状态 / 版本
早期 alpha 版!由于需要,我创建了解决方案。(有关版本号解释,请参阅 SemVer。)
致谢
没有 Eugene Terentev(GitHub 用户名)的工作,我无法完成这项工作。
描述
选择性地提供了 命令总线 风格的类,这些类覆盖了 Stripe PHP API 类。
安装
以下任一方式:
composer install davidjeddy/stripe-command-bus-interface
- 或将
"davidjeddy/stripe-command-bus-interface": "*",
添加到项目的 composer.json 文件的required
部分,然后运行composer install
。
使用方法
-
将所需的类添加到应用程序类的
use
语句中。 -
在类中实现命令总线逻辑
# basic command bus class to handler $response = $commandBus->handle( # the Stripe Command Bus core class. All requests pass through this class. new CreateHandler([ # the Stripe data is passed to the command bus handlers as the `data` property 'data' => [ 'description' => 'Test Co. LLC', 'email' => 'test@email.com', ] ]) );
$response
从 Stripe 类的响应传递回您的应用程序。- 在映射 Stripe 类的信息时,它始终包含在 'data' 数组键中。