Sha256: 97cba67c9b616abcc77baca2782a44ebf183fb9202a3cef9362f864f3726d641
Contents?: true
Size: 1.2 KB
Versions: 39
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true module Stripe class Source < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Save OBJECT_NAME = "source".freeze def detach(params = {}, opts = {}) if !respond_to?(:customer) || customer.nil? || customer.empty? raise NotImplementedError, "This source object does not appear to be currently attached " \ "to a customer object." end url = "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" resp, opts = request(:delete, url, params, Util.normalize_opts(opts)) initialize_from(resp.data, opts) end def delete(params = {}, opts = {}) detach(params, opts) end extend Gem::Deprecate deprecate :delete, "#detach", 2017, 10 def source_transactions(params = {}, opts = {}) resp, opts = request(:get, resource_url + "/source_transactions", params, Util.normalize_opts(opts)) Util.convert_to_stripe_object(resp.data, opts) end def verify(params = {}, opts = {}) resp, opts = request(:post, resource_url + "/verify", params, Util.normalize_opts(opts)) initialize_from(resp.data, opts) end end end
Version data entries
39 entries across 39 versions & 1 rubygems