Class: Stripe::PaymentLinkService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::PaymentLinkService
- Defined in:
- lib/stripe/services/payment_link_service.rb
Instance Attribute Summary collapse
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Creates a payment link.
-
#initialize(requestor) ⇒ PaymentLinkService
constructor
A new instance of PaymentLinkService.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your payment links.
-
#retrieve(payment_link, params = {}, opts = {}) ⇒ Object
Retrieve a payment link.
-
#update(payment_link, params = {}, opts = {}) ⇒ Object
Updates a payment link.
Methods inherited from StripeService
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_items ⇒ Object (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 |