Class: Stripe::InvoiceRenderingTemplate
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::InvoiceRenderingTemplate
- Extended by:
- APIOperations::List
- Defined in:
- lib/stripe/resources/invoice_rendering_template.rb
Overview
Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates can be created from within the Dashboard, and they can be used over the API when creating invoices.
Constant Summary collapse
- OBJECT_NAME =
"invoice_rendering_template"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#nickname ⇒ Object
readonly
A brief description of the template, hidden from customers.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#status ⇒ Object
readonly
The status of the template, one of ‘active` or `archived`.
-
#version ⇒ Object
readonly
Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.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.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
List all templates, ordered by creation date, with the most recently created template appearing first.
- .object_name ⇒ Object
-
.unarchive(template, params = {}, opts = {}) ⇒ Object
Unarchive an invoice rendering template so it can be used on new Stripe objects again.
Instance Method Summary collapse
-
#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.
-
#unarchive(params = {}, opts = {}) ⇒ Object
Unarchive an invoice rendering template so it can be used on new Stripe objects again.
Methods included from APIOperations::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
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, 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
Instance Attribute Details
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
16 17 18 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 16 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
18 19 20 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 18 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
20 21 22 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 20 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
22 23 24 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 22 def @metadata end |
#nickname ⇒ Object (readonly)
A brief description of the template, hidden from customers
24 25 26 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 24 def nickname @nickname end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
26 27 28 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 26 def object @object end |
#status ⇒ Object (readonly)
The status of the template, one of ‘active` or `archived`.
28 29 30 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 28 def status @status end |
#version ⇒ Object (readonly)
Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering
30 31 32 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 30 def version @version end |
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.
43 44 45 46 47 48 49 50 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 43 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 |
.field_remappings ⇒ Object
86 87 88 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 86 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
82 83 84 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 82 def self.inner_class_types @inner_class_types = {} end |
.list(params = {}, opts = {}) ⇒ Object
List all templates, ordered by creation date, with the most recently created template appearing first.
53 54 55 56 57 58 59 60 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 53 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/invoice_rendering_templates", params: params, opts: opts ) end |
.object_name ⇒ Object
11 12 13 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 11 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.
73 74 75 76 77 78 79 80 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 73 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.
33 34 35 36 37 38 39 40 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 33 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.
63 64 65 66 67 68 69 70 |
# File 'lib/stripe/resources/invoice_rendering_template.rb', line 63 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 |