From 5dd9fe7ad82afe371d8e24470e1150ec6e86d21d Mon Sep 17 00:00:00 2001 From: Harry Lewis Date: Thu, 23 Nov 2023 15:18:21 -0500 Subject: [PATCH] Remove old API code (#9) --- .rubocop.yml | 6 - .rubocop_todo.yml | 2 +- .ruby-version | 2 +- lib/payrix.rb | 1 - lib/payrix/http.rb | 9 +- lib/payrix/http/request_params.rb | 69 ------ lib/payrix/resource.rb | 108 --------- lib/payrix/resource/account_verifications.rb | 21 -- lib/payrix/resource/accounts.rb | 20 -- lib/payrix/resource/adjustments.rb | 22 -- .../resource/aggregation_result_groups.rb | 21 -- lib/payrix/resource/aggregation_results.rb | 21 -- lib/payrix/resource/aggregations.rb | 22 -- lib/payrix/resource/alert_actions.rb | 19 -- lib/payrix/resource/alert_triggers.rb | 19 -- lib/payrix/resource/alerts.rb | 19 -- lib/payrix/resource/apikeys.rb | 19 -- lib/payrix/resource/assessments.rb | 24 -- lib/payrix/resource/auth_tokens.rb | 19 -- lib/payrix/resource/base.rb | 210 ------------------ lib/payrix/resource/batches.rb | 20 -- lib/payrix/resource/billing_events.rb | 19 -- lib/payrix/resource/billing_modifiers.rb | 19 -- lib/payrix/resource/billings.rb | 21 -- lib/payrix/resource/chargeback_documents.rb | 19 -- .../resource/chargeback_message_results.rb | 21 -- lib/payrix/resource/chargeback_messages.rb | 22 -- lib/payrix/resource/chargeback_statuses.rb | 21 -- lib/payrix/resource/chargebacks.rb | 24 -- lib/payrix/resource/confirm_codes.rb | 19 -- lib/payrix/resource/contacts.rb | 21 -- lib/payrix/resource/credentials.rb | 20 -- lib/payrix/resource/customers.rb | 24 -- lib/payrix/resource/decision_actions.rb | 20 -- lib/payrix/resource/decision_rules.rb | 19 -- lib/payrix/resource/decisions.rb | 23 -- lib/payrix/resource/disbursement_entries.rb | 22 -- lib/payrix/resource/disbursement_results.rb | 22 -- lib/payrix/resource/disbursements.rb | 25 --- lib/payrix/resource/divisions.rb | 19 -- lib/payrix/resource/entities.rb | 25 --- lib/payrix/resource/entity_datas.rb | 20 -- lib/payrix/resource/entity_debts.rb | 21 -- lib/payrix/resource/entity_reserves.rb | 20 -- lib/payrix/resource/entity_returns.rb | 22 -- lib/payrix/resource/entries.rb | 26 --- lib/payrix/resource/entry_origins.rb | 21 -- lib/payrix/resource/fee_modifiers.rb | 19 -- lib/payrix/resource/fee_rules.rb | 19 -- lib/payrix/resource/fees.rb | 22 -- lib/payrix/resource/fund_origins.rb | 21 -- lib/payrix/resource/funds.rb | 22 -- lib/payrix/resource/holds.rb | 21 -- lib/payrix/resource/invoice_items.rb | 19 -- lib/payrix/resource/invoice_line_items.rb | 19 -- lib/payrix/resource/invoice_parameters.rb | 19 -- lib/payrix/resource/invoice_results.rb | 23 -- lib/payrix/resource/invoices.rb | 21 -- lib/payrix/resource/iplists.rb | 19 -- lib/payrix/resource/items.rb | 20 -- lib/payrix/resource/logins.rb | 23 -- lib/payrix/resource/mappings.rb | 19 -- lib/payrix/resource/members.rb | 23 -- lib/payrix/resource/merchant_results.rb | 21 -- lib/payrix/resource/merchants.rb | 28 --- lib/payrix/resource/message_threads.rb | 21 -- lib/payrix/resource/messages.rb | 20 -- lib/payrix/resource/mixin.rb | 10 - lib/payrix/resource/mixin/attr_casters.rb | 43 ---- lib/payrix/resource/mixin/create_disabled.rb | 11 - lib/payrix/resource/mixin/delete_disabled.rb | 11 - lib/payrix/resource/mixin/update_disabled.rb | 11 - lib/payrix/resource/note_documents.rb | 19 -- lib/payrix/resource/notes.rb | 19 -- lib/payrix/resource/org_entities.rb | 18 -- lib/payrix/resource/org_flow_actions.rb | 18 -- lib/payrix/resource/org_flows.rb | 18 -- lib/payrix/resource/orgs.rb | 18 -- lib/payrix/resource/payment_update_groups.rb | 21 -- lib/payrix/resource/payment_updates.rb | 22 -- lib/payrix/resource/payout_flows.rb | 21 -- lib/payrix/resource/payouts.rb | 22 -- lib/payrix/resource/pending_entries.rb | 26 --- lib/payrix/resource/plans.rb | 20 -- lib/payrix/resource/profit_share_results.rb | 21 -- lib/payrix/resource/profit_share_rules.rb | 19 -- lib/payrix/resource/profit_shares.rb | 20 -- lib/payrix/resource/refunds.rb | 20 -- lib/payrix/resource/report_items.rb | 19 -- lib/payrix/resource/report_results.rb | 21 -- lib/payrix/resource/reports.rb | 19 -- lib/payrix/resource/reserve_entries.rb | 23 -- lib/payrix/resource/reserves.rb | 21 -- lib/payrix/resource/secrets.rb | 20 -- lib/payrix/resource/sessions.rb | 20 -- lib/payrix/resource/statement_entries.rb | 23 -- lib/payrix/resource/statements.rb | 22 -- lib/payrix/resource/subscription_tokens.rb | 18 -- lib/payrix/resource/subscriptions.rb | 21 -- lib/payrix/resource/team_logins.rb | 19 -- lib/payrix/resource/teams.rb | 19 -- lib/payrix/resource/terminal_txn_datas.rb | 20 -- lib/payrix/resource/terminal_txn_metadatas.rb | 20 -- lib/payrix/resource/terminal_txn_refs.rb | 19 -- lib/payrix/resource/terminal_txn_results.rb | 22 -- lib/payrix/resource/terminal_txns.rb | 29 --- lib/payrix/resource/terminals.rb | 21 -- lib/payrix/resource/tokens.rb | 20 -- lib/payrix/resource/txn_datas.rb | 20 -- lib/payrix/resource/txn_metadatas.rb | 21 -- lib/payrix/resource/txn_results.rb | 22 -- lib/payrix/resource/txns.rb | 36 --- lib/payrix/resource/vendors.rb | 19 -- spec/lib/payrix/resource/base_spec.rb | 29 --- .../resource/mixin/attr_casters_spec.rb | 26 --- 115 files changed, 4 insertions(+), 2640 deletions(-) delete mode 100644 lib/payrix/http/request_params.rb delete mode 100644 lib/payrix/resource.rb delete mode 100644 lib/payrix/resource/account_verifications.rb delete mode 100644 lib/payrix/resource/accounts.rb delete mode 100644 lib/payrix/resource/adjustments.rb delete mode 100644 lib/payrix/resource/aggregation_result_groups.rb delete mode 100644 lib/payrix/resource/aggregation_results.rb delete mode 100644 lib/payrix/resource/aggregations.rb delete mode 100644 lib/payrix/resource/alert_actions.rb delete mode 100644 lib/payrix/resource/alert_triggers.rb delete mode 100644 lib/payrix/resource/alerts.rb delete mode 100644 lib/payrix/resource/apikeys.rb delete mode 100644 lib/payrix/resource/assessments.rb delete mode 100644 lib/payrix/resource/auth_tokens.rb delete mode 100644 lib/payrix/resource/base.rb delete mode 100644 lib/payrix/resource/batches.rb delete mode 100644 lib/payrix/resource/billing_events.rb delete mode 100644 lib/payrix/resource/billing_modifiers.rb delete mode 100644 lib/payrix/resource/billings.rb delete mode 100644 lib/payrix/resource/chargeback_documents.rb delete mode 100644 lib/payrix/resource/chargeback_message_results.rb delete mode 100644 lib/payrix/resource/chargeback_messages.rb delete mode 100644 lib/payrix/resource/chargeback_statuses.rb delete mode 100644 lib/payrix/resource/chargebacks.rb delete mode 100644 lib/payrix/resource/confirm_codes.rb delete mode 100644 lib/payrix/resource/contacts.rb delete mode 100644 lib/payrix/resource/credentials.rb delete mode 100644 lib/payrix/resource/customers.rb delete mode 100644 lib/payrix/resource/decision_actions.rb delete mode 100644 lib/payrix/resource/decision_rules.rb delete mode 100644 lib/payrix/resource/decisions.rb delete mode 100644 lib/payrix/resource/disbursement_entries.rb delete mode 100644 lib/payrix/resource/disbursement_results.rb delete mode 100644 lib/payrix/resource/disbursements.rb delete mode 100644 lib/payrix/resource/divisions.rb delete mode 100644 lib/payrix/resource/entities.rb delete mode 100644 lib/payrix/resource/entity_datas.rb delete mode 100644 lib/payrix/resource/entity_debts.rb delete mode 100644 lib/payrix/resource/entity_reserves.rb delete mode 100644 lib/payrix/resource/entity_returns.rb delete mode 100644 lib/payrix/resource/entries.rb delete mode 100644 lib/payrix/resource/entry_origins.rb delete mode 100644 lib/payrix/resource/fee_modifiers.rb delete mode 100644 lib/payrix/resource/fee_rules.rb delete mode 100644 lib/payrix/resource/fees.rb delete mode 100644 lib/payrix/resource/fund_origins.rb delete mode 100644 lib/payrix/resource/funds.rb delete mode 100644 lib/payrix/resource/holds.rb delete mode 100644 lib/payrix/resource/invoice_items.rb delete mode 100644 lib/payrix/resource/invoice_line_items.rb delete mode 100644 lib/payrix/resource/invoice_parameters.rb delete mode 100644 lib/payrix/resource/invoice_results.rb delete mode 100644 lib/payrix/resource/invoices.rb delete mode 100644 lib/payrix/resource/iplists.rb delete mode 100644 lib/payrix/resource/items.rb delete mode 100644 lib/payrix/resource/logins.rb delete mode 100644 lib/payrix/resource/mappings.rb delete mode 100644 lib/payrix/resource/members.rb delete mode 100644 lib/payrix/resource/merchant_results.rb delete mode 100644 lib/payrix/resource/merchants.rb delete mode 100644 lib/payrix/resource/message_threads.rb delete mode 100644 lib/payrix/resource/messages.rb delete mode 100644 lib/payrix/resource/mixin.rb delete mode 100644 lib/payrix/resource/mixin/attr_casters.rb delete mode 100644 lib/payrix/resource/mixin/create_disabled.rb delete mode 100644 lib/payrix/resource/mixin/delete_disabled.rb delete mode 100644 lib/payrix/resource/mixin/update_disabled.rb delete mode 100644 lib/payrix/resource/note_documents.rb delete mode 100644 lib/payrix/resource/notes.rb delete mode 100644 lib/payrix/resource/org_entities.rb delete mode 100644 lib/payrix/resource/org_flow_actions.rb delete mode 100644 lib/payrix/resource/org_flows.rb delete mode 100644 lib/payrix/resource/orgs.rb delete mode 100644 lib/payrix/resource/payment_update_groups.rb delete mode 100644 lib/payrix/resource/payment_updates.rb delete mode 100644 lib/payrix/resource/payout_flows.rb delete mode 100644 lib/payrix/resource/payouts.rb delete mode 100644 lib/payrix/resource/pending_entries.rb delete mode 100644 lib/payrix/resource/plans.rb delete mode 100644 lib/payrix/resource/profit_share_results.rb delete mode 100644 lib/payrix/resource/profit_share_rules.rb delete mode 100644 lib/payrix/resource/profit_shares.rb delete mode 100644 lib/payrix/resource/refunds.rb delete mode 100644 lib/payrix/resource/report_items.rb delete mode 100644 lib/payrix/resource/report_results.rb delete mode 100644 lib/payrix/resource/reports.rb delete mode 100644 lib/payrix/resource/reserve_entries.rb delete mode 100644 lib/payrix/resource/reserves.rb delete mode 100644 lib/payrix/resource/secrets.rb delete mode 100644 lib/payrix/resource/sessions.rb delete mode 100644 lib/payrix/resource/statement_entries.rb delete mode 100644 lib/payrix/resource/statements.rb delete mode 100644 lib/payrix/resource/subscription_tokens.rb delete mode 100644 lib/payrix/resource/subscriptions.rb delete mode 100644 lib/payrix/resource/team_logins.rb delete mode 100644 lib/payrix/resource/teams.rb delete mode 100644 lib/payrix/resource/terminal_txn_datas.rb delete mode 100644 lib/payrix/resource/terminal_txn_metadatas.rb delete mode 100644 lib/payrix/resource/terminal_txn_refs.rb delete mode 100644 lib/payrix/resource/terminal_txn_results.rb delete mode 100644 lib/payrix/resource/terminal_txns.rb delete mode 100644 lib/payrix/resource/terminals.rb delete mode 100644 lib/payrix/resource/tokens.rb delete mode 100644 lib/payrix/resource/txn_datas.rb delete mode 100644 lib/payrix/resource/txn_metadatas.rb delete mode 100644 lib/payrix/resource/txn_results.rb delete mode 100644 lib/payrix/resource/txns.rb delete mode 100644 lib/payrix/resource/vendors.rb delete mode 100644 spec/lib/payrix/resource/base_spec.rb delete mode 100644 spec/lib/payrix/resource/mixin/attr_casters_spec.rb diff --git a/.rubocop.yml b/.rubocop.yml index 7412293..b0e5c67 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,12 +7,6 @@ AllCops: TargetRubyVersion: 2.7 SuggestExtensions: false NewCops: enable - Exclude: - # These files will eventually be removed from the library, so don't bother fixing them up. - - 'lib/payrix/http/request_params.rb' - - 'lib/payrix/resource/**/*.rb' - - 'lib/payrix/resource.rb' - - 'spec/lib/payrix/resource/**/*.rb' Layout/MultilineMethodCallIndentation: EnforcedStyle: indented_relative_to_receiver diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1094b01..61ddef6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-08-24 01:23:51 UTC using RuboCop version 1.55.1. +# on 2023-11-20 14:54:51 UTC using RuboCop version 1.55.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/.ruby-version b/.ruby-version index 338a5b5..1f7da99 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.6 +2.7.7 diff --git a/lib/payrix.rb b/lib/payrix.rb index 65a15d8..8810ffa 100644 --- a/lib/payrix.rb +++ b/lib/payrix.rb @@ -6,7 +6,6 @@ require 'payrix/configuration' require 'payrix/exceptions' require 'payrix/http' -require 'payrix/resource' require 'payrix/client' require 'payrix/util' require 'payrix/object' diff --git a/lib/payrix/http.rb b/lib/payrix/http.rb index b42b719..90c68fc 100644 --- a/lib/payrix/http.rb +++ b/lib/payrix/http.rb @@ -1,9 +1,4 @@ # frozen_string_literal: true -module Payrix - module Http # rubocop:disable Style/Documentation - Legacy file, which will be removed eventually - autoload :RequestParams, 'payrix/http/request_params' - autoload :Request, 'payrix/http/request' - autoload :Response, 'payrix/http/response' - end -end +require 'payrix/http/request' +require 'payrix/http/response' diff --git a/lib/payrix/http/request_params.rb b/lib/payrix/http/request_params.rb deleted file mode 100644 index 3155983..0000000 --- a/lib/payrix/http/request_params.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -module Payrix - module Http - class RequestParams - def initialize(sort = '', expand = [], page = 1, totals = {}) - self.sort = sort - self.expand = expand - self.page = page - self.totals = totals - end - - def sort - @sort - end - - def sort=(sort) - if sort.is_a?(Array) && sort.size == 2 - @sort = "#{sort[0]}[sort]=#{sort[1]}" - else - @sort = sort - end - end - - def expand - @expand.map do |s| - fields = s.split(',').map { |field| "[#{field.strip}]" } - "expand#{fields.join}[]" - end.join('&') - end - - def expand=(expand) - if expand.is_a?(Array) - @expand = expand - end - end - - # Retrieve the totals header string - def totals - @totals.map do |action, values| - if values.is_a?(Array) && !values.empty? - values.map do |value| - "#{action}[]=#{value}" - end - end - end.join('&') - end - - # Set the totals hash - def totals=(totals) - if totals.is_a?(Hash) - @totals = totals - end - end - - def page - @page.nil? || @page == 0 ? '' : "page[number]=#{@page}" - end - - def page=(page) - @page = page - end - - def go_next_page - @page = @page.nil? || @page == 0 ? 1 : @page + 1 - end - end - end -end diff --git a/lib/payrix/resource.rb b/lib/payrix/resource.rb deleted file mode 100644 index cb428f2..0000000 --- a/lib/payrix/resource.rb +++ /dev/null @@ -1,108 +0,0 @@ -module Payrix - module Resource - autoload :Mixin, 'payrix/resource/mixin' - - autoload :Base, 'payrix/resource/base' - - autoload :Accounts, 'payrix/resource/accounts' - autoload :AccountVerifications, 'payrix/resource/account_verifications' - autoload :Adjustments, 'payrix/resource/adjustments' - autoload :AggregationResultGroups, 'payrix/resource/aggregation_result_groups' - autoload :AggregationResults, 'payrix/resource/aggregation_results' - autoload :Aggregations, 'payrix/resource/aggregations' - autoload :AlertActions, 'payrix/resource/alert_actions' - autoload :Alerts, 'payrix/resource/alerts' - autoload :AlertTriggers, 'payrix/resource/alert_triggers' - autoload :Apikeys, 'payrix/resource/apikeys' - autoload :Assessments, 'payrix/resource/assessments' - autoload :AuthTokens, 'payrix/resource/auth_tokens' - autoload :Batches, 'payrix/resource/batches' - autoload :BillingEvents, 'payrix/resource/billing_events' - autoload :BillingModifiers, 'payrix/resource/billing_modifiers' - autoload :Billings, 'payrix/resource/billings' - autoload :ChargebackDocuments, 'payrix/resource/chargeback_documents' - autoload :ChargebackMessageResults, 'payrix/resource/chargeback_message_results' - autoload :ChargebackMessages, 'payrix/resource/chargeback_messages' - autoload :Chargebacks, 'payrix/resource/chargebacks' - autoload :ChargebackStatuses, 'payrix/resource/chargeback_statuses' - autoload :ConfirmCodes, 'payrix/resource/confirm_codes' - autoload :Contacts, 'payrix/resource/contacts' - autoload :Credentials, 'payrix/resource/credentials' - autoload :Customers, 'payrix/resource/customers' - autoload :DecisionActions, 'payrix/resource/decision_actions' - autoload :DecisionRules, 'payrix/resource/decision_rules' - autoload :Decisions, 'payrix/resource/decisions' - autoload :DisbursementEntries, 'payrix/resource/disbursement_entries' - autoload :Disbursements, 'payrix/resource/disbursements' - autoload :DisbursementResults, 'payrix/resource/disbursement_results' - autoload :Divisions, 'payrix/resource/divisions' - autoload :Entities, 'payrix/resource/entities' - autoload :EntityDatas, 'payrix/resource/entity_datas' - autoload :EntityDebts, 'payrix/resource/entity_debts' - autoload :EntityReserves, 'payrix/resource/entity_reserves' - autoload :EntityReturns, 'payrix/resource/entity_returns' - autoload :Entries, 'payrix/resource/entries' - autoload :EntryOrigins, 'payrix/resource/entry_origins' - autoload :FeeModifiers, 'payrix/resource/fee_modifiers' - autoload :FeeRules, 'payrix/resource/fee_rules' - autoload :Fees, 'payrix/resource/fees' - autoload :FundOrigins, 'payrix/resource/fund_origins' - autoload :Funds, 'payrix/resource/funds' - autoload :Holds, 'payrix/resource/holds' - autoload :InvoiceItems, 'payrix/resource/invoice_items' - autoload :InvoiceLineItems, 'payrix/resource/invoice_line_items' - autoload :InvoiceParameters, 'payrix/resource/invoice_parameters' - autoload :InvoiceResults, 'payrix/resource/invoice_results' - autoload :Invoices, 'payrix/resource/invoices' - autoload :Iplists, 'payrix/resource/iplists' - autoload :Items, 'payrix/resource/items' - autoload :Logins, 'payrix/resource/logins' - autoload :Messages, 'payrix/resource/messages' - autoload :MessageThreads, 'payrix/resource/message_threads' - autoload :Members, 'payrix/resource/members' - autoload :MerchantResults, 'payrix/resource/merchant_results' - autoload :Merchants, 'payrix/resource/merchants' - autoload :Mappings, 'payrix/resource/mappings' - autoload :Notes, 'payrix/resource/notes' - autoload :NoteDocuments, 'payrix/resource/note_documents' - autoload :OrgEntities, 'payrix/resource/org_entities' - autoload :OrgFlowActions, 'payrix/resource/org_flow_actions' - autoload :OrgFlows, 'payrix/resource/org_flows' - autoload :Orgs, 'payrix/resource/orgs' - autoload :PaymentUpdateGroups, 'payrix/resource/payment_update_groups' - autoload :PaymentUpdates, 'payrix/resource/payment_updates' - autoload :PayoutFlows, 'payrix/resource/payout_flows' - autoload :Payouts, 'payrix/resource/payouts' - autoload :PendingEntries, 'payrix/resource/pending_entries' - autoload :Plans, 'payrix/resource/plans' - autoload :ProfitShareResults, 'payrix/resource/profit_share_results' - autoload :ProfitShareRules, 'payrix/resource/profit_share_rules' - autoload :ProfitShares, 'payrix/resource/profit_shares' - autoload :Refunds, 'payrix/resource/refunds' - autoload :ReportItems, 'payrix/resource/report_items' - autoload :ReportResults, 'payrix/resource/report_results' - autoload :Reports, 'payrix/resource/reports' - autoload :ReserveEntries, 'payrix/resource/reserve_entries' - autoload :Reserves, 'payrix/resource/reserves' - autoload :Secrets, 'payrix/resource/secrets' - autoload :Sessions, 'payrix/resource/sessions' - autoload :StatementEntries, 'payrix/resource/statement_entries' - autoload :Statements, 'payrix/resource/statements' - autoload :Subscriptions, 'payrix/resource/subscriptions' - autoload :SubscriptionTokens, 'payrix/resource/subscription_tokens' - autoload :TeamLogins, 'payrix/resource/team_logins' - autoload :Teams, 'payrix/resource/teams' - autoload :Terminals, 'payrix/resource/terminals' - autoload :TerminalTxnDatas, 'payrix/resource/terminal_txn_datas' - autoload :TerminalTxnMetadatas, 'payrix/resource/terminal_txn_metadatas' - autoload :TerminalTxnRefs, 'payrix/resource/terminal_txn_refs' - autoload :TerminalTxnResults, 'payrix/resource/terminal_txn_results' - autoload :TerminalTxns, 'payrix/resource/terminal_txns' - autoload :Tokens, 'payrix/resource/tokens' - autoload :TxnDatas, 'payrix/resource/txn_datas' - autoload :TxnMetadatas, 'payrix/resource/txn_metadatas' - autoload :TxnResults, 'payrix/resource/txn_results' - autoload :Txns, 'payrix/resource/txns' - autoload :Vendors, 'payrix/resource/vendors' - end -end diff --git a/lib/payrix/resource/account_verifications.rb b/lib/payrix/resource/account_verifications.rb deleted file mode 100644 index 52e34b9..0000000 --- a/lib/payrix/resource/account_verifications.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class AccountVerifications < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'accountVerifications' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :account, :type] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/accounts.rb b/lib/payrix/resource/accounts.rb deleted file mode 100644 index 0f2966b..0000000 --- a/lib/payrix/resource/accounts.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Accounts < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'accounts' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :account, :token, :name, :description, - :primary, :status, :currency, :inactive, :frozen, - :expiration, :type, :reserved, :checkStage] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/adjustments.rb b/lib/payrix/resource/adjustments.rb deleted file mode 100644 index 7c27ca4..0000000 --- a/lib/payrix/resource/adjustments.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Adjustments < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'adjustments' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :fromentity, :description, :amount, - :currency, :onentity] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/aggregation_result_groups.rb b/lib/payrix/resource/aggregation_result_groups.rb deleted file mode 100644 index 59b346f..0000000 --- a/lib/payrix/resource/aggregation_result_groups.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class AggregationResultGroups < Base - - include Mixin::UpdateDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'aggregationResultGroups' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :aggregation, :resource, :search, :totals, :lastModified, - :effective, :default, :type, :level, :degrouping] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/aggregation_results.rb b/lib/payrix/resource/aggregation_results.rb deleted file mode 100644 index f309fb5..0000000 --- a/lib/payrix/resource/aggregation_results.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class AggregationResults < Base - - include Mixin::UpdateDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'aggregationResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :aggregationResultGroup, :field, :count, :sum, :min, - :max, :grouping] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/aggregations.rb b/lib/payrix/resource/aggregations.rb deleted file mode 100644 index 774b3e4..0000000 --- a/lib/payrix/resource/aggregations.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Aggregations < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'aggregations' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :name, :description, :resource, :search, - :totals, :status, :schedule, :scheduleFactor, :start, - :inactive, :frozen, :entity, :forlogin, :org, - :team, :division, :partition, :type, :level, - :default, :degrouping] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/alert_actions.rb b/lib/payrix/resource/alert_actions.rb deleted file mode 100644 index 9645a8d..0000000 --- a/lib/payrix/resource/alert_actions.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class AlertActions < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'alertActions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :type, :options, :value, :alert, :retries, - :headerName, :headerValue] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/alert_triggers.rb b/lib/payrix/resource/alert_triggers.rb deleted file mode 100644 index 8333c8a..0000000 --- a/lib/payrix/resource/alert_triggers.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class AlertTriggers < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'alertTriggers' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :alert, :event, :resource, :name, :description, - :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/alerts.rb b/lib/payrix/resource/alerts.rb deleted file mode 100644 index 253811c..0000000 --- a/lib/payrix/resource/alerts.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Alerts < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'alerts' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :forlogin, :team, :name, :description, - :inactive, :frozen, :division] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/apikeys.rb b/lib/payrix/resource/apikeys.rb deleted file mode 100644 index b091896..0000000 --- a/lib/payrix/resource/apikeys.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Apikeys < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'apikeys' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :key, :name, :description, :public, - :inactive, :frozen, :token, :effectiveRoles] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/assessments.rb b/lib/payrix/resource/assessments.rb deleted file mode 100644 index 8cebc36..0000000 --- a/lib/payrix/resource/assessments.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Payrix - module Resource - class Assessments < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'assessments' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :onentity, :forentity, :partition, :opposingAssessment, - :fee, :disbursement, :txn, :chargeback, :merchant, - :event, :eventId, :description, :amount, :platform, - :currency] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/auth_tokens.rb b/lib/payrix/resource/auth_tokens.rb deleted file mode 100644 index 548ad15..0000000 --- a/lib/payrix/resource/auth_tokens.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class AuthTokens < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'authTokens' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :token, :customer, :used, :inactive, - :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/base.rb b/lib/payrix/resource/base.rb deleted file mode 100644 index efc7519..0000000 --- a/lib/payrix/resource/base.rb +++ /dev/null @@ -1,210 +0,0 @@ -module Payrix - module Resource - class Base - attr_reader :resource_name - - def initialize(params, attrs) - @attrs = attrs - @request_options = Payrix::Http::RequestParams.new - - set(params) - end - - def request_options - @request_options - end - - def request_options=(params = {}) - @request_options.sort = params['sort'] unless params['sort'].nil? - @request_options.expand = params['expand'] unless params['expand'].nil? - @request_options.totals = params['totals'] unless params['totals'].nil? - @request_options.page = params['page'] unless params['page'].nil? - end - - def set(params) - if params.is_a?(Hash) && !params.empty? - params.each do |k, v| - if @attrs.include? k - public_send("#{k}=", v) if respond_to? "#{k}=" - else - self.instance_variable_set("@#{k}", v); - end - end - end - end - - def to_json(nested = false) - excludes = ['request_options', 'resource_name', 'response', 'attrs'] - - instance_variables.inject({}) do |hash, var| - key = var.to_s.delete('@') - val = instance_variable_get(var) - - if !excludes.include? key - if val.is_a? Base - hash[key] = val.to_json(true) if nested - else - hash[key] = val - end - end - - hash - end - end - - def status - @response.nil? ? false : @response.status - end - - def errors? - @response.nil? ? false : @response.errors? - end - - def response - @response.nil? ? [] : @response.response - end - - def details - @response.nil? ? [] : @response.details - end - - def totals - @response.nil? ? [] : @response.totals - end - - def more? - @response.nil? ? true : @response.more? - end - - def retrieve(params = {}) - set(params) - - headers = build_headers - - search = build_search(to_json) - search += "&#{request_options.sort}" if request_options - headers['SEARCH'] = search - - headers['Content-Type'] = "application/json" - query_params = [] - if request_options - query_params << request_options.expand if request_options.expand - query_params << request_options.page if request_options.page - if request_options.totals - headers['TOTALS'] = request_options.totals - end - end - - method = 'get' - url = Payrix.configuration.url - endpoint = "#{@resource_name}?#{query_params.join('&')}" - data = {} - - body, status = Payrix::Http::Request.instance.send_http(method, url, endpoint, data, headers) - @response = Payrix::Http::Response.new(body, status, self.class) - - success = validate_response - request_options.go_next_page if success - - success - end - - def create(params = {}) - set(params) - - headers = build_headers - headers['Content-Type'] = "application/json" - query_params = [] - if request_options - query_params << request_options.expand if request_options.expand - end - - method = 'post' - url = Payrix.configuration.url - endpoint = "#{@resource_name}?#{query_params.join('&')}" - data = to_json - - body, status = Payrix::Http::Request.instance.send_http(method, url, endpoint, data, headers) - @response = Payrix::Http::Response.new(body, status, self.class) - - validate_response - end - - def update(params = {}) - set(params) - - if !id - raise Payrix::Exceptions::InvalidRequest.new('ID is required for this action') - end - - headers = build_headers - headers['Content-Type'] = "application/json" - method = 'put' - url = Payrix.configuration.url - endpoint = "#{@resource_name}/#{id}" - data = to_json - - body, status = Payrix::Http::Request.instance.send_http(method, url, endpoint, data, headers) - @response = Payrix::Http::Response.new(body, status, self.class) - - validate_response - end - - def delete(params = {}) - set(params) - - if !id - raise Payrix::Exceptions::InvalidRequest.new('ID is required for this delete') - end - - headers = build_headers - headers['Content-Type'] = "application/json" - method = 'delete' - url = Payrix.configuration.url - endpoint = "#{@resource_name}/#{id}" - data = {} - - body, status = Payrix::Http::Request.instance.send_http(method, url, endpoint, data, headers) - @response = Payrix::Http::Response.new(body, status, self.class) - - validate_response - end - - protected - def build_headers() - config = Payrix.configuration - - if !config.url - raise Payrix::Exceptions::InvalidRequest.new('Invalid URL') - end - - headers = {} - - if config.api_key - headers['APIKEY'] = config.api_key - elsif config.session_key - headers['SESSIONKEY'] = config.session_key - end - - headers - end - - def build_search(values = {}) - values - .delete_if { |k, v| v.nil? || v.empty? } - .map { |k, v| "#{k}[equals]=#{v}" } - .join('&') - end - - def validate_response - if @response.errors? - raise Payrix::Exceptions::ApiError.new("There are errors in the response, #{@response.errors}") - end - end - - def errors - @response.nil? ? [] : @response.errors - end - end - end -end diff --git a/lib/payrix/resource/batches.rb b/lib/payrix/resource/batches.rb deleted file mode 100644 index 7194579..0000000 --- a/lib/payrix/resource/batches.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Batches < Base - - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'batches' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :date, :status, :clientRef, :inactive, - :frozen, :processingDate, :processingId] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/billing_events.rb b/lib/payrix/resource/billing_events.rb deleted file mode 100644 index f10bb7c..0000000 --- a/lib/payrix/resource/billing_events.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class BillingEvents < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'billingEvents' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :billing, :event, :eventSchedule, :deductFromBalance, :inactive, - :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/billing_modifiers.rb b/lib/payrix/resource/billing_modifiers.rb deleted file mode 100644 index d902bfe..0000000 --- a/lib/payrix/resource/billing_modifiers.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class BillingModifiers < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'billingModifiers' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :billing, :entity, :org, :division, :fromentity, - :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/billings.rb b/lib/payrix/resource/billings.rb deleted file mode 100644 index d983c16..0000000 --- a/lib/payrix/resource/billings.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Billings < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'billings' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :org, :division, :description, - :schedule, :scheduleFactor, :start, :finish, :collection, - :collectionFactor, :collectionOffset, :collectionIncludeCurrent, :currency, :inactive, - :frozen, :forentity] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/chargeback_documents.rb b/lib/payrix/resource/chargeback_documents.rb deleted file mode 100644 index 678d8ab..0000000 --- a/lib/payrix/resource/chargeback_documents.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class ChargebackDocuments < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'chargebackDocuments' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :chargeback, :ref, :type, :name, :description, - :status, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/chargeback_message_results.rb b/lib/payrix/resource/chargeback_message_results.rb deleted file mode 100644 index a498fa7..0000000 --- a/lib/payrix/resource/chargeback_message_results.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class ChargebackMessageResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'chargebackMessageResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :chargebackMessage, :type, :message] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/chargeback_messages.rb b/lib/payrix/resource/chargeback_messages.rb deleted file mode 100644 index eb88263..0000000 --- a/lib/payrix/resource/chargeback_messages.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class ChargebackMessages < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'chargebackMessages' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :chargeback, :date, :type, :fromQueue, :toQueue, - :contact, :amount, :currency, :note, :status, - :inactive, :frozen, :imported] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/chargeback_statuses.rb b/lib/payrix/resource/chargeback_statuses.rb deleted file mode 100644 index bb8e944..0000000 --- a/lib/payrix/resource/chargeback_statuses.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class ChargebackStatuses < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'chargebackStatuses' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :chargeback, :chargebackMessage, :status] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/chargebacks.rb b/lib/payrix/resource/chargebacks.rb deleted file mode 100644 index 6b4778f..0000000 --- a/lib/payrix/resource/chargebacks.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Payrix - module Resource - class Chargebacks < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'chargebacks' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :txn, :description, :total, :representedTotal, - :cycle, :currency, :ref, :reason, :reasonCode, - :issued, :received, :reply, :bankRef, :chargebackRef, - :status, :lastStatusChange, :inactive, :frozen, :actionable] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/confirm_codes.rb b/lib/payrix/resource/confirm_codes.rb deleted file mode 100644 index 669edf4..0000000 --- a/lib/payrix/resource/confirm_codes.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class ConfirmCodes < Base - - include Mixin::UpdateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'confirmCodes' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :type, :email, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/contacts.rb b/lib/payrix/resource/contacts.rb deleted file mode 100644 index d25f624..0000000 --- a/lib/payrix/resource/contacts.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Contacts < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'contacts' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :first, :middle, :last, :description, - :email, :fax, :phone, :country, :zip, - :state, :city, :address2, :address1, :inactive, - :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/credentials.rb b/lib/payrix/resource/credentials.rb deleted file mode 100644 index f302300..0000000 --- a/lib/payrix/resource/credentials.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Credentials < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'credentials' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :name, :description, :username, :password, - :connectUsername, :connectPassword, :integration, :type, :inactive, - :frozen, :secret] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/customers.rb b/lib/payrix/resource/customers.rb deleted file mode 100644 index c1b6a17..0000000 --- a/lib/payrix/resource/customers.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Payrix - module Resource - class Customers < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'customers' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :merchant, :first, :middle, :last, - :company, :email, :fax, :phone, :country, - :zip, :state, :city, :address2, :address1, - :inactive, :frozen, :shippingFirst, :shippingMiddle, :shippingLast, - :shippingCompany, :shippingAddress1, :shippingAddress2, :shippingCity, :shippingState, - :shippingZip, :shippingCountry, :shippingPhone, :shippingFax, :custom, - :authTokenCustomer] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/decision_actions.rb b/lib/payrix/resource/decision_actions.rb deleted file mode 100644 index 38f2977..0000000 --- a/lib/payrix/resource/decision_actions.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class DecisionActions < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'decisionActions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :decision, :action, :application, :scoreType, :type, - :field, :score, :data, :message, :code, - :grouping, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/decision_rules.rb b/lib/payrix/resource/decision_rules.rb deleted file mode 100644 index 7920a4f..0000000 --- a/lib/payrix/resource/decision_rules.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class DecisionRules < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'decisionRules' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :decision, :name, :description, :type, :value, - :grouping, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/decisions.rb b/lib/payrix/resource/decisions.rb deleted file mode 100644 index 3860cbd..0000000 --- a/lib/payrix/resource/decisions.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class Decisions < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'decisions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :org, :entity, :decision, :type, - :target, :action, :sequence, :amount, :value, - :period, :periodFactor, :low, :high, :inactive, - :frozen, :division, :application, :options, :errorMessage, - :reason, :additionalOptions, :level, :schedule, :scheduleFactor, - :start, :finish, :useCache, :cacheTime] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/disbursement_entries.rb b/lib/payrix/resource/disbursement_entries.rb deleted file mode 100644 index f8956dd..0000000 --- a/lib/payrix/resource/disbursement_entries.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class DisbursementEntries < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'disbursementEntries' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :disbursement, :entry, :pendingEntry, :reserveEntry, :event, - :eventId, :amount, :amountUsed, :description] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/disbursement_results.rb b/lib/payrix/resource/disbursement_results.rb deleted file mode 100644 index 7a63b9d..0000000 --- a/lib/payrix/resource/disbursement_results.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class DisbursementResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'disbursementResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :disbursement, :code, :platform, :message, :disbursementRef, - :amount, :data, :originalCode] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/disbursements.rb b/lib/payrix/resource/disbursements.rb deleted file mode 100644 index 9838b06..0000000 --- a/lib/payrix/resource/disbursements.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Payrix - module Resource - class Disbursements < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'disbursements' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :account, :payout, :description, :amount, - :status, :processed, :currency, :payment, :expiration, - :sameDay, :returnedAmount, :statement, :settlement, :lastNegativeEntry, - :lastNegativePendingEntry, :lastPositiveReserveEntry, :disbursementEntriesStatus, :lastPositiveEntry, :lastPositivePendingEntry, - :lastNegativeReserveEntry, :fundingStatus, :secondaryDescriptor] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/divisions.rb b/lib/payrix/resource/divisions.rb deleted file mode 100644 index 588a6ed..0000000 --- a/lib/payrix/resource/divisions.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Divisions < Base - - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'divisions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :name, :email] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entities.rb b/lib/payrix/resource/entities.rb deleted file mode 100644 index a14f2f3..0000000 --- a/lib/payrix/resource/entities.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Payrix - module Resource - class Entities < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entities' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :ipCreated, :ipModified, :clientIp, :login, :parameter, - :type, :name, :address1, :address2, :city, - :state, :zip, :country, :timezone, :phone, - :fax, :email, :website, :ein, :tcVersion, - :tcDate, :tcIp, :tcAcceptDate, :tcAcceptIp, :custom, - :inactive, :frozen, :tinStatus, :reserved, :checkStage, - :public, :customerPhone, :locations, :industry, :displayName, - :totalCreditDisbursements, :payoutSecondaryDescriptor, :einType, :irsFilingName] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entity_datas.rb b/lib/payrix/resource/entity_datas.rb deleted file mode 100644 index 56b67e7..0000000 --- a/lib/payrix/resource/entity_datas.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class EntityDatas < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entityDatas' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :tcAcceptSignature] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entity_debts.rb b/lib/payrix/resource/entity_debts.rb deleted file mode 100644 index a2ad44b..0000000 --- a/lib/payrix/resource/entity_debts.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class EntityDebts < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entityDebts' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :toentity] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entity_reserves.rb b/lib/payrix/resource/entity_reserves.rb deleted file mode 100644 index e817c69..0000000 --- a/lib/payrix/resource/entity_reserves.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class EntityReserves < Base - - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entityReserves' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :fund, :total, :name, :description, - :requestSequence, :processedSequence] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entity_returns.rb b/lib/payrix/resource/entity_returns.rb deleted file mode 100644 index 8a19b89..0000000 --- a/lib/payrix/resource/entity_returns.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class EntityReturns < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entityReturns' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :payment, :txn, :disbursement, - :actionCode, :code, :message, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entries.rb b/lib/payrix/resource/entries.rb deleted file mode 100644 index 3f74f53..0000000 --- a/lib/payrix/resource/entries.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Payrix - module Resource - class Entries < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entries' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :onentity, :fromentity, :opposingEntry, :fund, - :fee, :disbursement, :refund, :txn, :chargeback, - :adjustment, :profitShare, :event, :eventId, :description, - :amount, :unsourced, :pending, :originalCurrency, :currencyRate, - :isFee, :statement, :settlement, :archiveSummary, :pendingEntry, - :pendingEntryCreated, :originalEventId, :originalEvent] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/entry_origins.rb b/lib/payrix/resource/entry_origins.rb deleted file mode 100644 index 8301d63..0000000 --- a/lib/payrix/resource/entry_origins.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class EntryOrigins < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'entryOrigins' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entry, :disbursement, :cancellation, :amount] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/fee_modifiers.rb b/lib/payrix/resource/fee_modifiers.rb deleted file mode 100644 index 3a6a457..0000000 --- a/lib/payrix/resource/fee_modifiers.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class FeeModifiers < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'feeModifiers' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :fee, :entity, :org, :fromentity, :markupUm, - :markupAmount, :inactive, :frozen, :division] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/fee_rules.rb b/lib/payrix/resource/fee_rules.rb deleted file mode 100644 index 1a5982f..0000000 --- a/lib/payrix/resource/fee_rules.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class FeeRules < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'feeRules' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :fee, :name, :description, :type, :application, - :value, :inactive, :frozen, :grouping] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/fees.rb b/lib/payrix/resource/fees.rb deleted file mode 100644 index e8549a3..0000000 --- a/lib/payrix/resource/fees.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Fees < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'fees' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :forentity, :org, :type, :name, - :description, :schedule, :scheduleFactor, :start, :finish, - :collection, :collectionFactor, :collectionOffset, :um, :amount, - :currency, :inactive, :frozen, :txnFee, :collectionIncludeCurrent, - :maximum] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/fund_origins.rb b/lib/payrix/resource/fund_origins.rb deleted file mode 100644 index 74dea28..0000000 --- a/lib/payrix/resource/fund_origins.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class FundOrigins < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'fundOrigins' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :fund, :disbursement, :amount] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/funds.rb b/lib/payrix/resource/funds.rb deleted file mode 100644 index 7d1592d..0000000 --- a/lib/payrix/resource/funds.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Funds < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'funds' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :currency, :reserved, :pending, :available, - :total, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/holds.rb b/lib/payrix/resource/holds.rb deleted file mode 100644 index b8d40e7..0000000 --- a/lib/payrix/resource/holds.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Holds < Base - - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'holds' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :txn, :verification, :action, :released, - :reviewed, :inactive, :frozen, :entity, :terminalTxn, - :decisionAction, :account, :verificationRef] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/invoice_items.rb b/lib/payrix/resource/invoice_items.rb deleted file mode 100644 index baec3fb..0000000 --- a/lib/payrix/resource/invoice_items.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class InvoiceItems < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'invoiceItems' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :item, :description, :custom, :um, - :commodityCode, :productCode, :price, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/invoice_line_items.rb b/lib/payrix/resource/invoice_line_items.rb deleted file mode 100644 index aecaf24..0000000 --- a/lib/payrix/resource/invoice_line_items.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class InvoiceLineItems < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'invoiceLineItems' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :invoice, :invoiceItem, :quantity, :price, :discount, - :total] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/invoice_parameters.rb b/lib/payrix/resource/invoice_parameters.rb deleted file mode 100644 index 7661614..0000000 --- a/lib/payrix/resource/invoice_parameters.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class InvoiceParameters < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'invoiceParameters' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :org, :division, :type, - :value, :locked, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/invoice_results.rb b/lib/payrix/resource/invoice_results.rb deleted file mode 100644 index a335908..0000000 --- a/lib/payrix/resource/invoice_results.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class InvoiceResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'invoiceResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :invoice, :txn, :status, :message, :shippingFirst, - :shippingMiddle, :shippingLast, :shippingCompany, :shippingAddress1, :shippingAddress2, - :shippingCity, :shippingState, :shippingZip, :shippingCountry, :shippingPhone, - :shippingFax, :authorization, :authorizationData, :signature] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/invoices.rb b/lib/payrix/resource/invoices.rb deleted file mode 100644 index b91e993..0000000 --- a/lib/payrix/resource/invoices.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Invoices < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'invoices' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :merchant, :customer, :subscription, :number, - :title, :message, :emails, :total, :tax, - :discount, :type, :status, :dueDate, :expirationDate, - :sendOn, :emailStatus, :inactive, :frozen, :allowedPaymentMethods] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/iplists.rb b/lib/payrix/resource/iplists.rb deleted file mode 100644 index 11dd33b..0000000 --- a/lib/payrix/resource/iplists.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Iplists < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'iplists' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :version, :type, :start, :finish, - :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/items.rb b/lib/payrix/resource/items.rb deleted file mode 100644 index 6f9c737..0000000 --- a/lib/payrix/resource/items.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Items < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'items' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :txn, :item, :description, :custom, :quantity, - :price, :inactive, :frozen, :um, :commodityCode, - :total, :discount, :productCode] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/logins.rb b/lib/payrix/resource/logins.rb deleted file mode 100644 index a23306f..0000000 --- a/lib/payrix/resource/logins.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class Logins < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'logins' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :lastLogin, :username, :password, :first, - :middle, :last, :email, :fax, :phone, - :country, :zip, :state, :city, :address2, - :address1, :confirmed, :roles, :division, :inactive, - :frozen, :allowedResources, :restrictedResources, :parentDivision, :portalAccess, - :ssoId, :effectiveRoles] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/mappings.rb b/lib/payrix/resource/mappings.rb deleted file mode 100644 index 208cb36..0000000 --- a/lib/payrix/resource/mappings.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Mappings < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'mappings' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :name, :description, :input, :output, - :namespace] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/members.rb b/lib/payrix/resource/members.rb deleted file mode 100644 index eaea2c2..0000000 --- a/lib/payrix/resource/members.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class Members < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'members' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :title, :first, :middle, :last, - :ssn, :dob, :dl, :dlstate, :ownership, - :email, :fax, :phone, :country, :zip, - :state, :city, :address2, :address1, :primary, - :inactive, :frozen, :timezone, :gender, :significantResponsibility, - :politicallyExposed, :citizenship] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/merchant_results.rb b/lib/payrix/resource/merchant_results.rb deleted file mode 100644 index 1748f14..0000000 --- a/lib/payrix/resource/merchant_results.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class MerchantResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'merchantResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :type, :message] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/merchants.rb b/lib/payrix/resource/merchants.rb deleted file mode 100644 index 8ce9ebd..0000000 --- a/lib/payrix/resource/merchants.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Payrix - module Resource - class Merchants < Base - include Mixin::AttrCasters - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'merchants' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :lastActivity, :entity, :dba, :new, :established, - :annualCCSales, :avgTicket, :amex, :discover, :mcc, - :status, :boarded, :inactive, :frozen, :environment, - :visaMvv, :chargebackNotificationEmail, :statusReason, :totalApprovedSales, :autoBoarded, - :saqType, :saqDate, :qsa, :letterStatus, :letterDate, - :tcAttestation, :visaDisclosure, :disclosureIP, :disclosureDate, :accountClosureReasonCode, - :accountClosureReasonDate, :annualCCSaleVolume, :annualACHSaleVolume, :riskLevel, :creditRatio, - :creditTimeliness, :chargebackRatio, :ndxDays, :ndxPercentage, :advancedBilling, - :locationType, :percentKeyed, :totalVolume, :percentCardNotPresent, :seasonal, - :amexVolume, :incrementalAuthSupported, :tmxSessionId] - - attr_accessor *ATTRS - attr_cast_to_integer :status - end - end -end diff --git a/lib/payrix/resource/message_threads.rb b/lib/payrix/resource/message_threads.rb deleted file mode 100644 index b99ee3e..0000000 --- a/lib/payrix/resource/message_threads.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class MessageThreads < Base - - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'messageThreads' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :forlogin, :hold, :entityReturn, :opposingMessageThread, - :folder, :sender, :recipient, :subject] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/messages.rb b/lib/payrix/resource/messages.rb deleted file mode 100644 index 2f1aaec..0000000 --- a/lib/payrix/resource/messages.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Messages < Base - - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'messages' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :messageThread, :opposingMessage, :type, :generated, :secure, - :read, :message] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/mixin.rb b/lib/payrix/resource/mixin.rb deleted file mode 100644 index 8fc39b3..0000000 --- a/lib/payrix/resource/mixin.rb +++ /dev/null @@ -1,10 +0,0 @@ -module Payrix - module Resource - module Mixin - autoload :UpdateDisabled, 'payrix/resource/mixin/update_disabled' - autoload :CreateDisabled, 'payrix/resource/mixin/create_disabled' - autoload :DeleteDisabled, 'payrix/resource/mixin/delete_disabled' - autoload :AttrCasters, 'payrix/resource/mixin/attr_casters' - end - end -end diff --git a/lib/payrix/resource/mixin/attr_casters.rb b/lib/payrix/resource/mixin/attr_casters.rb deleted file mode 100644 index 4053c43..0000000 --- a/lib/payrix/resource/mixin/attr_casters.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Payrix - module Resource - module Mixin - module AttrCasters - def self.included(klass) - klass.extend(ClassMethods) - end - - module ClassMethods - # Use this mixin to dynamically define a getter that casts the specified attribute to an integer. Note that - # methods are defined (and overridden) in the order they appear, so make sure to use this *after* any - # additional usage of methods like `.attr_reader` or `.attr_accessor`. - # - # In addition to defining a integer-casting getter wrapper around the attribute, it also creates another - # method, `#{attribute}_raw_value`, which gives the pre-cast value. - # - # class Txns < Base - # include Mixin::AttrCasters - # - # def initialize(params) - # super(params, [:status, :date, ...]) - # - # @resource_name = 'txns' - # end - # - # attr_accessor :status, :date, ... - # attr_cast_to_integer :status - # end - # - # transaction = Txns.new(status: '1') - # transaction.status # => 1 - # transaction.status_raw_value # => "1" - def attr_cast_to_integer(*attrs) - attrs.each do |attr| - define_method(attr) { self.instance_variable_get("@#{attr}").to_i } - define_method("#{attr}_raw_value") { self.instance_variable_get("@#{attr}") } - end - end - end - end - end - end -end diff --git a/lib/payrix/resource/mixin/create_disabled.rb b/lib/payrix/resource/mixin/create_disabled.rb deleted file mode 100644 index 24e8a93..0000000 --- a/lib/payrix/resource/mixin/create_disabled.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Payrix - module Resource - module Mixin - module CreateDisabled - def create(params = {}) - raise Payrix::Exceptions::InvalidRequest.new('Invalid Action') - end - end - end - end -end diff --git a/lib/payrix/resource/mixin/delete_disabled.rb b/lib/payrix/resource/mixin/delete_disabled.rb deleted file mode 100644 index 1355c50..0000000 --- a/lib/payrix/resource/mixin/delete_disabled.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Payrix - module Resource - module Mixin - module DeleteDisabled - def delete(params = {}) - raise Payrix::Exceptions::InvalidRequest.new('Invalid Action') - end - end - end - end -end diff --git a/lib/payrix/resource/mixin/update_disabled.rb b/lib/payrix/resource/mixin/update_disabled.rb deleted file mode 100644 index e533473..0000000 --- a/lib/payrix/resource/mixin/update_disabled.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Payrix - module Resource - module Mixin - module UpdateDisabled - def update(params = {}) - raise Payrix::Exceptions::InvalidRequest.new('Invalid Action') - end - end - end - end -end \ No newline at end of file diff --git a/lib/payrix/resource/note_documents.rb b/lib/payrix/resource/note_documents.rb deleted file mode 100644 index d3f1d7e..0000000 --- a/lib/payrix/resource/note_documents.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class NoteDocuments < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'noteDocuments' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :note, :custom, :type, :documentType, :name, - :description, :status, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/notes.rb b/lib/payrix/resource/notes.rb deleted file mode 100644 index a658f54..0000000 --- a/lib/payrix/resource/notes.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Notes < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'notes' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :hold, :txn, :terminalTxn, :entity, - :type, :note, :data, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/org_entities.rb b/lib/payrix/resource/org_entities.rb deleted file mode 100644 index c7abdb9..0000000 --- a/lib/payrix/resource/org_entities.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Payrix - module Resource - class OrgEntities < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'orgEntities' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :org, :entity] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/org_flow_actions.rb b/lib/payrix/resource/org_flow_actions.rb deleted file mode 100644 index b4f091a..0000000 --- a/lib/payrix/resource/org_flow_actions.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Payrix - module Resource - class OrgFlowActions < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'orgFlowActions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :orgFlow, :org, :action] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/org_flows.rb b/lib/payrix/resource/org_flows.rb deleted file mode 100644 index 74717a1..0000000 --- a/lib/payrix/resource/org_flows.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Payrix - module Resource - class OrgFlows < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'orgFlows' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :forlogin, :trigger, :team, :division] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/orgs.rb b/lib/payrix/resource/orgs.rb deleted file mode 100644 index 828d23c..0000000 --- a/lib/payrix/resource/orgs.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Payrix - module Resource - class Orgs < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'orgs' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :name, :description] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/payment_update_groups.rb b/lib/payrix/resource/payment_update_groups.rb deleted file mode 100644 index 5100e65..0000000 --- a/lib/payrix/resource/payment_update_groups.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class PaymentUpdateGroups < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'paymentUpdateGroups' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :payment] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/payment_updates.rb b/lib/payrix/resource/payment_updates.rb deleted file mode 100644 index 80a5907..0000000 --- a/lib/payrix/resource/payment_updates.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class PaymentUpdates < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'paymentUpdates' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :paymentUpdateGroup, :payment, :status, :token, :account, - :clientRef, :message, :expiration] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/payout_flows.rb b/lib/payrix/resource/payout_flows.rb deleted file mode 100644 index 9386131..0000000 --- a/lib/payrix/resource/payout_flows.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class PayoutFlows < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'payoutFlows' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :payoutLogin, :org, :entity, :trigger, - :schedule, :scheduleFactor, :um, :amount, :minimum, - :payoutInactive, :skipOffDays, :inactive, :frozen, :division, - :secondaryDescriptor, :billing, :start] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/payouts.rb b/lib/payrix/resource/payouts.rb deleted file mode 100644 index d98056e..0000000 --- a/lib/payrix/resource/payouts.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Payouts < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'payouts' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :account, :entity, :payoutFlow, :name, - :description, :schedule, :scheduleFactor, :start, :currency, - :um, :amount, :minimum, :float, :skipOffDays, - :inactive, :frozen, :sameDay, :maximum, :billing, - :secondaryDescriptor] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/pending_entries.rb b/lib/payrix/resource/pending_entries.rb deleted file mode 100644 index 8eabc7d..0000000 --- a/lib/payrix/resource/pending_entries.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Payrix - module Resource - class PendingEntries < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'pendingEntries' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :onentity, :fromentity, :fund, :opposingPendingEntry, - :entry, :adjustment, :profitShare, :chargeback, :disbursement, - :fee, :refund, :txn, :event, :eventId, - :description, :amount, :pending, :originalCurrency, :currencyRate, - :terminalTxn, :isFee, :entityDebt, :statement, :settlement, - :originalEventId, :originalEvent] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/plans.rb b/lib/payrix/resource/plans.rb deleted file mode 100644 index 7419289..0000000 --- a/lib/payrix/resource/plans.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Plans < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'plans' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :name, :description, :schedule, :scheduleFactor, - :amount, :inactive, :frozen, :maxFailures, :type, - :txnDescription, :order, :billing, :um] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/profit_share_results.rb b/lib/payrix/resource/profit_share_results.rb deleted file mode 100644 index d9aeefe..0000000 --- a/lib/payrix/resource/profit_share_results.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class ProfitShareResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'profitShareResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :profitShare, :entry, :amount, :message] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/profit_share_rules.rb b/lib/payrix/resource/profit_share_rules.rb deleted file mode 100644 index da64f06..0000000 --- a/lib/payrix/resource/profit_share_rules.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class ProfitShareRules < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'profitShareRules' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :profitShare, :name, :description, :type, :value, - :grouping, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/profit_shares.rb b/lib/payrix/resource/profit_shares.rb deleted file mode 100644 index e5932a0..0000000 --- a/lib/payrix/resource/profit_shares.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class ProfitShares < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'profitShares' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :forentity, :org, :division, - :type, :name, :description, :amount, :inactive, - :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/refunds.rb b/lib/payrix/resource/refunds.rb deleted file mode 100644 index 34fa3d5..0000000 --- a/lib/payrix/resource/refunds.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Refunds < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'refunds' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entry, :description, :amount] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/report_items.rb b/lib/payrix/resource/report_items.rb deleted file mode 100644 index add115f..0000000 --- a/lib/payrix/resource/report_items.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class ReportItems < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'reportItems' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :report, :search, :totals, :resource, :inactive, - :frozen, :expand, :expandSearch] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/report_results.rb b/lib/payrix/resource/report_results.rb deleted file mode 100644 index b6b3ffc..0000000 --- a/lib/payrix/resource/report_results.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class ReportResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'reportResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :report, :type, :documentType, :original, :status, - :effective, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/reports.rb b/lib/payrix/resource/reports.rb deleted file mode 100644 index 86320bc..0000000 --- a/lib/payrix/resource/reports.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Reports < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'reports' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :type, :description, :status, :schedule, - :scheduleFactor, :start, :finish, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/reserve_entries.rb b/lib/payrix/resource/reserve_entries.rb deleted file mode 100644 index a2a7ef7..0000000 --- a/lib/payrix/resource/reserve_entries.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class ReserveEntries < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'reserveEntries' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :fund, :txn, :hold, :reserve, - :entityReserve, :reserveEntry, :description, :release, :amount, - :onentity, :entry, :event, :eventId, :status, - :statusMessage] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/reserves.rb b/lib/payrix/resource/reserves.rb deleted file mode 100644 index c4f4124..0000000 --- a/lib/payrix/resource/reserves.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Reserves < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'reserves' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :org, :entity, :name, :description, - :percent, :release, :releaseFactor, :finish, :inactive, - :frozen, :max, :start, :hold, :division, - :level] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/secrets.rb b/lib/payrix/resource/secrets.rb deleted file mode 100644 index 4a98bf7..0000000 --- a/lib/payrix/resource/secrets.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Secrets < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'secrets' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :entity, :org, :division, :type, - :platform, :name, :description, :key, :locked, - :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/sessions.rb b/lib/payrix/resource/sessions.rb deleted file mode 100644 index 2824d76..0000000 --- a/lib/payrix/resource/sessions.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Sessions < Base - - include Mixin::UpdateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'sessions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :key, :public, :inactive, :frozen, - :token, :sso, :effectiveRoles] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/statement_entries.rb b/lib/payrix/resource/statement_entries.rb deleted file mode 100644 index 053a42a..0000000 --- a/lib/payrix/resource/statement_entries.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Payrix - module Resource - class StatementEntries < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'statementEntries' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :onentity, :billing, :statement, :fee, :profitShare, - :event, :eventId, :description, :amount, :deductedFromBalance, - :entity, :forentity, :originalEventId, :originalEvent] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/statements.rb b/lib/payrix/resource/statements.rb deleted file mode 100644 index d15c0cd..0000000 --- a/lib/payrix/resource/statements.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class Statements < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'statements' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :billing, :status, :totalPaid, :total, :currency, - :forentity, :entity, :start, :finish] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/subscription_tokens.rb b/lib/payrix/resource/subscription_tokens.rb deleted file mode 100644 index 60934b0..0000000 --- a/lib/payrix/resource/subscription_tokens.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Payrix - module Resource - class SubscriptionTokens < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'subscriptionTokens' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :subscription, :token, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/subscriptions.rb b/lib/payrix/resource/subscriptions.rb deleted file mode 100644 index 75d21ad..0000000 --- a/lib/payrix/resource/subscriptions.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Subscriptions < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'subscriptions' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :plan, :start, :finish, :tax, :descriptor, - :inactive, :frozen, :failures, :maxFailures, :origin, - :firstTxn, :txnDescription, :order, :authentication, :authenticationId, - :statementEntity] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/team_logins.rb b/lib/payrix/resource/team_logins.rb deleted file mode 100644 index 7ae4bfb..0000000 --- a/lib/payrix/resource/team_logins.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class TeamLogins < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'teamLogins' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :team, :create, :read, :update, - :delete, :reference, :teamAdmin] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/teams.rb b/lib/payrix/resource/teams.rb deleted file mode 100644 index 2594128..0000000 --- a/lib/payrix/resource/teams.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Teams < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'teams' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :login, :name, :description, :autoCascadeDisabled, :inactive, - :frozen, :autoCascadeOwner] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminal_txn_datas.rb b/lib/payrix/resource/terminal_txn_datas.rb deleted file mode 100644 index f72dcb7..0000000 --- a/lib/payrix/resource/terminal_txn_datas.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class TerminalTxnDatas < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminalTxnDatas' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :terminalTxn, :signature] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminal_txn_metadatas.rb b/lib/payrix/resource/terminal_txn_metadatas.rb deleted file mode 100644 index a3d3e15..0000000 --- a/lib/payrix/resource/terminal_txn_metadatas.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class TerminalTxnMetadatas < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminalTxnMetadatas' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :terminalTxn, :type, :field, :value] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminal_txn_refs.rb b/lib/payrix/resource/terminal_txn_refs.rb deleted file mode 100644 index 975f6a3..0000000 --- a/lib/payrix/resource/terminal_txn_refs.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class TerminalTxnRefs < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminalTxnRefs' - end - - ATTRS = [:terminalTxn, :ref, :stage] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminal_txn_results.rb b/lib/payrix/resource/terminal_txn_results.rb deleted file mode 100644 index 91a190b..0000000 --- a/lib/payrix/resource/terminal_txn_results.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class TerminalTxnResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminalTxnResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :terminalTxn, :type, :message, :code, :originalCode, - :bankCode] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminal_txns.rb b/lib/payrix/resource/terminal_txns.rb deleted file mode 100644 index 6f0ee46..0000000 --- a/lib/payrix/resource/terminal_txns.rb +++ /dev/null @@ -1,29 +0,0 @@ -module Payrix - module Resource - class TerminalTxns < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminalTxns' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :ipCreated, :ipModified, :merchant, :txn, :type, - :expiration, :currency, :fundingCurrency, :fee, :authDate, - :authCode, :order, :description, :traceNumber, :discount, - :shipping, :duty, :terminal, :terminalCapability, :entryMode, - :origin, :tax, :total, :cashback, :authorization, - :approved, :cvv, :cvvStatus, :swiped, :emv, - :signature, :pin, :unattended, :pos, :receipt, - :clientIp, :first, :middle, :last, :company, - :email, :address1, :address2, :city, :state, - :zip, :country, :phone, :status, :reserved, - :checkStage, :inactive, :frozen, :forterminalTxn, :token, - :binType, :tip, :paymentNumber, :paymentMethod, :payment] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/terminals.rb b/lib/payrix/resource/terminals.rb deleted file mode 100644 index 805638f..0000000 --- a/lib/payrix/resource/terminals.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class Terminals < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'terminals' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :merchant, :type, :capability, :environment, :autoClose, - :autoCloseTime, :name, :description, :address1, :address2, - :city, :state, :zip, :country, :timezone, - :status, :phone, :serial, :cloudEnabled] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/tokens.rb b/lib/payrix/resource/tokens.rb deleted file mode 100644 index 820469a..0000000 --- a/lib/payrix/resource/tokens.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class Tokens < Base - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'tokens' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :customer, :payment, :token, :expiration, :inactive, - :frozen, :name, :description, :custom, :authTokenCustomer, - :status] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/txn_datas.rb b/lib/payrix/resource/txn_datas.rb deleted file mode 100644 index 615175f..0000000 --- a/lib/payrix/resource/txn_datas.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Payrix - module Resource - class TxnDatas < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'txnDatas' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :txn, :signature] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/txn_metadatas.rb b/lib/payrix/resource/txn_metadatas.rb deleted file mode 100644 index a9f600d..0000000 --- a/lib/payrix/resource/txn_metadatas.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Payrix - module Resource - class TxnMetadatas < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'txnMetadatas' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :txn, :type, :field, :value] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/txn_results.rb b/lib/payrix/resource/txn_results.rb deleted file mode 100644 index 7f97921..0000000 --- a/lib/payrix/resource/txn_results.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Payrix - module Resource - class TxnResults < Base - - include Mixin::UpdateDisabled - include Mixin::DeleteDisabled - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'txnResults' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :txn, :type, :message, :code, :bankCode, - :originalCode] - - attr_accessor *ATTRS - - end - end -end diff --git a/lib/payrix/resource/txns.rb b/lib/payrix/resource/txns.rb deleted file mode 100644 index de76292..0000000 --- a/lib/payrix/resource/txns.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Payrix - module Resource - class Txns < Base - include Mixin::DeleteDisabled - include Mixin::AttrCasters - - def initialize(params) - super(params, ATTRS) - - @resource_name = 'txns' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :ipCreated, :ipModified, :merchant, :token, :payment, - :fortxn, :fromtxn, :batch, :subscription, :type, - :expiration, :currency, :authDate, :authCode, :captured, - :settled, :settledCurrency, :settledTotal, :allowPartial, :order, - :description, :descriptor, :terminal, :terminalCapability, :entryMode, - :origin, :tax, :total, :cashback, :authorization, - :approved, :cvv, :swiped, :emv, :signature, - :unattended, :clientIp, :first, :middle, :last, - :company, :email, :address1, :address2, :city, - :state, :zip, :country, :phone, :status, - :refunded, :reserved, :misused, :imported, :inactive, - :frozen, :discount, :shipping, :duty, :pin, - :traceNumber, :cvvStatus, :unauthReason, :fee, :fundingCurrency, - :authentication, :authenticationId, :cofType, :copyReason, :originalApproved, - :currencyConversion, :serviceCode, :authTokenCustomer, :debtRepayment, :statement, - :convenienceFee, :surcharge, :channel, :funded, :fundingEnabled, - :requestSequence, :processedSequence, :txnResults, :payment] - - attr_accessor *ATTRS - attr_cast_to_integer :status - end - end -end diff --git a/lib/payrix/resource/vendors.rb b/lib/payrix/resource/vendors.rb deleted file mode 100644 index 55983f7..0000000 --- a/lib/payrix/resource/vendors.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Payrix - module Resource - class Vendors < Base - - include Mixin::CreateDisabled - def initialize(params) - super(params, ATTRS) - - @resource_name = 'vendors' - end - - ATTRS = [:id, :created, :modified, :creator, :modifier, - :entity, :division, :inactive, :frozen] - - attr_accessor *ATTRS - - end - end -end diff --git a/spec/lib/payrix/resource/base_spec.rb b/spec/lib/payrix/resource/base_spec.rb deleted file mode 100644 index 1299a40..0000000 --- a/spec/lib/payrix/resource/base_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -RSpec.describe Payrix::Resource::Base do - Payrix::Resource::Tests = Class.new(Payrix::Resource::Base) do - def initialize(params) - super(params, [:status, :amount]) - - @resource_name = 'test' - end - end - - let(:resource) { Payrix::Resource::Tests.new(status: '1', amount: '500') } - - before do - fixture_base_path = File.join('spec', 'fixtures', 'payrix', 'resource') - fixture_file_path = File.join(fixture_base_path, 'error.json') - - WebMock - .stub_request(:post, 'https://api.payrix.com/test') - .to_return(body: File.read(fixture_file_path), status: 200) - end - - it 'raises Payrix::Exceptions::ApiError with the message which includes the errors payload' do - expect { resource.create } - .to raise_error(Payrix::Exceptions::ApiError) - .with_message( - 'There are errors in the response, '\ - '[{"code"=>13, "severity"=>4, "msg"=>"No such action and/or resource", "errorCode"=>"invalid_resource"}]', - ) - end -end diff --git a/spec/lib/payrix/resource/mixin/attr_casters_spec.rb b/spec/lib/payrix/resource/mixin/attr_casters_spec.rb deleted file mode 100644 index 981b48b..0000000 --- a/spec/lib/payrix/resource/mixin/attr_casters_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -RSpec.describe Payrix::Resource::Mixin::AttrCasters do - Payrix::Resource::Tests = Class.new(Payrix::Resource::Base) do - include Payrix::Resource::Mixin::AttrCasters - - def initialize(params) - super(params, [:status, :amount]) - - @resource_name = 'test' - end - - attr_accessor :status, :amount - attr_cast_to_integer :status, :amount - end - - let(:resource) { Payrix::Resource::Tests.new(status: '1', amount: '500') } - - it 'casts the specified attributes as integers' do - expect(resource.status).to eq 1 - expect(resource.amount).to eq 500 - end - - it 'exposes additional methods, #..._raw_value, for all attributes, which returns the value pre-casting' do - expect(resource.status_raw_value).to eq '1' - expect(resource.amount_raw_value).to eq '500' - end -end