Sha256: 9e4190eee511f3cfaada309f87a176720b1b4371dd44aa9560a29f8550dc1775

Contents?: true

Size: 934 Bytes

Versions: 20

Compression:

Stored size: 934 Bytes

Contents

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 by `a = customer.sources.retrieve('alipay_account_id'); a.save`"
    end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.14.0 lib/stripe/alipay_account.rb
stripe-3.13.1 lib/stripe/alipay_account.rb
stripe-3.13.0 lib/stripe/alipay_account.rb
stripe-3.12.1 lib/stripe/alipay_account.rb
stripe-3.12.0 lib/stripe/alipay_account.rb
stripe-3.11.0 lib/stripe/alipay_account.rb
stripe-3.10.0 lib/stripe/alipay_account.rb
stripe-3.9.2 lib/stripe/alipay_account.rb
stripe-3.9.1 lib/stripe/alipay_account.rb
stripe-3.9.0 lib/stripe/alipay_account.rb
stripe-3.8.2 lib/stripe/alipay_account.rb
stripe-3.8.1 lib/stripe/alipay_account.rb
stripe-3.8.0 lib/stripe/alipay_account.rb
stripe-3.7.0 lib/stripe/alipay_account.rb
stripe-3.6.0 lib/stripe/alipay_account.rb
stripe-3.5.3 lib/stripe/alipay_account.rb
stripe-3.5.2 lib/stripe/alipay_account.rb
stripe-3.5.1 lib/stripe/alipay_account.rb
stripe-3.5.0 lib/stripe/alipay_account.rb
stripe-3.4.1 lib/stripe/alipay_account.rb