Download the PHP package tapbuy/checkout-graphql without Composer
On this page you can find all versions of the php package tapbuy/checkout-graphql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tapbuy/checkout-graphql
More information about tapbuy/checkout-graphql
Files in tapbuy/checkout-graphql
Package checkout-graphql
Short Description Tapbuy checkout module for Magento 2 GraphQL
License OSL-3.0
Informations about the package checkout-graphql
Tapbuy CheckoutGraphql Module
A Magento 2 GraphQL extension that provides enhanced checkout functionality with token-based authorization for secure access to customer, order, and payment data.
Overview
The Tapbuy CheckoutGraphql module extends Magento 2's native GraphQL API with additional resolvers and functionality specifically designed for checkout processes. It includes robust token-based authorization to ensure secure access to sensitive data.
Features
GraphQL Queries
- Customer Search: Search for customers by email address
- Order Retrieval: Get order details by order number (including guest orders)
- Enhanced Customer Data: Additional customer fields with custom resolvers
GraphQL Mutations
- Order Assignment: Assign a previously guest order to an existing customer account
- Cart Unlock: Reactivate a locked cart and reset its associated order status
- Cart Deactivation: Disable an active cart to prevent further checkout actions
GraphQL Types
- Customer Extensions: Additional customer fields like
tapbuy_customer_id - Order Extensions: Enhanced order data including custom shipping assignments and state information
- Payment Method Extensions: Detailed payment information including additional data
- Address Extensions: Extended address information with entity IDs
Security
- Token-based Authorization: Secure API access using OAuth tokens
- Integration Permissions: Granular permission checking based on integration settings
- Resource-based Access Control: Different permission levels for different operations
Installation
-
Copy the module to your Magento installation:
-
Enable the module:
-
Run setup upgrade:
-
Compile DI:
- Clear cache:
Configuration
Token Authorization Setup
- Create Integration: Go to System → Extensions → Integrations in Magento Admin
- Configure Permissions: Assign appropriate permissions:
Magento_Customer::customer- For customer operationsMagento_Sales::actions_view- For order operations
- Generate Tokens: Activate the integration to generate access tokens
Required Permissions
The module requires the following ACL resources:
Magento_Customer::customer- Customer data accessMagento_Sales::actions_view- Order data accessMagento_Backend::adminorMagento_Backend::all- Full admin access (alternative)
Usage
Authentication
All GraphQL queries require a Bearer token in the Authorization header:
GraphQL Queries
Search Customer by Email
Get Order by Number
Takes
order_numberororder_id
GraphQL Mutations
Assign Guest Order to Customer
order_idaccepts either the order entity ID or its increment ID. Useorder_identifier_type(auto,entity_id, orincrement_id) to disambiguate when necessary. The order email must match the customer's email address before assignment.
Unlock Cart
Supply either a masked or numeric cart ID;
unlock_reasonis optional and impacts the resulting order status.
Deactivate Cart
Payment Method Integration
The module includes a plugin for SetPaymentMethodOnCart that handles additional Tapbuy payment information:
Architecture
Authorization Flow
- Token Extraction: Extract Bearer token from Authorization header
- Token Validation: Validate token against Magento's OAuth system
- Integration Check: Verify integration status and permissions
- Resource Authorization: Check specific ACL resource permissions
- Data Access: Allow or deny access based on authorization results
File Structure
Error Handling
The module provides comprehensive error handling:
- Authorization Errors: Clear messages for token and permission issues
- Validation Errors: Input validation with descriptive error messages
- Not Found Errors: Appropriate responses for missing entities
- Logging: Error logging for debugging purposes
Security Considerations
- Token Validation: All requests validate OAuth tokens
- Permission Checking: Granular ACL resource checking
- Input Sanitization: Proper validation of all input parameters
- Error Disclosure: Minimal error information disclosure
Development
Adding New Resolvers
- Create resolver class in
Model/Resolver/ - Implement
ResolverInterface - Add authorization check using
TokenAuthorization - Register in
etc/di.xml - Define schema in
etc/schema.graphqls
Extending Authorization
The TokenAuthorization class can be extended to support additional authorization mechanisms or custom permission logic.
Troubleshooting
Common Issues
-
"Token is required" Error
- Ensure Authorization header is present
- Verify Bearer token format
-
"Invalid token" Error
- Check token validity in Magento Admin
- Regenerate integration tokens if needed
-
"You do not have permission" Error
- Verify integration permissions
- Check ACL resource assignments
- "Order not found" Error
- Verify order number exists
Development
Running Tests
Tests run inside a Docker container that replicates the CI environment (PHP 8.3, Magento 2.4.7-p5). Docker must be running.
Prerequisites: clone the following sibling repository next to this one:
First-time setup:
Run all unit tests:
On the first run, the Docker image is built and Magento is installed into a named volume (tapbuy-magento-2.4.7-p5-php83). Subsequent runs reuse the cached volume and are fast.
Do not use
composer test— it runs PHPUnit without the Magento bootstrap and will fail or produce misleading results.
Linting
Linting runs PHPMD and PHPCS (Magento2 standard) inside the same Docker container as tests. Docker must be running.
Run both linters:
Run individually:
Both linters always run when using make lint; if either fails, the command exits with a non-zero code.
- Check order visibility settings
All versions of checkout-graphql with dependencies
magento/framework Version ^103.0
magento/module-graph-ql Version ^100.4
magento/module-quote Version ^101.2
magento/module-quote-graph-ql Version ^100.4
magento/module-sales Version ^103.0
magento/module-sales-graph-ql Version ^100.4
magento/module-customer Version ^103.0
tapbuy/redirect-tracking Version ^1.8.0