New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E704 Exam - Topic 8 Question 57 Discussion

Actual exam question for Adobe's AD0-E704 exam
Question #: 57
Topic #: 8
[All AD0-E704 Questions]

You are developing a new payment method. It is required that any new order created with this payment method needs to have a specific custom status. Assume the status has been added to the system already, assigned to the processing state, and the new order state for the payment method is processing. How do you set the custom status on orders placed with the new payment method?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

0/2000 characters
Eleni
3 months ago
Definitely A, it’s the cleanest solution for this scenario.
upvoted 0 times
...
Tori
3 months ago
Wait, D? That sounds complicated for just setting a status!
upvoted 0 times
...
Tequila
3 months ago
C is interesting, but I'm not sure if it's necessary for this case.
upvoted 0 times
...
Carisa
4 months ago
I think B could work too, but it feels a bit roundabout.
upvoted 0 times
...
Virgie
4 months ago
Option A seems like the most straightforward approach.
upvoted 0 times
...
Daren
4 months ago
Option D seems like it could work, but I don't recall us discussing command pools in relation to order statuses specifically.
upvoted 0 times
...
Filiberto
4 months ago
I feel like option B is too simple for this requirement. We usually need to do more than just create a system configuration option, right?
upvoted 0 times
...
Audra
4 months ago
I remember something about using di.xml for dependency injection, so option A might be the way to go, but I can't recall the exact details.
upvoted 0 times
...
Dusti
5 months ago
I think option C sounds familiar because we practiced using observers in class, but I'm not entirely sure if it's the right approach for setting a custom status.
upvoted 0 times
...
Rosio
5 months ago
I'm leaning towards option D - creating a command to set the order status. That way, I can encapsulate the logic in a reusable command and potentially expand on it later if needed. The other options seem a bit more limited in scope.
upvoted 0 times
...
Gail
5 months ago
Option A seems like the most direct way to set the custom status, by adding it as a constructor parameter. That way, I can ensure it's applied consistently across all new orders. The other options seem a bit more indirect.
upvoted 0 times
...
Rickie
5 months ago
Hmm, I'm a bit unsure about this one. I'm trying to decide between options B and C. Creating a system configuration option might be the easiest, but using an observer could give me more control. I'll need to think it through a bit more.
upvoted 0 times
...
Alesia
5 months ago
This seems like a straightforward question. I think option C looks like the best approach - creating an observer for the sales_order_set_status event and updating the status directly.
upvoted 0 times
...
Sherron
9 months ago
Hmm, I wonder if the exam will ask us to create a custom payment method too. That would be a fun twist!
upvoted 0 times
...
Hubert
10 months ago
Option A with a constructor parameter? That's a bit too much ceremony for something as simple as setting a custom order status.
upvoted 0 times
...
Yolande
10 months ago
I'm not a fan of Option B. Putting the status code in the system configuration feels like it's not tightly coupled enough to the payment method.
upvoted 0 times
Cassie
8 months ago
Yeah, I agree. Option B does seem a bit disconnected from the payment method.
upvoted 0 times
...
Lilli
8 months ago
C) Create an observer for the event sales_order_set_status, get the $status parameter and set the new status using $status->setStatus()
upvoted 0 times
...
Eun
8 months ago
A) Add a custom status code to the Magento\\Sales\\Model\\Order\\Payment class as a $newOrderStatus constructor parameter using di.xml
upvoted 0 times
...
...
Arlie
10 months ago
Option D with a custom command seems a bit overkill for this use case. Why introduce a whole new command when we can just use an observer?
upvoted 0 times
Karma
8 months ago
Option D with a custom command seems a bit overkill for this use case. Why introduce a whole new command when we can just use an observer?
upvoted 0 times
...
Nu
8 months ago
C) Create an observer for the event sales_order_set_status, get the $status parameter and set the new status using $status->setStatus()
upvoted 0 times
...
Raelene
9 months ago
B) Create a system configuration option order.status and set the status code as its value
upvoted 0 times
...
Lashawn
9 months ago
A) Add a custom status code to the Magento\\Sales\\Model\\Order\\Payment class as a $newOrderStatus constructor parameter using di.xml
upvoted 0 times
...
Alethea
10 months ago
C) Create an observer for the event sales_order_set_status, get the $status parameter and set the new status using $status->setStatus()
upvoted 0 times
...
Leontine
10 months ago
A) Add a custom status code to the Magento\\Sales\\Model\\Order\\Payment class as a $newOrderStatus constructor parameter using di.xml
upvoted 0 times
...
...
Carissa
11 months ago
I'm not sure, but I think B) Create a system configuration option order.status and set the status code as its value could also be a valid option
upvoted 0 times
...
Michel
11 months ago
Option C looks like the most straightforward way to set the custom status. I like how it uses an observer to directly interact with the order status.
upvoted 0 times
Jarod
9 months ago
Yes, it's a good practice to use observers for these types of tasks.
upvoted 0 times
...
Krissy
9 months ago
It definitely simplifies the process and keeps the code organized.
upvoted 0 times
...
Ma
10 months ago
I agree, using an observer seems like a clean way to handle it.
upvoted 0 times
...
Olene
10 months ago
I think option C is the best choice for setting the custom status.
upvoted 0 times
...
...
Malika
11 months ago
I disagree, I believe the answer is C) Create an observer for the event sales_order_set_status, get the $status parameter and set the new status using $status->setStatus()
upvoted 0 times
...
Nicolette
11 months ago
I think the correct answer is A) Add a custom status code to the Magento\\Sales\\Model\\Order\\Payment class as a $newOrderStatus constructor parameter using di.xml
upvoted 0 times
...

Save Cancel