Class: Spree::Api::V3::Store::DigitalsController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- BaseController
- Spree::Api::V3::Store::DigitalsController
- Defined in:
- app/controllers/spree/api/v3/store/digitals_controller.rb
Constant Summary
Constants inherited from BaseController
BaseController::RATE_LIMIT_RESPONSE
Constants included from Idempotent
Idempotent::IDEMPOTENCY_HEADER, Idempotent::IDEMPOTENCY_TTL, Idempotent::MAX_KEY_LENGTH, Idempotent::MUTATING_METHODS
Constants included from ErrorHandler
Constants included from JwtAuthentication
JwtAuthentication::JWT_AUDIENCE_ADMIN, JwtAuthentication::JWT_AUDIENCE_STORE, JwtAuthentication::JWT_ISSUER, JwtAuthentication::USER_TYPE_ADMIN, JwtAuthentication::USER_TYPE_CUSTOMER
Instance Method Summary collapse
-
#show ⇒ Object
GET /api/v3/store/digitals/:token.
Methods included from ApiKeyAuthentication
#authenticate_api_key!, #authenticate_secret_key!
Methods included from JwtAuthentication
#authenticate_user, #require_authentication!
Instance Method Details
#show ⇒ Object
GET /api/v3/store/digitals/:token
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/spree/api/v3/store/digitals_controller.rb', line 10 def show if @resource. send_data @resource.digital..download, filename: @resource.digital..filename.to_s, type: @resource.digital..content_type else render_error( code: ERROR_CODES[:digital_link_expired], message: 'Download link expired or invalid', status: :forbidden ) end end |