-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add admin StripeJS behat tests and fix use_authorize click
- Loading branch information
Showing
13 changed files
with
209 additions
and
27 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
features/admin/stripe_checkout_session/cancel_authorized_order.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@managing_orders | ||
Feature: Canceling an authorized order with Stripe Checkout Session | ||
In order to cancel an order already authorized | ||
As an Administrator | ||
I want to be able to cancel a Stripe authorized order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
And this order is already authorized as "pi_123" Stripe payment intent | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Cancelling the order with an authorized payment | ||
Given I am viewing the summary of this order | ||
And I am prepared to cancel this order | ||
When I cancel this order | ||
Then I should be notified that it has been successfully updated | ||
And it should have payment with state cancelled | ||
And it should have payment state cancelled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@managing_orders | ||
Feature: Canceling an order | ||
Feature: Canceling an order with Stripe Checkout Session | ||
In order to cancel a not paid order | ||
As an Administrator | ||
I want to be able to cancel a Stripe not paid order | ||
|
@@ -8,11 +8,11 @@ Feature: Canceling an order | |
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe payment gateway without using authorize | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway without using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
And this order is not yet paid as "cs_123" Stripe checkout session | ||
And this order is not yet paid as "cs_123" Stripe Checkout Session | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
|
25 changes: 25 additions & 0 deletions
25
features/admin/stripe_checkout_session/capture_authorization_order.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@managing_orders | ||
Feature: Capturing the authorization of an order with Stripe Checkout Session | ||
In order to complete a payment | ||
As an Administrator | ||
I want to be able to capture the authorization of a Stripe paid order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
And this order is already authorized as "pi_123" Stripe payment intent | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Initializing the Stripe refund | ||
Given I am viewing the summary of this order | ||
And I am prepared to capture authorization of this order | ||
When I mark this order as paid | ||
Then I should be notified that the order's payment has been successfully completed | ||
And it should have payment with state completed | ||
And it should have payment state completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
features/admin/stripe_checkout_session/refunding_order.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@managing_orders | ||
Feature: Refunding an order with Stripe Checkout Session | ||
In order to return the money to the Customer | ||
As an Administrator | ||
I want to be able to refund a Stripe paid order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway without using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
And this order is already paid as "pi_123" Stripe payment intent | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Initializing the Stripe refund | ||
Given I am viewing the summary of this order | ||
And I am prepared to refund this order | ||
When I mark this order's payment as refunded | ||
Then I should be notified that the order's payment has been successfully refunded | ||
And it should have payment with state refunded | ||
And it's payment state should be refunded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@managing_orders | ||
Feature: Canceling an authorized order | ||
Feature: Canceling an authorized order with Stripe JS | ||
In order to cancel an order already authorized | ||
As an Administrator | ||
I want to be able to cancel a Stripe authorized order | ||
|
@@ -8,7 +8,7 @@ Feature: Canceling an authorized order | |
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe payment gateway using authorize | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@managing_orders | ||
Feature: Canceling an order with Stripe JS | ||
In order to cancel a not paid order | ||
As an Administrator | ||
I want to be able to cancel a Stripe not paid order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway without using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
And this order is not yet paid as "pi_123" Stripe JS | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Cancelling the order when a payment intent is still available | ||
Given I am viewing the summary of this order | ||
And I am prepared to cancel the payment intent on this order | ||
When I cancel this order | ||
Then I should be notified that it has been successfully updated | ||
And it should have payment with state cancelled | ||
And it should have payment state cancelled | ||
|
||
@ui | ||
Scenario: Cancelling the order after the customer canceled the payment | ||
Given this order payment has been canceled | ||
And I am viewing the summary of this order | ||
And I am prepared to cancel this order | ||
When I cancel this order | ||
Then I should be notified that it has been successfully updated | ||
And it should have payment with state cancelled | ||
And it should have payment state cancelled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@managing_orders | ||
Feature: Capturing the authorization of an order | ||
Feature: Capturing the authorization of an order with Stripe JS | ||
In order to complete a payment | ||
As an Administrator | ||
I want to be able to capture the authorization of a Stripe paid order | ||
|
@@ -8,7 +8,7 @@ Feature: Capturing the authorization of an order | |
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe payment gateway using authorize | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@managing_payment_methods | ||
Feature: Adding a new Stripe JS payment method | ||
In order to allow payment for orders, using the Stripe gateway | ||
As an Administrator | ||
I want to add new payment methods to the system | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And I am logged in as an administrator | ||
|
||
@ui @javascript | ||
Scenario: Adding a new stripe payment method using authorize | ||
Given I want to create a new Stripe JS payment method | ||
When I name it "Stripe JS" in "English (United States)" | ||
And I specify its code as "stripe_sca_test" | ||
And I configure it with test stripe gateway data "TEST", "TEST" | ||
And I add a webhook secret key "TEST" | ||
And I use authorize | ||
And I add it | ||
Then I should be notified that it has been successfully created | ||
And I should see a warning message under the use authorize field | ||
And the payment method "Stripe JS" should appear in the registry | ||
|
||
@ui @javascript | ||
Scenario: Adding a new stripe payment method not using authorize | ||
Given I want to create a new Stripe JS payment method | ||
When I name it "Stripe JS" in "English (United States)" | ||
And I specify its code as "stripe_sca_test" | ||
And I configure it with test stripe gateway data "TEST", "TEST" | ||
And I add a webhook secret key "TEST" | ||
And I don't use authorize | ||
And I add it | ||
Then I should be notified that it has been successfully created | ||
And I shouldn't see a warning message under the use authorize field | ||
And the payment method "Stripe JS" should appear in the registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@managing_orders | ||
Feature: Refunding an order | ||
Feature: Refunding an order with Stripe JS | ||
In order to return the money to the Customer | ||
As an Administrator | ||
I want to be able to refund a Stripe paid order | ||
|
@@ -8,7 +8,7 @@ Feature: Refunding an order | |
Given the store operates on a single channel in "United States" | ||
And the store has a product "Green Arrow" | ||
And the store ships everywhere for free | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe payment gateway without using authorize | ||
And the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway without using authorize | ||
And there is a customer "[email protected]" that placed an order "#00000001" | ||
And the customer bought a single "Green Arrow" | ||
And the customer chose "Free" shipping method to "United States" with "Stripe" payment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters