Adobe AD0-E722 Real Exam Questions
The questions for AD0-E722 were last updated at Dec 30,2024.
- Exam Code: AD0-E722
- Exam Name: Adobe Commerce Architect Master
- Certification Provider: Adobe
- Latest update: Dec 30,2024
An Adobe Commerce Architect needs to customize the workflow of a monthly installments payment extension. The extension is from a partner who is contracted with the default website Payment Service Provider (PSP), which has its own legacy extension (a module using deprecated payment method).
The installment payment partner manages only initializing a payment, and then hands the capture to be executed by the PSP Once the amount is successfully captured, the PSP notifies the website through a webhook. The goal of the webhook is only to create an "invoice" and save the "capture information" to be used later for refund requests through the PSP itself.
The Architect needs the most simple solution to capture the requested behavior.
Which solution should the Architect implement?
- A . Add a plugin before the $invoice->capture() and change Its input to prevent the call of the $Payment->capture()
- B . Change the can_capture attribute for the payment method under config.xml to be <can_capture>0</can_capture>
- C . Declare a capture Command with type MagentoPaymentGatewayCommandNullCommand for the payment method CommandPool in di.xml
C
Explanation:
Option C is the correct solution because declaring a capture command with type MagentoPaymentGatewayCommandNullCommand for the payment method command pool in di.xml will prevent the default capture logic from being executed. The NullCommand class is a dummy implementation of the CommandInterface that does nothing. This way, the payment capture will be handled by the PSP webhook, and the invoice will be created accordingly12
Option A is not a correct solution because adding a plugin before the $invoice->capture() and changing its input to prevent the call of the $payment->capture() will require modifying the core Magento code, which is not recommended. Moreover, this solution will affect all payment methods that use the invoice capture logic, not just the monthly installments payment extension3
Option B is not a correct solution because changing the can_capture attribute for the payment method under config.xml to be <can_capture>0</can_capture> will disable the capture functionality for the payment method entirely. This means that the invoice cannot be created or captured, even by the PSP webhook4
Reference:
1: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/payments-integrations/payment-gateway/gateway-command.html?lang=en
2: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Payment/Gateway/Command/NullCommand.php
3: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/customization/best-practices.html?lang=en#do-not-modify-core-code
4: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/payments-integrations/payment-gateway/payment-gateway-configuration.html?lang=en#payment-method-configuration
A company wants to build an Adobe Commerce website to sell their products to customers in their country. The taxes in their country are highly complex and require customization to Adobe Commerce. An Architect is trying to solve this problem by creating a custom tax calculator that will handle the calculation of taxes for all orders in Adobe Commerce.
Following best practices, how should the Architect add the taxes for all orders?
- A . Add a new observer to the event sales.quote.collecLtotals.before” and add the custom tax to the quote
- B . Write a before plugin to MagentoQuoteModelQuoteManagement::placeOrder() and add the custom tax to the quote
- C . Declare a new total collector in "etc/sales.xmr in a custom module
C
Explanation:
According to the Adobe Commerce documentation, the best way to add a custom tax calculation to all orders is to declare a new total collector in the “etc/sales.xml” file of a custom module. This way, the custom tax logic can be implemented in a separate class that extends the MagentoQuoteModelQuoteAddressTotalAbstractTotal class and overrides the collect() and fetch() methods. The collect() method is responsible for calculating the tax amount and adding it to the quote address, while the fetch() method is responsible for displaying the tax amount in the cart and checkout pages. The new total collector can be assigned to any area of the order totals, such as before or after the subtotal, shipping, or grand total.
Reference: Customizing order totals
How to add custom fee or discount to order totals in Magento 2
A third-party company needs to create an application that will integrate the Adobe Commerce system to get orders data for reporting. The integration needs access to the GET /Vl/orders endpoint. It will call this endpoint automatically every hour around the clock. The merchant wants the ability to restrict or extend access to resources as well as to revoke the access using Admin Panel.
Which type of authentication available in Adobe Commerce should be used and implemented in a third-party system for this integration?
- A . Use token-based authentication to obtain the Admin Token. The third-party system will utilize the REST endpoint using the admin username and password to get the Admin Token, which will be used as the Bearer Token to authorize.
- B . Use token-based authentication to obtain an integration Token, integration will be created and activated in the admin panel using default integration token settings to get access to the token, which will be used as the Bearer Token to authorize.
- C . Use OAuth-based authentication to provide access to system resources. Integration will be registered by the merchant in the admin panel with an OAuth handshake during activation. The third-party system should follow OAuth protocol to authorize.
C
Explanation:
According to the Adobe Commerce documentation, OAuth-based authentication is the recommended method for integrations that need access to system resources, such as orders, customers, products, etc. OAuth-based authentication allows the merchant to control the access level and scope of the integration, as well as to revoke the access at any time using the admin panel. OAuth-based authentication also requires an OAuth handshake between the integration and the Adobe Commerce system during activation, which ensures a secure exchange of tokens and keys. The third-party system should follow the OAuth protocol to obtain and refresh the access token, which will be used as the Bearer Token to authorize the REST API calls.
Reference: Authentication | Adobe Commerce Developer Guide OAuth-based authentication | Adobe Commerce Developer Guide
An Adobe Commerce Architect is investigating a case where some EAV product attributes are no longer updated.
• The catalog is composed of 20.000 products with 100 attributes each.
• The product updates are run by recurring Adobe commerce imports that happen multiple times a day.
• The Architect finds an error in the logs that indicates an integrity constraint while trying to insert row with id 2147483647.
What is causing this error?
- A . Magento framework uses INSERT on DUPLICATE, which leads to reaching the max limit of the increment of the column.
- B . Integrity constraints were dropped after upgrading to the latest version, and the integrity checks were missed.
- C . EAV attribute import uses REPLACE, which leads to reaching the max limit of the increment of the column
A
Explanation:
The error with the id 2147483647 is indicative of an integer overflow issue. This number is the maximum value for a signed 32-bit integer, and attempting to insert or increment beyond this value would cause an error due to exceeding the column’s data type limits.
Magento framework uses INSERT ON DUPLICATE KEY UPDATE on some of its operations, which could lead to auto-increment values being increased even when rows are not actually inserted but updated. If the table’s auto-increment column is of type INT and it reaches the maximum value of 2147483647, it will cause an integrity constraint violation on the next insert attempt.
Dropping integrity constraints would not typically result in an auto-increment issue, although it might lead to other types of integrity constraint violations. This would not directly cause the specific error of exceeding the maximum integer value.
The EAV attribute import using REPLACE could lead to auto-increment values increasing, as REPLACE first deletes the old row and then inserts a new one, causing the auto-increment ID to increment. However, this behavior is more commonly associated with MySQL’s behavior rather than specifically with Adobe Commerce’s EAV attribute import.
Given these options, the most likely cause of the error is:
An Adobe Commerce Architect designs a data flow that contains a new product type with its own custom pricing logic to meet a merchant requirement.
Which three steps are required when adding a product type with custom pricing? (Choose three.)
- A . Content of the etc/product_types.xml file
- B . Data patch to register the new product type
- C . Hydrator for attributes belonging to the new product type
- D . New price model extending MagentoCatalogModelProductTypePrice
- E . Custom type model extended from the abstract Product Type model
- F . A new class with custom pricing logic, extending the abstract Product model class
ADE
Explanation:
To add a product type with custom pricing, the Architect needs to do the following steps:
Create a content of the etc/product_types.xml file that defines the new product type, its label, model, index priority, and price model. This file is used to register the new product type and its associated classes in Magento1.
Create a new price model that extends MagentoCatalogModelProductTypePrice and implements the custom pricing logic for the new product type. The price model is responsible for calculating the final price of the product based on various factors, such as special price, tier price, catalog price rules, etc2.
Create a custom type model that extends from the abstract Product Type model (MagentoCatalogModelProductTypeAbstractType) and overrides the methods related to the product type behavior, such as prepareForCart, getAssociatedProducts, etc. The type model defines how the product type interacts with other components, such as quote, order, cart, etc3.
Reference:
How to add a new product type in Magento 2? (MageStackDay mystery question 1) – Magento Stack Exchange
Magento 2: How to create custom product types – BelVG Blog
Magento 2: How to create custom product types – BelVG Blog