davidjeddy / stripe-command-bus-interface

0.0.6 2018-02-10 15:41 UTC

README

徽章

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock codecov Maintainability

SensioLabsInsight

状态 / 版本

早期 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

使用方法

  1. 将所需的类添加到应用程序类的 use 语句中。

  2. 在类中实现命令总线逻辑

# 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' 数组键中。