-
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.
- Loading branch information
Showing
37 changed files
with
467 additions
and
168 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@stripe_checkout_session_payment_configuration | ||
Feature: Paying with Stripe Checkout Session during checkout | ||
In order to buy products | ||
As a Customer | ||
I want to be able to pay with "Stripe Checkout Session" payment gateway | ||
I want to be able to use the payment configuration endpoint | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And there is a user "[email protected]" identified by "password123" | ||
And the store has a product "PHP T-Shirt" priced at "€19.99" | ||
And the store ships everywhere for free | ||
And I am logged in as "[email protected]" | ||
|
||
@api | ||
Scenario: Getting payment configuration | ||
Given the store has a payment method "Stripe" with a code "stripe" and Stripe Checkout Session payment gateway without using authorize | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Stripe" payment method | ||
When I see the payment configuration | ||
Then I should be able to get "publishable_key" with value "pk_test_publishablekey" | ||
And I should be able to get "use_authorize" with a boolean value 0 | ||
And I should be able to get "stripe_checkout_session_url" with value "https://checkout.stripe.com/c/pay/cs_1" | ||
|
||
@api | ||
Scenario: Getting payment configuration using authorize | ||
Given the store has a payment method "Stripe authorize" with a code "stripe_authorize" and Stripe Checkout Session payment gateway using authorize | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Stripe authorize" payment method | ||
When I see the payment configuration | ||
Then I should be able to get "publishable_key" with value "pk_test_publishablekey" | ||
And I should be able to get "use_authorize" with a boolean value 1 | ||
And I should be able to get "stripe_checkout_session_url" with value "https://checkout.stripe.com/c/pay/cs_1" |
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,33 @@ | ||
@stripe_js_payment_configuration | ||
Feature: Paying with Stripe JS during checkout | ||
In order to buy products | ||
As a Customer | ||
I want to be able to pay with "Stripe JS" payment gateway | ||
I want to be able to use the payment configuration endpoint | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And there is a user "[email protected]" identified by "password123" | ||
And the store has a product "PHP T-Shirt" priced at "€19.99" | ||
And the store ships everywhere for free | ||
And I am logged in as "[email protected]" | ||
|
||
@api | ||
Scenario: Getting payment configuration | ||
Given the store has a payment method "Stripe" with a code "stripe" and Stripe JS payment gateway without using authorize | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Stripe" payment method | ||
When I see the payment configuration for Stripe JS | ||
Then I should be able to get "publishable_key" with value "pk_test_publishablekey" | ||
And I should be able to get "use_authorize" with a boolean value 0 | ||
And I should be able to get "stripe_payment_intent_client_secret" with value "1234567890" | ||
|
||
@api | ||
Scenario: Getting payment configuration using authorize | ||
Given the store has a payment method "Stripe authorize" with a code "stripe_authorize" and Stripe JS payment gateway using authorize | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Stripe authorize" payment method | ||
When I see the payment configuration for Stripe JS | ||
Then I should be able to get "publishable_key" with value "pk_test_publishablekey" | ||
And I should be able to get "use_authorize" with a boolean value 1 | ||
And I should be able to get "stripe_payment_intent_client_secret" with value "1234567890" |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FluxSE\SyliusPayumStripePlugin\Api\Payum; | ||
|
||
use Payum\Core\Reply\ReplyInterface; | ||
use Sylius\Component\Core\Model\PaymentInterface; | ||
|
||
interface ProcessorInterface | ||
{ | ||
/** | ||
* @return array{'reply': ReplyInterface|null, "details": array} | ||
*/ | ||
public function __invoke(PaymentInterface $payment, bool $useAuthorize): array; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FluxSE\SyliusPayumStripePlugin\Factory; | ||
|
||
use Payum\Core\Model\ModelAggregateInterface; | ||
use Payum\Core\Request\Authorize; | ||
use Payum\Core\Security\TokenInterface; | ||
|
||
final class AuthorizeRequestFactory implements ModelAggregateFactoryInterface | ||
{ | ||
public function createNewWithToken(TokenInterface $token): ModelAggregateInterface | ||
{ | ||
return new Authorize($token); | ||
} | ||
} |
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
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
Oops, something went wrong.