Class: Stripe::PaymentLinkService

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ PaymentLinkService

Returns a new instance of PaymentLinkService.



8
9
10
11
# File 'lib/stripe/services/payment_link_service.rb', line 8

def initialize(requestor)
  super(requestor)
  @line_items = Stripe::PaymentLinkLineItemService.new(@requestor)
end

Instance Attribute Details

#line_itemsObject (readonly)

Returns the value of attribute line_items.



6
7
8
# File 'lib/stripe/services/payment_link_service.rb', line 6

def line_items
  @line_items
end

Instance Method Details

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

Creates a payment link.



14
15
16
17
18
19
20
21
22
# File 'lib/stripe/services/payment_link_service.rb', line 14

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/payment_links",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Returns a list of your payment links.



25
26
27
28
29
30
31
32
33
# File 'lib/stripe/services/payment_link_service.rb', line 25

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

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

Retrieve a payment link.



36
37
38
39
40
41
42
43
44
# File 'lib/stripe/services/payment_link_service.rb', line 36

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

#update(payment_link, params = {}, opts = {}) ⇒ Object

Updates a payment link.



47
48
49
50
51
52
53
54
55
# File 'lib/stripe/services/payment_link_service.rb', line 47

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