lib/stripe/resources/source.rb in stripe-10.8.0.pre.beta.1 vs lib/stripe/resources/source.rb in stripe-10.8.0

- old
+ new

@@ -62,7 +62,24 @@ opts: opts ) end extend Gem::Deprecate deprecate :source_transactions, :"Source.list_source_transactions", 2020, 1 + + # Creates a new source object. + def self.create(params = {}, opts = {}) + request_stripe_object(method: :post, path: "/v1/sources", params: params, opts: opts) + end + + # Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + # + # This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + def self.update(id, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/sources/%<id>s", { id: CGI.escape(id) }), + params: params, + opts: opts + ) + end end end