Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/acp 2289/master refactor message names to follow our defined structure all new message names #2498

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ related:
- title: Stripe
link: docs/pbc/all/payment-service-provider/page.version/base-shop/third-party-integrations/stripe/stripe.html
redirect_from:
- /docs/pbc/all/payment-service-provider/202311.0/third-party-integrations/stripe/install-stripe.html
- /docs/pbc/all/payment-service-provider/202311.0/base-shop/third-party-integrations/stripe/install-stripe.html
- /docs/pbc/all/payment-service-provider/202311.0/third-party-integrations/stripe/install-stripe.html
- /docs/pbc/all/payment-service-provider/202311.0/base-shop/third-party-integrations/stripe/install-stripe.html

---
This document describes how to integrate [Stripe](/docs/pbc/all/payment-service-provider/{{page.version}}/base-shop/third-party-integrations/stripe/stripe.html) into a Spryker shop.
Expand All @@ -29,13 +29,13 @@ Your project probably already contains the following code in `config/Shared/conf
```php
//...

use Generated\Shared\Transfer\PaymentConfirmationFailedTransfer;
use Generated\Shared\Transfer\PaymentConfirmationRequestedTransfer;
use Generated\Shared\Transfer\PaymentConfirmedTransfer;
use Generated\Shared\Transfer\PaymentMethodAddedTransfer;
use Generated\Shared\Transfer\PaymentMethodDeletedTransfer;
use Generated\Shared\Transfer\PaymentPreauthorizationFailedTransfer;
use Generated\Shared\Transfer\PaymentPreauthorizedTransfer;
use Generated\Shared\Transfer\PaymentCaptureFailedTransfer;
use Generated\Shared\Transfer\CapturePaymentTransfer;
use Generated\Shared\Transfer\PaymentCapturedTransfer;
use Generated\Shared\Transfer\AddPaymentMethodTransfer;
use Generated\Shared\Transfer\DeletePaymentMethodTransfer;
use Generated\Shared\Transfer\PaymentAuthorizationFailedTransfer;
use Generated\Shared\Transfer\PaymentAuthorizedTransfer;
use Spryker\Shared\MessageBroker\MessageBrokerConstants;
use Spryker\Shared\Oms\OmsConstants;
use Spryker\Shared\Payment\PaymentConstants;
Expand Down Expand Up @@ -66,13 +66,13 @@ $config[SalesConstants::PAYMENT_METHOD_STATEMACHINE_MAPPING] = [

$config[MessageBrokerConstants::MESSAGE_TO_CHANNEL_MAP] = [
//...
PaymentMethodAddedTransfer::class => 'payment-method-commands',
PaymentMethodDeletedTransfer::class => 'payment-method-commands',
PaymentConfirmationRequestedTransfer::class => 'payment-commands',
PaymentPreauthorizedTransfer::class => 'payment-events',
PaymentPreauthorizationFailedTransfer::class => 'payment-events',
PaymentConfirmedTransfer::class => 'payment-events',
PaymentConfirmationFailedTransfer::class => 'payment-events',
AddPaymentMethodTransfer::class => 'payment-method-commands',
DeletePaymentMethodTransfer::class => 'payment-method-commands',
CancelPayment::class => 'payment-commands',
PaymentAuthorized::class => 'payment-events',
PaymentAuthorizationFailed::class => 'payment-events',
PaymentCaptured::class => 'payment-events',
PaymentCaptureFailed::class => 'payment-events',
];

$config[MessageBrokerConstants::CHANNEL_TO_RECEIVER_TRANSPORT_MAP] = [
Expand All @@ -97,11 +97,8 @@ Your project probably already contains the following code in `src/Pyz/Zed/Messag
namespace Pyz\Zed\MessageBroker;

use Spryker\Zed\MessageBroker\MessageBrokerDependencyProvider as SprykerMessageBrokerDependencyProvider;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentConfirmationFailedMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentConfirmedMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentOperationsMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentMethodMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentPreauthorizationFailedMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentPreauthorizedMessageHandlerPlugin;

class MessageBrokerDependencyProvider extends SprykerMessageBrokerDependencyProvider
{
Expand All @@ -114,10 +111,7 @@ class MessageBrokerDependencyProvider extends SprykerMessageBrokerDependencyProv
//...

# These plugins are handling messages sent from Stripe app to SCCOS.
new PaymentConfirmationFailedMessageHandlerPlugin(),
new PaymentConfirmedMessageHandlerPlugin(),
new PaymentPreauthorizationFailedMessageHandlerPlugin(),
new PaymentPreauthorizedMessageHandlerPlugin(),
new PaymentOperationsMessageHandlerPlugin(),
new PaymentMethodMessageHandlerPlugin(),
];
}
Expand Down Expand Up @@ -158,9 +152,9 @@ Your project is likely to have the following in `src/Pyz/Zed/Oms/OmsDependencyPr
```php
//...

use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendEventPaymentCancelReservationPendingPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendEventPaymentConfirmationPendingPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendEventPaymentRefundPendingPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendCapturePaymentMessageCommandPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendRefundPaymentMessageCommandPlugin;
use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendCancelPaymentMessageCommandPlugin;

//...

Expand All @@ -173,13 +167,11 @@ use Spryker\Zed\SalesPayment\Communication\Plugin\Oms\SendEventPaymentRefundPend
{
$container->extend(self::COMMAND_PLUGINS, function (CommandCollectionInterface $commandCollection) {
//...

$commandCollection->add(new SendEventPaymentConfirmationPendingPlugin(), 'Payment/SendEventPaymentConfirmationPending');

$commandCollection->add(new SendCapturePaymentMessageCommandPlugin(), 'Payment/Capture');
// these two commands will be also supported soon.
$commandCollection->add(new SendEventPaymentRefundPendingPlugin(), 'Payment/SendEventPaymentRefundPending');
$commandCollection->add(new SendEventPaymentCancelReservationPendingPlugin(), 'Payment/SendEventPaymentCancelReservationPending');

$commandCollection->add(new SendRefundPaymentMessageCommandPlugin(), 'Payment/Refund');
$commandCollection->add(new SendCancelPaymentMessageCommandPlugin(), 'Payment/Cancel');
return $commandCollection;
});

Expand All @@ -194,7 +186,7 @@ The complete default payment OMS configuration is available at `vendor/spryker/s

The payment flow of the default OMS involves authorizing the initial payment, which means that the amount is temporarily blocked when the payment method permits. Then, the OMS sends requests to capture, that is, transfer of the previously blocked amount from the customer's account to the store account.

The `Payment/SendEventPaymentConfirmationPending` command initiates the capture action. By default, this command is initiated when a Back office user clicks **Ship** on the *Order Overview* page.
The `Payment/Capture` command initiates the capture action. By default, this command is initiated when a Back office user clicks **Ship** on the *Order Overview* page.

Optionally, you can change and configure your own payment OMS based on `ForeignPaymentStateMachine01.xml` from the core package and change this behavior according to your business flow. See [Install the Order Management feature](/docs/pbc/all/order-management-system/{{page.version}}/base-shop/install-and-upgrade/install-features/install-the-order-management-feature.html) for more information about the OMS feature and its configuration.

Expand All @@ -205,9 +197,9 @@ This example demonstrates how to configure the order state machine transition fr
```xml
<?xml version="1.0"?>
<statemachine
xmlns="spryker:oms-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="spryker:oms-01 http://static.spryker.com/oms-01.xsd"
xmlns="spryker:oms-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="spryker:oms-01 http://static.spryker.com/oms-01.xsd"
>

<process name="SomePaymentProcess" main="true">
Expand All @@ -218,7 +210,7 @@ This example demonstrates how to configure the order state machine transition fr

<!-- other states -->

<state name="payment capture pending" display="oms.state.in-progress"/>
<state name="payment capture pending" display="oms.state.in-progress"/>

<!-- other states -->

Expand All @@ -229,9 +221,9 @@ This example demonstrates how to configure the order state machine transition fr
<!-- other transitions -->

<transition happy="true">
<source>ready for dispatch</source>
<target>payment capture pending</target>
<event>capture payment</event>
<source>ready for dispatch</source>
<target>payment capture pending</target>
<event>capture payment</event>
</transition>

<!-- other transitions -->
Expand All @@ -242,7 +234,7 @@ This example demonstrates how to configure the order state machine transition fr

<!-- other events -->

<event name="capture payment" onEnter="true" command="Payment/SendEventPaymentConfirmationPending"/>
<event name="capture payment" onEnter="true" command="Payment/Capture"/>

<!-- other events -->

Expand Down Expand Up @@ -286,8 +278,8 @@ If you have rewritten `@CheckoutPage/views/payment/payment.twig` on the project
{% endraw %}
```

3. Optional: Add the glossary keys for all the new (external) payment providers and methods to your glossary data import file.
For example, there is a new external payment with the provider name Payone, found in the `spy_payment_method` table under the `group_name` column, and the payment method name Credit Card, found in the `spy_payment_method` table under the `label_name` column. For all of them, you can add translations to your glossary data import file like this:
3. Optional: Add the glossary keys for all the new (external) payment providers and methods to your glossary data import file.
For example, there is a new external payment with the provider name Payone, found in the `spy_payment_method` table under the `group_name` column, and the payment method name Credit Card, found in the `spy_payment_method` table under the `label_name` column. For all of them, you can add translations to your glossary data import file like this:

```csv
...
Expand Down
Loading