Sha256: b0599e16b458c7518a150df4ab32c87ed41d422d913c5fd2e830c268769f7b3e

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  class PaymentLinkService < StripeService
    attr_reader :line_items

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

    # Creates a payment link.
    def create(params = {}, opts = {})
      request(
        method: :post,
        path: "/v1/payment_links",
        params: params,
        opts: opts,
        base_address: :api
      )
    end

    # Returns a list of your payment links.
    def list(params = {}, opts = {})
      request(
        method: :get,
        path: "/v1/payment_links",
        params: params,
        opts: opts,
        base_address: :api
      )
    end

    # Retrieve a payment link.
    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

    # Updates a payment link.
    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
stripe-13.3.0.pre.beta.1 lib/stripe/services/payment_link_service.rb
stripe-13.2.0 lib/stripe/services/payment_link_service.rb
stripe-13.1.2 lib/stripe/services/payment_link_service.rb
stripe-13.2.0.pre.beta.3 lib/stripe/services/payment_link_service.rb
stripe-13.2.0.pre.beta.2 lib/stripe/services/payment_link_service.rb
stripe-13.1.1 lib/stripe/services/payment_link_service.rb
stripe-13.2.0.pre.beta.1 lib/stripe/services/payment_link_service.rb
stripe-13.1.0 lib/stripe/services/payment_link_service.rb
stripe-13.0.2 lib/stripe/services/payment_link_service.rb
stripe-13.1.0.pre.beta.3 lib/stripe/services/payment_link_service.rb
stripe-13.0.1 lib/stripe/services/payment_link_service.rb
stripe-13.1.0.pre.beta.2 lib/stripe/services/payment_link_service.rb
stripe-13.0.0 lib/stripe/services/payment_link_service.rb