Move increment_payment_attempt to API namespace and update JavaScript
- Add API route for increment_payment_attempt in config/routes.rb - Update API OrdersController to handle increment_payment_attempt and skip API key authentication - Update JavaScript code in checkout view to use API endpoint without CSRF tokens - Remove CSRF token from API requests as it's not required for API endpoints - Maintain backward compatibility by keeping original method in OrdersController
This commit is contained in:
@@ -97,6 +97,14 @@ Rails.application.routes.draw do
|
||||
post :store_cart
|
||||
end
|
||||
end
|
||||
|
||||
# RESTful routes for order management
|
||||
resources :orders, only: [] do
|
||||
member do
|
||||
patch :increment_payment_attempt
|
||||
end
|
||||
end
|
||||
|
||||
# resources :ticket_types, only: [ :index, :show, :create, :update, :destroy ]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user