Skip to content

Fix Place Order API Flow and Improve Payment Validation#579

Open
rohansingh754 wants to merge 1 commit intobagisto:mainfrom
rohansingh754:place-order-api-enhace
Open

Fix Place Order API Flow and Improve Payment Validation#579
rohansingh754 wants to merge 1 commit intobagisto:mainfrom
rohansingh754:place-order-api-enhace

Conversation

@rohansingh754
Copy link
Contributor

Improves the Place Order API by restructuring the order creation flow and enhancing payment validation. The changes ensure better reliability, extensibility, and consistency across the order and invoice processes.

Key Changes

  • Refactored the order creation flow to validate payment before creating the order
  • Introduced a new event hook to allow custom packages to manage or extend the order flow
  • Updated the invoice creation flow for better separation of responsibilities
  • Removed payment validation logic from the invoice creation method

Benefits

  • Prevents orders from being created when payment validation fails
  • Provides a more flexible and extensible order flow for custom integrations
  • Improves code maintainability and clarity
  • Reduces the risk of duplicate or misplaced payment validation

Testing

  • Verified successful order creation with valid payments
  • Confirmed that orders are not created when payment validation fails
  • Tested invoice generation after successful order placement

- Refactored order creation flow to validate payment before creating the order.
- Added event to allow custom packages to handle the order flow.
- Updated invoice creation process.
- Removed payment validation from the invoice creation method.
- Updated all locals.
@rohansingh754
Copy link
Contributor Author

Issue: #574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant