Skip to content

Commit

Permalink
tw-reivew
Browse files Browse the repository at this point in the history
  • Loading branch information
andriitserkovnyi committed Sep 11, 2024
1 parent 0811258 commit 7bf1159
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1565,10 +1565,10 @@ To import data follow the steps in the following sections.

Some of the commission rule expressions provided in the following examples are based on optional feature extensions. For commissions to work properly, these extensions need to be enabled:

* `item-price`: the condition for the order item from the `Install the Marketplace Merchant Commission + Prices feature` extension.
* `category`: the condition for the order item from the `Install the Marketplace Merchant Commission + Category Management feature` extension.
* `item-price`: the condition for the order item from the [Install the Marketplace Merchant Commission + Prices feature](/docs/pbc/all/merchant-management/202407.0/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-commission-prices-feature.html).
* `category`: the condition for the order item from the [Install the Marketplace Merchant Commission + Category Management feature](/docs/pbc/all/merchant-management/202407.0/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-commission-category-management-feature.html).

The related extensions are listed in [Install related features](#install-related-features).
All related extensions are listed in [Install related features](#install-related-features).

{% endinfo_block %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class MessageBrokerConfig extends SprykerMessageBrokerConfig

```

5. Enable the order expenses for the merchant payout:
5. Enable order expenses for the merchant payout:

**src/Pyz/Zed/SalesPaymentMerchant/SalesPaymentMerchantConfig.php**

Expand All @@ -236,7 +236,7 @@ class SalesPaymentMerchantConfig extends SprykerSalesPaymentMerchantConfig
* @var bool
*/
protected const ORDER_EXPENSE_INCLUDED_IN_PAYMENT_PROCESS = true;

/**
* @var array<string, list<string>>
*/
Expand All @@ -252,18 +252,14 @@ Verify that the order expenses are included in the merchant payout process:

1. Place an order with products from different merchants.
2. Pass the merchant payout stage for the order.
3. In the `spy_sales_payment_merchant_payout` database table, make sure the merchant payout amounts have been applied to each merchant product in your order.
4. The order expenses should be included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout` database table.
4. Refund for the order.
5. In the `spy_sales_payment_merchant_payout_reversal` database table, make sure the refunded merchant payout amounts have been applied to each merchant product in your order.
6. The refunded order expenses should be included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout_reversal` database table in case there are no merchant order items left for the refund.

Verify that the order expenses with specific type are not included in the merchant payout process:

1. Repeat the steps above for the store with the excluded expense types.
2. Make sure the order expenses with the excluded expense types are not included in the merchant payout process.
3. Make sure the order expenses are not included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout` database table.
4. Make sure the refunded order expenses are not included in the merchant reverse payout process as a separate entry in the `spy_sales_payment_merchant_payout_reversal` database table.
In the `spy_sales_payment_merchant_payout` database table, make sure the merchant payout amounts have been applied to each merchant product in your order. The order expenses should be included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout` database table.
3. Refund the order.
In the `spy_sales_payment_merchant_payout_reversal` database table, make sure the refunded merchant payout amounts have been applied to each merchant product in your order. If there're no merchant order items left for the refund, the refunded order expenses should be included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout_reversal` database table.

4. Repeat steps 1-3 for a store with excluded expense types and make sure the following applies:
* The order expenses with the excluded expense types are not included in the merchant payout process.
* The order expenses are not included in the merchant payout process as a separate entry in the `spy_sales_payment_merchant_payout` database table.
* The refunded order expenses are not included in the merchant reverse payout process as a separate entry in the `spy_sales_payment_merchant_payout_reversal` database table.

{% endinfo_block %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,27 @@ To install and configure the prerequisites for the [Stripe App](/docs/pbc/all/pa

## Install and update modules

Update the following modules using Composer:
1. Update modules using Composer:

```bash
composer update spryker-feature/order-management spryker-feature/spryker-core spryker-feature/payments spryker-feature/marketplace-merchant spryker/oauth-client --with-dependencies
```

Install the required modules using Composer:
2. Install the required modules using Composer:

```bash
composer require spryker/merchant-app spryker/merchant-app-merchant-portal-gui
```

## Add request headers configuration

Add the following configuration settings for the Oauth client:
We use the Auth0 as the Oauth provider.
1. Add the following configuration settings for the Oauth client:

{% info_block infoBox "" %}

In this example, Auth0 is used as an Oauth provider.

{% endinfo_block %}

**config/Shared/config_default.php**

Expand All @@ -43,8 +48,7 @@ $config[OauthClientConstants::OAUTH_GRANT_TYPE_FOR_ACP] = OauthAuth0Config::GRAN
$config[OauthClientConstants::OAUTH_OPTION_AUDIENCE_FOR_ACP] = 'aop-app'
```

Let's add the tenant identifier to the configuration:
The tenant identifier should be available in the environment variable `SPRYKER_TENANT_IDENTIFIER`.
2. Add the tenant identifier to the configuration. The tenant identifier should be available in the `SPRYKER_TENANT_IDENTIFIER` environment variable.

**config/Shared/config_default.php**

Expand Down Expand Up @@ -152,15 +156,15 @@ class OmsDependencyProvider extends SprykerOmsDependencyProvider
protected function extendCommandPlugins(Container $container): Container
{
$container->extend(self::COMMAND_PLUGINS, function (CommandCollectionInterface $commandCollection) {

$commandCollection->add(new MerchantPayoutCommandByOrderPlugin(), 'SalesPaymentMerchant/Payout');
$commandCollection->add(new MerchantPayoutReverseCommandByOrderPlugin(), 'SalesPaymentMerchant/ReversePayout');

return $commandCollection;
});

return $container;
}
}
```

2. Add the following conditions to `\Pyz\Zed\Oms\OmsDependencyProvider::extendConditionPlugins()`:
Expand All @@ -187,7 +191,7 @@ class OmsDependencyProvider extends SprykerOmsDependencyProvider
protected function extendConditionPlugins(Container $container): Container
{
$container->extend(self::CONDITION_PLUGINS, function (ConditionCollectionInterface $conditionCollection) {

$conditionCollection->add(new IsMerchantPaidOutConditionPlugin(), 'SalesPaymentMerchant/IsMerchantPaidOut');
$conditionCollection->add(new IsMerchantPayoutReversedConditionPlugin(), 'SalesPaymentMerchant/IsMerchantPayoutReversed');

Expand All @@ -202,8 +206,10 @@ class OmsDependencyProvider extends SprykerOmsDependencyProvider

### Add project configuration

1. Configure ACL, add the following configuration `'merchant-app-merchant-portal-gui'` to
`\Pyz\Zed\Acl\AclConfig::addMerchantPortalInstallerRules()`:
1. To Configure ACL, add the `'merchant-app-merchant-portal-gui'` configuration:

<details>
<summary>\Pyz\Zed\Acl\AclConfig::addMerchantPortalInstallerRules()</summary>

```php
<?php
Expand Down Expand Up @@ -259,7 +265,9 @@ class AclConfig extends SprykerAclConfig
}
```

2. Configure the message broker, add `'merchant-commands'`, `'merchant-app-events'`, and `'app-events'` events:
</details>

2. To configure the message broker, add `'merchant-commands'`, `'merchant-app-events'`, and `'app-events'` events:

```php
<?php
Expand Down Expand Up @@ -288,9 +296,9 @@ class MessageBrokerConfig extends SprykerMessageBrokerConfig

```

3. To configure state machine, copy `vendor/spryker/sales-payment/config/Zed/Oms/StateMachine/ForeignPaymentProviderStateMachine01.xml` to the project and adjust to your needs.
4. For more information about ACP payment methods integration with your project OMS configuration, see [Integrate ACP payment apps with Spryker OMS configuration](/docs/dg/dev/acp/integrate-acp-payment-apps-with-spryker-oms-configuration.html).
5. To enable merchants to be redirected to the Merchant Portal from third-party websites, add `redirect.php` to the public folder of your Merchant Portal: [/public/MerchantPortal/redirect.php](https://github.com/spryker-shop/b2c-demo-marketplace/blob/master/public/MerchantPortal/redirect.php).
3. To configure state machine, copy `vendor/spryker/sales-payment/config/Zed/Oms/StateMachine/ForeignPaymentProviderStateMachine01.xml` to the project and adjust it to your needs. For more information about ACP payment methods integration with your project OMS configuration, see [Integrate ACP payment apps with Spryker OMS configuration](/docs/dg/dev/acp/integrate-acp-payment-apps-with-spryker-oms-configuration.html).

4. To enable merchants to be redirected to the Merchant Portal from third-party websites, add `redirect.php` to the public folder of your Merchant Portal: [/public/MerchantPortal/redirect.php](https://github.com/spryker-shop/b2c-demo-marketplace/blob/master/public/MerchantPortal/redirect.php).



Expand Down

0 comments on commit 7bf1159

Please sign in to comment.