Sha256: cc318f32709eb713acedefe35e321bb45414f4540bfae882b4ecf52c274595bb

Contents?: true

Size: 947 Bytes

Versions: 14

Compression:

Stored size: 947 Bytes

Contents

module Braintree
  class SepaDirectDebitAccountGateway
    def initialize(gateway)
      @gateway = gateway
      @config = gateway.config
      @config.assert_has_access_token_or_keys
    end

    def find(token)
      raise ArgumentError if token.nil? || token.to_s.strip == ""
      response = @config.http.get("#{@config.base_merchant_path}/payment_methods/sepa_debit_account/#{token}")
      SepaDirectDebitAccount._new(@gateway, response[:sepa_debit_account])
    rescue NotFoundError
      raise NotFoundError, "sepa direct debit account with token #{token.inspect} not found"
    end

    def delete(token)
      raise ArgumentError if token.nil? || token.to_s.strip == ""
      @config.http.delete("#{@config.base_merchant_path}/payment_methods/sepa_debit_account/#{token}")
      SuccessfulResult.new
    rescue NotFoundError
      raise NotFoundError, "sepa direct debit account with token #{token.inspect} not found"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
braintree-4.23.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.22.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.21.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.20.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.19.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.18.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.17.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.16.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.15.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.14.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.13.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.12.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.11.0 lib/braintree/sepa_direct_debit_account_gateway.rb
braintree-4.10.0 lib/braintree/sepa_direct_debit_account_gateway.rb