Class: Stripe::InvoiceRenderingTemplateService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/invoice_rendering_template_service.rb

Defined Under Namespace

Classes: ArchiveParams, ListParams, RetrieveParams, UnarchiveParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance 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.



63
64
65
66
67
68
69
70
71
# File 'lib/stripe/services/invoice_rendering_template_service.rb', line 63

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

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

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



74
75
76
77
78
79
80
81
82
# File 'lib/stripe/services/invoice_rendering_template_service.rb', line 74

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/invoice_rendering_templates",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(template, params = {}, opts = {}) ⇒ Object

Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions.



85
86
87
88
89
90
91
92
93
# File 'lib/stripe/services/invoice_rendering_template_service.rb', line 85

def retrieve(template, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/invoice_rendering_templates/%<template>s", { template: CGI.escape(template) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

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



96
97
98
99
100
101
102
103
104
# File 'lib/stripe/services/invoice_rendering_template_service.rb', line 96

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