exam questions

Exam AD0-E718 All Questions

View all questions & answers for the AD0-E718 exam

Exam AD0-E718 topic 1 question 24 discussion

Actual exam question from Adobe's AD0-E718
Question #: 24
Topic #: 1
[All AD0-E718 Questions]

While reviewing a newly developed pull request that refactors multiple custom payment methods, the Architect notices multiple classes that depend on \Magento\Framework\Encryption\EncryptorInterface to decrypt credentials for sensitive data.
The code that is commonly repeated is as follows:

In each module, the user_secret config is declared as follows:

The Architect needs to recommend an optimal solution to avoid redundant dependency and duplicate code among the methods.
Which solution should the Architect recommend?

  • A. Replace all Vendor\PaymentModule\Gateway\Config classes with virtualType of Magento\Payment\Gateway\Config\Config and set <user_secret backend_model=“Magento\Config\Model\Config\Backend\Encrypted” /> under config.xml
  • B. Add a plugin after the getValue method of $scopeConfig, remove the $encryptor from dependency and use it in the plugin to decrypt the value if the config name is ‘user_secret’
  • C. Create a common config service class Vendor\Payment\Gateway\Config\Config under Vendor_Payment and use it as a parent class for all of the Vendor\PaymentModule\Gateway\Config\Config classes and remove $scopeConfig and $encryptor dependencies
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
crowleymr
1 year, 4 months ago
Selected Answer: A
It is possible to define a backend model in config.xml, so when you retrieve the value by scopeConfig it will be already decrypted
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago