Class: Stripe::InvoiceRenderingTemplate

Inherits:
APIResource show all
Extended by:
APIOperations::List
Defined in:
lib/stripe/resources/invoice_rendering_template.rb

Constant Summary collapse

OBJECT_NAME =
"invoice_rendering_template"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

list

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Class Method Details

.archive(template, params = {}, opts = {}) ⇒ Object

Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.



24
25
26
27
28
29
30
31
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 24

def self.archive(template, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/invoice_rendering_templates/%<template>s/archive", { template: CGI.escape(template) }),
    params: params,
    opts: opts
  )
end

.list(filters = {}, opts = {}) ⇒ Object

List all templates, ordered by creation date, with the most recently created template appearing first.



34
35
36
37
38
39
40
41
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 34

def self.list(filters = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/invoice_rendering_templates",
    params: filters,
    opts: opts
  )
end

.object_nameObject



9
10
11
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 9

def self.object_name
  "invoice_rendering_template"
end

.unarchive(template, params = {}, opts = {}) ⇒ Object

Unarchive an invoice rendering template so it can be used on new Stripe objects again.



54
55
56
57
58
59
60
61
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 54

def self.unarchive(template, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/invoice_rendering_templates/%<template>s/unarchive", { template: CGI.escape(template) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#archive(params = {}, opts = {}) ⇒ Object

Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.



14
15
16
17
18
19
20
21
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 14

def archive(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/invoice_rendering_templates/%<template>s/archive", { template: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#unarchive(params = {}, opts = {}) ⇒ Object

Unarchive an invoice rendering template so it can be used on new Stripe objects again.



44
45
46
47
48
49
50
51
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 44

def unarchive(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/invoice_rendering_templates/%<template>s/unarchive", { template: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end