What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
And besides this, we wanted to know how to call a business model from Facade (for Zed), is there any
And besides this, we wanted to know how to call a business model from Facade (for Zed), is there any resource where I can refer to?
Comments
-
that does not sound right. ๐ค
0 -
can you elaborate on what you intend to do?
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
I think that something architectural is not correct..
0 -
@UJN2JRU4F @UL65CH0MC thank you for the comments.
I have intended to inject the custom transaction comments in the order history page like in payment section for both Zed & Yves.
Zed:
/vendor/spryker/payment/src/Spryker/Zed/Payment/Communication/Controller/SalesController.php$testPaymentClient = new TestPaymentClient();
$orderTransfer = $testPaymentClient->getTransactionDetails($orderTransfer);
Yves:
/vendor/spryker-shopcustomer-page/src/SprykerShop/Yves/CustomerPage/Controller/OrderController.phpFor that, I have injected the custom comments object in $orderTransfer and used the same in twig files. It's working fine, but maybe it's not right to create objects directly in the mentioned classes?
Target: I want to display the custom comments for the transaction in the order history of backend and frontend.
So, could you please share your feedback to handle this scenario in the right way?
0 -
@UJN2JRU4F @UL65CH0MC May I politely ask for the feedback on this topic?
0 -
i will try to mentally entagle after my next meeting in about 1h ๐
0 -
Sorry, took a bit longer. I think I got it. And the approach does not sound wrong. However, you add the comments to the order when you read it from Zed. I need to have a look how the order hydration works exactly, but I'm fairly certain that there is a plug-in stack for that
0 -
did you find what i am talking about, @U01HX2U4NLQ?
0 -
Thank you for the valuable details. In the meanwhile, we started to work on the development to achieve the mentioned requirement. We managed to pull off a solution based on the below-mentioned code, please let me know if this is fine too.
/**
* @method \Spryker\Zed\Payment\Persistence\PaymentQueryContainerInterface getQueryContainer()
* @method \Spryker\Zed\Payment\Business\PaymentFacadeInterface getFacade()
* @method \Spryker\Zed\Payment\Persistence\PaymentRepositoryInterface getRepository()
. . .
* @method \Spryker\Zed\Payment\Communication\PaymentCommunicationFactory getFactory()
. . .
*/
public function listAction(Request $request)
{
/** @var \Generated\Shared\Transfer\OrderTransfer $orderTransfer */
$orderTransfer = $request->request->get('orderTransfer');
. . .
// Set test payment transaction details in orderTransfer
$orderTransfer = $this->getFactory()
->getTestPaymentFacade()
->getTransactionDetails($orderTransfer);
. . .
return [
'payments' => $orderTransfer->getPayments(),
'order' => $orderTransfer,
];
}
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
@U01HX2U4NLQ About me so is not correct...
U have to write a hydrator plugin in your TestPayment Bundle... this hydrator plugin hydrate the transaction details in order transfer.. this plugin should be registered in SalesDependencyProvider..\Pyz\Zed\Sales\SalesDependencyProvider::getOrderHydrationPlugins
then u have overall u get an orderTransfer always the transaction details filled, if the order of course has this payment as payment type related..
0 -
โ๐
0 -
What he said
0 -
Do you want us to elaborate?
0 -
@UJN2JRU4F @UL65CH0MC Thank you both for the details, it is clear now and I'm checking the module for the update related to this.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 75 Spryker News
- 924 Developer Corner
- 783 Spryker Development
- 88 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random