Module: Ibanity

Defined in:
lib/ibanity.rb,
lib/ibanity/util.rb,
lib/ibanity/error.rb,
lib/ibanity/client.rb,
lib/ibanity/version.rb,
lib/ibanity/webhook.rb,
lib/ibanity/collection.rb,
lib/ibanity/http_signature.rb,
lib/ibanity/api/webhooks/key.rb,
lib/ibanity/api/xs2a/account.rb,
lib/ibanity/api/xs2a/holding.rb,
lib/ibanity/api/base_resource.rb,
lib/ibanity/api/flat_resource.rb,
lib/ibanity/api/webhooks/xs2a.rb,
lib/ibanity/api/xs2a/customer.rb,
lib/ibanity/api/consent/consent.rb,
lib/ibanity/api/o_auth_resource.rb,
lib/ibanity/api/xs2a/transaction.rb,
lib/ibanity/api/ponto_connect/token.rb,
lib/ibanity/api/ponto_connect/usage.rb,
lib/ibanity/api/isabel_connect/token.rb,
lib/ibanity/api/xs2a/synchronization.rb,
lib/ibanity/api/ponto_connect/account.rb,
lib/ibanity/api/ponto_connect/payment.rb,
lib/ibanity/api/isabel_connect/account.rb,
lib/ibanity/api/isabel_connect/balance.rb,
lib/ibanity/api/webhooks/ponto_connect.rb,
lib/ibanity/api/ponto_connect/user_info.rb,
lib/ibanity/api/xs2a/pending_transaction.rb,
lib/ibanity/api/ponto_connect/integration.rb,
lib/ibanity/api/ponto_connect/transaction.rb,
lib/ibanity/api/isabel_connect/transaction.rb,
lib/ibanity/api/ponto_connect/bulk_payment.rb,
lib/ibanity/api/xs2a/batch_synchronization.rb,
lib/ibanity/api/xs2a/customer_access_token.rb,
lib/ibanity/api/xs2a/financial_institution.rb,
lib/ibanity/api/isabel_connect/access_token.rb,
lib/ibanity/api/consent/processing_operation.rb,
lib/ibanity/api/isabel_connect/refresh_token.rb,
lib/ibanity/api/isabel_connect/account_report.rb,
lib/ibanity/api/ponto_connect/payment_request.rb,
lib/ibanity/api/ponto_connect/synchronization.rb,
lib/ibanity/api/xs2a/payment_initiation_request.rb,
lib/ibanity/api/xs2a/transaction_delete_request.rb,
lib/ibanity/api/ponto_connect/onboarding_details.rb,
lib/ibanity/api/ponto_connect/integration_account.rb,
lib/ibanity/api/ponto_connect/pending_transaction.rb,
lib/ibanity/api/xs2a/financial_institution_country.rb,
lib/ibanity/api/isabel_connect/intraday_transaction.rb,
lib/ibanity/api/ponto_connect/financial_institution.rb,
lib/ibanity/api/xs2a/bulk_payment_initiation_request.rb,
lib/ibanity/api/ponto_connect/reauthorization_request.rb,
lib/ibanity/api/xs2a/account_information_access_request.rb,
lib/ibanity/api/xs2a/sandbox/financial_institution_user.rb,
lib/ibanity/api/ponto_connect/payment_activation_request.rb,
lib/ibanity/api/xs2a/periodic_payment_initiation_request.rb,
lib/ibanity/api/xs2a/sandbox/financial_institution_account.rb,
lib/ibanity/api/xs2a/sandbox/financial_institution_holding.rb,
lib/ibanity/api/xs2a/payment_initiation_request_authorization.rb,
lib/ibanity/api/isabel_connect/bulk_payment_initiation_request.rb,
lib/ibanity/api/xs2a/sandbox/financial_institution_transaction.rb,
lib/ibanity/api/xs2a/bulk_payment_initiation_request_authorization.rb,
lib/ibanity/api/ponto_connect/sandbox/financial_institution_account.rb,
lib/ibanity/api/xs2a/account_information_access_request_authorization.rb,
lib/ibanity/api/xs2a/periodic_payment_initiation_request_authorization.rb,
lib/ibanity/api/ponto_connect/sandbox/financial_institution_transaction.rb

Defined Under Namespace

Modules: Consent, IsabelConnect, PontoConnect, Util, Webhook, Webhooks, Xs2a Classes: BaseResource, Client, Collection, Error, FlatResource, HttpSignature, OAuthResource

Constant Summary collapse

VERSION =
"2.5.0"

Class Method Summary collapse

Class Method Details

.clientObject



29
30
31
32
# File 'lib/ibanity.rb', line 29

def client
  options = configuration.to_h.delete_if { |_, v| v.nil? }
  @client ||= Ibanity::Client.new(**options)
end

.configurationObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ibanity.rb', line 46

def configuration
  @configuration ||= Struct.new(
    :certificate,
    :key,
    :key_passphrase,
    :signature_certificate,
    :signature_certificate_id,
    :signature_key,
    :signature_key_passphrase,
    :isabel_connect_client_id,
    :isabel_connect_client_secret,
    :ponto_connect_client_id,
    :ponto_connect_client_secret,
    :api_scheme,
    :api_host,
    :ssl_ca_file,
    :application_id,
    :debug_http_requests,
    :timeout
  ).new
end

.configure {|configuration| ... } ⇒ Object

Yields:



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ibanity.rb', line 34

def configure
  @client                    = nil
  @xs2a_api_schema           = nil
  @isabel_connect_api_schema = nil
  @consent_api_schema        = nil
  @ponto_connect_api_schema  = nil
  @webhooks_api_schema       = nil
  @sandbox_api_schema        = nil
  @configuration             = nil
  yield configuration
end


84
85
86
# File 'lib/ibanity.rb', line 84

def consent_api_schema
  @consent_api_schema ||= client.get(uri: "#{client.base_uri}/consent")["links"]
end

.isabel_connect_api_schemaObject



76
77
78
# File 'lib/ibanity.rb', line 76

def isabel_connect_api_schema
  @isabel_connect_api_schema ||= client.get(uri: "#{client.base_uri}/isabel-connect")["links"]
end

.method_missing(method_name, *args, &block) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/ibanity.rb', line 100

def method_missing(method_name, *args, &block)
  if client.respond_to?(method_name)
    client.__send__(method_name, *args, &block)
  else
    super
  end
end

.ponto_connect_api_schemaObject



80
81
82
# File 'lib/ibanity.rb', line 80

def ponto_connect_api_schema
  @ponto_connect_api_schema ||= client.get(uri: "#{client.base_uri}/ponto-connect")["links"]
end

.respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/ibanity.rb', line 96

def respond_to_missing?(method_name, include_private = false)
  client.respond_to?(method_name, include_private)
end

.sandbox_api_schemaObject



72
73
74
# File 'lib/ibanity.rb', line 72

def sandbox_api_schema
  @sandbox_api_schema ||= client.get(uri: "#{client.base_uri}/sandbox")["links"]
end

.webhook_keysObject



92
93
94
# File 'lib/ibanity.rb', line 92

def webhook_keys
  @webhook_keys ||= Ibanity::Webhooks::Key.list
end

.webhooks_api_schemaObject



88
89
90
# File 'lib/ibanity.rb', line 88

def webhooks_api_schema
  @webhooks_api_schema ||= client.get(uri: "#{client.base_uri}/webhooks")["links"]
end

.xs2a_api_schemaObject



68
69
70
# File 'lib/ibanity.rb', line 68

def xs2a_api_schema
  @xs2a_api_schema ||= client.get(uri: "#{client.base_uri}/xs2a")["links"]
end