Sha256: 5cc5ddbdef7fcbf6006558a2591f3dfe73d4abd05a717247674e3d8c0fcb7278

Contents?: true

Size: 952 Bytes

Versions: 1

Compression:

Stored size: 952 Bytes

Contents

# frozen_string_literal: true

require_relative "http_client"
require_relative "./authorize_net_webhooks_client"
require "base64"

module ActAsApiClient
  module Clients
    module AuthorizeNetNotificationsClient
      include AuthorizeNetWebhooksClient

      def where(parameters = {})
        # GET https://apitest.authorize.net/rest/v1/notifications?from_date=2017-03-01&to_date=2017-03-13&offset=0&limit=100
        # GET https://apitest.authorize.net/rest/v1/notifications?deliveryStatus=Failed
        # [:from_date, :to_date, :offset, :limit, :deliveryStatus]

        get("https://#{base_uri}/rest/v1/notifications/",
            headers: { "Authorization" => auth },
            params: parameters)
      end

      def find(uuid)
        raise StandardError, "uuid is not provided" if uuid.empty?

        get("https://#{base_uri}/rest/v1/notifications/#{uuid}",
            headers: { "Authorization" => auth })
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
act_as_api_client-0.2.0 lib/act_as_api_client/clients/authorize_net_notifications_client.rb