davidjeddy / stripe-command-bus-interface
Stripe Command Bus Interface
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-12-16 04:31:32 UTC
README
Badges
Status / Version
EARLY ALPHA! I had a need so I created a solution. (See SemVer for an explanation of version numbering.)
Credit
Could not do this without the work of Eugene Terentev.
Description
A limited selection of command bus style classes that overlay the Stripe PHP API classes.
Install
Either
composer install davidjeddy/stripe-command-bus-interface
- or add
"davidjeddy/stripe-command-bus-interface": "*",
to your projects composer.json in therequired
sections, -THEN runcomposer install
.
Usage
-
Add the desired classes to your application classes
use
statements. -
Implement command bus logic in the class:
# 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
is passed from the Stripe class response back to your application.- When mapping information for a Stripe class, it will always be contained within the 'data' array key.