Loki_AgenticCommerceAp2
What this module does
Adds Agent Payments Protocol (AP2) payment mandate verification to Loki_AgenticCommerce.
AP2 travels inside other protocols, so this module does not add endpoints. Instead it plugs into the core:
Mandate\PaymentMandateValidator(aPaymentAuthorizationValidatorInterface) checks the mandate ID, currency, total (in minor units) and expiry against the cart, then verifies the user authorization.Observer\StoreMandateReferencestoresap2_payment_mandate_idin the order payment's additional information.Observer\AddUcpCapabilityadvertisesdev.ucp.shopping.ap2_mandatein the UCP profile (through an event, without a dependency on the UCP module).
Both ACP and UCP pass an ap2 object of the complete request on as mandate.
Signature verification
Verifying the user_authorization credential depends on your trust framework. Provide an implementation of
Loki\AgenticCommerceAp2\Api\MandateSignatureVerifierInterface via a DI preference. The default implementation rejects
every mandate, unless Allow Unverified Mandates is switched on (development only).
Configuration
Stores > Configuration > Loki > Loki Agentic Commerce > Agent Payments Protocol (AP2)
- Enabled
- Require Mandate: reject agentic orders without a mandate
- Allow Unverified Mandates: development only
Installation
Install this package via composer:
composer require loki/magento2-agentic-commerce-ap-2
Next, enable this module:
bin/magento module:enable Loki_AgenticCommerceAp2
Current status
@dev
to the composer command.
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-extensions/Loki_AgenticCommerceAp2.git
Composer details
Loki_AgenticCommerceAp2loki/magento2-agentic-commerce-ap-2
php: >=8.2 <8.6
loki/magento2-agentic-commerce: @dev | >=0.0.1
magento/framework: ^103.0
magento/module-quote: ^101.2
magento/module-sales: ^103.0
magento/module-store: ^101.1
Releases
Changelog
Added
- Initial implementation