Sha256: e4afb30173fd49f638189d98d15b59e99fe08ca5b7d6236b4ae62d6261d893eb

Contents?: true

Size: 1.67 KB

Versions: 8

Compression:

Stored size: 1.67 KB

Contents

require_relative '../service'
module Adyen
  class TransactionRulesApi < Service
    attr_accessor :service, :version

    def initialize(client, version = DEFAULT_VERSION)
      super(client, version, 'BalancePlatform')
    end

    def delete_transaction_rule(transaction_rule_id, headers: {})
      endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, transaction_rule_id)
      
      action = { method: 'delete', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def get_transaction_rule(transaction_rule_id, headers: {})
      endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, transaction_rule_id)
      
      action = { method: 'get', url: endpoint }
      @client.call_adyen_api(@service, action, {}, headers, @version)
    end

    def update_transaction_rule(request, transaction_rule_id, headers: {})
      endpoint = '/transactionRules/{transactionRuleId}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint, transaction_rule_id)
      
      action = { method: 'patch', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

    def create_transaction_rule(request, headers: {})
      endpoint = '/transactionRules'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint)
      
      action = { method: 'post', url: endpoint }
      @client.call_adyen_api(@service, action, request, headers, @version)
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
adyen-ruby-api-library-8.0.0 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-8.0.0.pre.beta.1 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.3.1 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.3.0 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.2.0 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.1.0 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.0.3 lib/adyen/services/balancePlatform/transaction_rules_api.rb
adyen-ruby-api-library-7.0.2 lib/adyen/services/balancePlatform/transaction_rules_api.rb