module Cardflex class Subscription include BaseModule module Type Delete = 'delete_subscription' end attr_reader :result, :result_text, :result_code, :action_type attr_reader :subscription_id attr_reader :type, :plan, :billing, :shipping def initialize(gateway, attributes) @gateway = gateway @type = attributes[:action_type] set_instance_variables_from_hash(attributes) end def self.delete(subscription_id) attributes = { :delete_subscription => { :subscription_id => subscription_id }} Configuration.gateway.subscription.request(attributes) end end end