Skip to content

Commit

Permalink
[stripe] add create plan action to the factory
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Mar 21, 2016
1 parent 9be62f8 commit 30f9812
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions StripeCheckoutGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Payum\Core\GatewayFactory;
use Payum\Stripe\Action\Api\CreateChargeAction;
use Payum\Stripe\Action\Api\CreateCustomerAction;
use Payum\Stripe\Action\Api\CreatePlanAction;
use Payum\Stripe\Action\Api\ObtainTokenAction;
use Payum\Stripe\Action\CaptureAction;
use Payum\Stripe\Action\ConvertPaymentAction;
Expand All @@ -24,7 +25,7 @@ protected function populateConfig(ArrayObject $config)
throw new LogicException('You must install "stripe/stripe-php:~2.0|~3.0" library.');
}

$config->defaults(array(
$config->defaults([
'payum.factory_name' => 'stripe_checkout',
'payum.factory_title' => 'Stripe Checkout',

Expand All @@ -38,17 +39,18 @@ protected function populateConfig(ArrayObject $config)
},
'payum.action.create_charge' => new CreateChargeAction(),
'payum.action.create_customer' => new CreateCustomerAction(),
'payum.action.create_plan' => new CreatePlanAction(),

'payum.extension.create_customer' => new CreateCustomerExtension(),
));
]);

if (false == $config['payum.api']) {
$config['payum.default_options'] = array(
$config['payum.default_options'] = [
'publishable_key' => '',
'secret_key' => ''
);
];
$config->defaults($config['payum.default_options']);
$config['payum.required_options'] = array('publishable_key', 'secret_key');
$config['payum.required_options'] = ['publishable_key', 'secret_key'];

$config['payum.api'] = function (ArrayObject $config) {
$config->validateNotEmpty($config['payum.required_options']);
Expand Down

0 comments on commit 30f9812

Please sign in to comment.