Skip to content

Commit

Permalink
Add id option to ensure checkout id is not modified
Browse files Browse the repository at this point in the history
  • Loading branch information
r-kujawa committed Apr 17, 2024
1 parent 29d8a0d commit 78a2877
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Console/Commands/CheckoutInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ class CheckoutInstall extends Command
* @var string
*/
protected $signature = 'checkout:install
{service=Checkout}';
{service=Checkout}
{--id=checkout}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Install and configure payments within the application.';
protected $description = 'Install the checkout service into the application.';
}
1 change: 1 addition & 0 deletions src/Console/Commands/CheckoutProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CheckoutProvider extends Command
*/
protected $signature = 'checkout:provider
{provider? : The checkout provider name}
{--id= : The checkout provider ID}
{--service=checkout}
{--fake : Generates a gateway to be used for testing purposes}';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function checkout_install_command_injects_checkout_service_into_orchestra
$providerGateway = $this->gatewayPath($provider);

$this->artisan('checkout:install')
->expectsQuestion('How should the service be identified?', $this->checkoutService->getId())
->expectsQuestion("Choose a driver for the {$this->checkoutService->getName()} service.", Config::get('orchestration.defaults.driver'))
->expectsQuestion("How should the {$this->checkoutService->getName()} provider be named?", $provider->getName())
->expectsQuestion("How should the {$this->checkoutService->getName()} provider be identified?", $provider->getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function checkout_provider_command_injects_checkout_service_into_orchestr
$gateway = $this->gatewayPath($provider);

$this->artisan('checkout:provider', [
'provider' => $provider->getId(),
'provider' => $provider->getName(),
'--id' => $provider->getId(),
])
->expectsOutputToContain("Gateway [app/{$gateway->request}] created successfully.")
->expectsOutputToContain("Gateway [app/{$gateway->response}] created successfully.")
Expand Down

0 comments on commit 78a2877

Please sign in to comment.