Skip to content

Commit

Permalink
ACP-3779 Improved error message when customers Stripe account is not …
Browse files Browse the repository at this point in the history
…enabled for Stripe Connect. (#11086)

ACP-3779 Improved error message when customers Stripe account is not enabled for Stripe Connect.
  • Loading branch information
vol4onok authored Sep 6, 2024
1 parent 38db1dc commit 5a56b33
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "proprietary",
"require": {
"php": ">=8.1",
"spryker/acl-merchant-portal-extension": "^1.0.0",
"spryker/kernel": "^3.30.0",
"spryker/kernel-app": "^1.0.0",
"spryker/merchant": "^3.12.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,22 @@
<property name="failureMessage" type="string"/>
</transfer>

<transfer name="AclEntityMetadataConfig">
<property name="aclEntityMetadataCollection" type="AclEntityMetadataCollection"/>
</transfer>

<transfer name="AclEntityMetadataCollection">
<property name="collection" type="array" singular="aclEntityMetadata" associative="true"/>
</transfer>

<transfer name="AclEntityMetadata">
<property name="entityName" type="string"/>
<property name="isSubEntity" type="bool"/>
<property name="parent" type="AclEntityParentMetadata"/>
</transfer>

<transfer name="AclEntityParentMetadata">
<property name="entityName" type="string"/>
</transfer>

</transfers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

/**
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

namespace Spryker\Zed\SalesPaymentMerchant\Communication\Plugin\AclMerchantPortal;

use Generated\Shared\Transfer\AclEntityMetadataConfigTransfer;
use Generated\Shared\Transfer\AclEntityMetadataTransfer;
use Generated\Shared\Transfer\AclEntityParentMetadataTransfer;
use Spryker\Zed\AclMerchantPortalExtension\Dependency\Plugin\AclEntityConfigurationExpanderPluginInterface;
use Spryker\Zed\Kernel\Communication\AbstractPlugin;

/**
* @method \Spryker\Zed\SalesPaymentMerchant\Business\SalesPaymentMerchantFacadeInterface getFacade()
* @method \Spryker\Zed\SalesPaymentMerchant\SalesPaymentMerchantConfig getConfig()
* @method \Spryker\Zed\SalesPaymentMerchant\Communication\SalesPaymentMerchantCommunicationFactory getFactory()()
*/
class SalesPaymentMerchantAclEntityConfigurationExpanderPlugin extends AbstractPlugin implements AclEntityConfigurationExpanderPluginInterface
{
/**
* {@inheritDoc}
* - Expands provided `AclEntityMetadataConfig` transfer object with sales payment merchant payout composite data.
*
* @api
*
* @param \Generated\Shared\Transfer\AclEntityMetadataConfigTransfer $aclEntityMetadataConfigTransfer
*
* @return \Generated\Shared\Transfer\AclEntityMetadataConfigTransfer
*/
public function expand(AclEntityMetadataConfigTransfer $aclEntityMetadataConfigTransfer): AclEntityMetadataConfigTransfer
{
$aclEntityMetadataConfigTransfer
->getAclEntityMetadataCollectionOrFail()
->addAclEntityMetadata(
'Orm\Zed\SalesPaymentMerchant\Persistence\SpySalesPaymentMerchantPayout',
(new AclEntityMetadataTransfer())
->setEntityName('Orm\Zed\SalesPaymentMerchant\Persistence\SpySalesPaymentMerchantPayout')
->setParent((new AclEntityParentMetadataTransfer())->setEntityName('Orm\Zed\Merchant\Persistence\SpyMerchant'))
->setIsSubEntity(true),
)
->addAclEntityMetadata(
'Orm\Zed\SalesPaymentMerchant\Persistence\SpySalesPaymentMerchantPayoutReversal',
(new AclEntityMetadataTransfer())
->setEntityName('Orm\Zed\SalesPaymentMerchant\Persistence\SpySalesPaymentMerchantPayoutReversal')
->setParent((new AclEntityParentMetadataTransfer())->setEntityName('Orm\Zed\Merchant\Persistence\SpyMerchant'))
->setIsSubEntity(true),
);

return $aclEntityMetadataConfigTransfer;
}
}

0 comments on commit 5a56b33

Please sign in to comment.