Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E704 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:

Sherron
18 days 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
20 days 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
23 days 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
...
Arlie
2 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
Lashawn
2 days 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
20 days 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
26 days 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
2 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
2 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
13 days ago
Yes, it's a good practice to use observers for these types of tasks.
upvoted 0 times
...
Krissy
18 days ago
It definitely simplifies the process and keeps the code organized.
upvoted 0 times
...
Ma
20 days ago
I agree, using an observer seems like a clean way to handle it.
upvoted 0 times
...
Olene
1 months ago
I think option C is the best choice for setting the custom status.
upvoted 0 times
...
...
Malika
2 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
2 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