APPLICATION-SPECIFIC DATA: A structure representing a complete AP2 payment request.
APPLICATION-SPECIFIC DATA: A structure representing an AP2 payment response.
Abstract base class for JSON serializers
Abstract base class for all mandate types Implements common functionality following SOLID principles
Abstract base class for serialization strategies
Abstract base class for validation strategies
Data key for Cart Mandate objects
The detailed contents of a cart, signed by the merchant to create a CartMandate.
Serializer for CartContents entities
Validator for CartContents entities
A cart whose contents have been digitally signed by the merchant.
Class for CartMandate with specific functionality Uses JWT for merchant_authorization as per AP2 specification
Detector for CartMandate type
Serializer for CartMandate entities
Validation strategy for CartMandate
Validator for CartMandate entities
Combine multiple validation results into one
Represents a physical address from the W3C Contact Picker API.
Input parameters for creating CartContents
Creates a new CartMandate from cart contents with validation and optional JWT signing
Creates an ISO 8601 date string for a future date
Creates a new IntentMandate with validation
Input parameters for creating an IntentMandate
Factory function to create mandate classes from existing mandate data
Create a ValidationResult object
Default singleton instance
Default singleton instance
Default singleton instance
Interface for field validators used during deserialization
EXTENSION: Payment details that use our extended item type.
This correctly extends the global PaymentDetailsInit type.
EXTENSION: An item for purchase with an added refund_period.
This correctly extends the global PaymentItem type.
Get the mandate type using the detector registry
Interface for JTI storage backend Allows for different storage implementations (memory, Redis, etc.)
Interface for JWT key management Follows Single Responsibility Principle (SRP)
Combined interface for full JWT operations Follows Interface Segregation Principle (ISP) by composing smaller interfaces
Interface for JWT signing operations Follows Single Responsibility Principle (SRP)
Interface for JWT verification operations Follows Single Responsibility Principle (SRP)
Data key for Intent Mandate objects
Represents the user's purchase intent.
Class for IntentMandate with specific functionality
Detector for IntentMandate type
Serializer for IntentMandate entities
Validation strategy for IntentMandate
Validator for IntentMandate entities
Type guard to check if a mandate is a CartMandate
Checks if a mandate has expired based on its expiry date
Type guard to check if a mandate is an IntentMandate
Validates if a string is a valid ISO 8601 date
JOSE-based JWT Key Manager Implementation Follows Single Responsibility Principle (SRP)
Complete JOSE-based JWT Service Implementation Follows Dependency Inversion Principle (DIP) by depending on abstractions
JOSE-based JWT Signer Implementation Follows Single Responsibility Principle (SRP)
JOSE-based JWT Verifier Implementation with Comprehensive Validation Follows Single Responsibility Principle (SRP) with enhanced security
JTI Validator implementation Prevents JWT replay attacks by tracking used JWT IDs
Supported JWT algorithms for AP2 protocol
JWT Key configuration
Base error class for all JWT service-related errors. Allows consumers to catch any error originating from this service.
Thrown when the JWT signing process fails.
Thrown for catastrophic failures during the verification process. Note: Standard validation failures (e.g., bad signature) are returned in the result object, not thrown.
JWT verification result
Thrown when there is an issue with cryptographic key generation, validation, or formatting.
Union type representing any type of mandate in the AP2 protocol.
Union type of all mandate data keys
Interface for mandate serialization strategies
Registry for mandate serialization strategies
Possible states for a mandate
Enumeration of supported mandate types
Registry for mandate type detectors
Interface for mandate validation strategies
Registry for mandate validation strategies
In-memory JTI storage implementation Suitable for single-instance deployments or testing
Parses an ISO 8601 date string and returns a Date object
Data key for Payment Mandate objects
Contains the total and line items for a payment request
Contains the user's instructions & authorization for payment
Class for PaymentMandate with user authorization functionality
The data contents of a PaymentMandate
PaymentMandateContents Class Follows Single Responsibility Principle (SRP) for managing payment mandate contents
Validator for PaymentMandateContents entities
Detector for PaymentMandate type
Serializer for PaymentMandate entities
Possible states for a payment mandate
Validator for PaymentMandate entities
Configuration options for payment request information collection
Serializer for PaymentRequest entities
Validator for PaymentRequest entities
Represents a shipping option with cost and selection state
Combined serializer/deserializer interface