Sha256: 739a5e4ed3ac4a860b3ea9daa55bca99dacae84c187d095d8353c9e05ec183df

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Stripe
  class AlipayAccount < APIResource
    include Stripe::APIOperations::Save
    include Stripe::APIOperations::Delete

    OBJECT_NAME = "alipay_account".freeze

    def resource_url
      if !respond_to?(:customer) || customer.nil?
        raise NotImplementedError,
              "Alipay accounts cannot be accessed without a customer ID."
      end

      "#{Customer.resource_url}/#{CGI.escape(customer)}/sources" \
      "/#{CGI.escape(id)}"
    end

    def self.update(_id, _params = nil, _opts = nil)
      raise NotImplementedError,
            "Alipay accounts cannot be updated without a customer ID. " \
            "Update an Alipay account using `Customer.update_source(" \
            "'customer_id', 'alipay_account_id', update_params)`"
    end

    def self.retrieve(_id, _opts = nil)
      raise NotImplementedError,
            "Alipay accounts cannot be retrieved without a customer ID. " \
            "Retrieve an Alipay account using `Customer.retrieve_source(" \
            "'customer_id', 'alipay_account_id')`"
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
stripe-4.24.0 lib/stripe/resources/alipay_account.rb
stripe-4.23.0 lib/stripe/resources/alipay_account.rb
stripe-4.22.1 lib/stripe/resources/alipay_account.rb
stripe-4.22.0 lib/stripe/resources/alipay_account.rb
bongloy-4.21.3 lib/stripe/resources/alipay_account.rb
stripe-4.21.3 lib/stripe/resources/alipay_account.rb
stripe-4.21.2 lib/stripe/resources/alipay_account.rb
stripe-4.21.1 lib/stripe/resources/alipay_account.rb
stripe-4.21.0 lib/stripe/resources/alipay_account.rb
stripe-4.20.1 lib/stripe/resources/alipay_account.rb
stripe-4.20.0 lib/stripe/resources/alipay_account.rb
stripe-4.19.0 lib/stripe/resources/alipay_account.rb
stripe-4.18.1 lib/stripe/alipay_account.rb