# File generated from our OpenAPI spec # frozen_string_literal: true module Stripe module Issuing # You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. class Card < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List include Stripe::APIOperations::Save OBJECT_NAME = "issuing.card" def self.object_name "issuing.card" end # Creates an Issuing Card object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/issuing/cards", params: params, opts: opts) end # Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/issuing/cards", params: filters, opts: opts) end # Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/cards/%s", { id: CGI.escape(id) }), params: params, opts: opts ) end def test_helpers TestHelpers.new(self) end class TestHelpers < APIResourceTestHelpers RESOURCE_CLASS = Card def self.resource_class "Card" end # Updates the shipping status of the specified Issuing Card object to delivered. def self.deliver_card(card, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/deliver", { card: CGI.escape(card) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to delivered. def deliver_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/deliver", { card: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to failure. def self.fail_card(card, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/fail", { card: CGI.escape(card) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to failure. def fail_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/fail", { card: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to returned. def self.return_card(card, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/return", { card: CGI.escape(card) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to returned. def return_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/return", { card: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to shipped. def self.ship_card(card, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/ship", { card: CGI.escape(card) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to shipped. def ship_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/ship", { card: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. def self.submit_card(card, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/submit", { card: CGI.escape(card) }), params: params, opts: opts ) end # Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. def submit_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, path: format("/v1/test_helpers/issuing/cards/%s/shipping/submit", { card: CGI.escape(@resource["id"]) }), params: params, opts: opts ) end end end end end