Stripe Command Bus Interface
EARLY ALPHA! I had a need so created a solution. (See SemVer for an explanation of version numbering.)
A limited selection of command bus style classes that overlay the Stripe PHP API classes.
composer install davidjeddy/stripe-command-bus-interface
- or add
"davidjeddy/stripe-command-bus-interface": "*",to your projects composer.json in the
requiredsections, -THEN run
- Copy .env.dist as .env in the root of project
- Add Stripe public and private key to .env per vlucas/phpdotenv usage.
- Implement command bus logic:
# basic command bus class to handler $response = $commandBus->handle( # the Stripe Command Bus core class. All requests pass through this class. new \dje\StripeCB\Customer\CreateHandler([ # the Stripe data is passed to the command bus handlers as the `data` property 'data' => [ 'description' => 'Test Co. LLC', 'email' => 'email@example.com', ] ]) );
$responseis passed from the Stripe class response back to you,
- When mapping information for a Stripe class, it will always be contained within the 'data' array key
- Properly install and configure package dependencies (.env, stripe-php)
- Copy ./example/CustomerExampleController.php to your applications ./console/controller directory
php ./console/yii customer-example/create-customer
- Observe results.