Sha256: 8e8ff6605f946d7fd8df9b364cb13ca8934af5d36756bd738cd35b7d2526aaa1
Contents?: true
Size: 1.41 KB
Versions: 29
Compression:
Stored size: 1.41 KB
Contents
module Spree module Api module V2 module Storefront module Account class CreditCardsController < ::Spree::Api::V2::ResourceController before_action :require_spree_current_user def destroy spree_authorize! :destroy, resource, resource destroy_service.call(card: resource) end private def resource params[:id].eql?('default') ? scope.default.first! : scope.find(params[:id]) end def model_class Spree::CreditCard end def scope super.not_expired.not_removed.where( user: spree_current_user, payment_method: current_store.payment_methods.available_on_front_end ) end def collection_serializer Spree::Api::Dependencies.storefront_credit_card_serializer.constantize end def collection_finder Spree::Api::Dependencies.storefront_credit_card_finder.constantize end def resource_serializer Spree::Api::Dependencies.storefront_credit_card_serializer.constantize end def destroy_service Spree::Api::Dependencies.storefront_credit_cards_destroy_service.constantize end end end end end end end
Version data entries
29 entries across 29 versions & 3 rubygems