corepro_fvr 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +15 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/Rakefile +2 -0
- data/config-sample.yml +5 -0
- data/corepro_fvr.gemspec +25 -0
- data/lib/corepro.rb +15 -0
- data/lib/corepro/account.rb +111 -0
- data/lib/corepro/account_close.rb +21 -0
- data/lib/corepro/bank_document.rb +42 -0
- data/lib/corepro/card.rb +90 -0
- data/lib/corepro/connection.rb +90 -0
- data/lib/corepro/core_pro_api_exception.rb +26 -0
- data/lib/corepro/customer.rb +140 -0
- data/lib/corepro/customer_beneficiary.rb +42 -0
- data/lib/corepro/customer_document.rb +22 -0
- data/lib/corepro/external_account.rb +84 -0
- data/lib/corepro/external_account_document.rb +34 -0
- data/lib/corepro/models/account_access.rb +25 -0
- data/lib/corepro/models/account_id_only.rb +9 -0
- data/lib/corepro/models/api_error.rb +14 -0
- data/lib/corepro/models/customer_address.rb +17 -0
- data/lib/corepro/models/customer_answer.rb +9 -0
- data/lib/corepro/models/customer_beneficiary_id_only.rb +8 -0
- data/lib/corepro/models/customer_id_only.rb +8 -0
- data/lib/corepro/models/customer_message.rb +10 -0
- data/lib/corepro/models/customer_phone.rb +11 -0
- data/lib/corepro/models/customer_question.rb +21 -0
- data/lib/corepro/models/customer_response.rb +28 -0
- data/lib/corepro/models/customer_verify_request.rb +28 -0
- data/lib/corepro/models/envelope.rb +37 -0
- data/lib/corepro/models/external_account_id_only.rb +8 -0
- data/lib/corepro/models/external_account_verify.rb +13 -0
- data/lib/corepro/models/file_content.rb +10 -0
- data/lib/corepro/models/json_base.rb +93 -0
- data/lib/corepro/models/model_base.rb +26 -0
- data/lib/corepro/models/program_account.rb +20 -0
- data/lib/corepro/models/program_checking.rb +38 -0
- data/lib/corepro/models/program_e_code.rb +31 -0
- data/lib/corepro/models/program_external_account.rb +21 -0
- data/lib/corepro/models/program_interest_rate.rb +18 -0
- data/lib/corepro/models/program_limit.rb +12 -0
- data/lib/corepro/models/program_prepaid.rb +37 -0
- data/lib/corepro/models/program_savings.rb +36 -0
- data/lib/corepro/program.rb +74 -0
- data/lib/corepro/statement.rb +25 -0
- data/lib/corepro/transaction.rb +53 -0
- data/lib/corepro/transfer.rb +42 -0
- data/lib/corepro/utils/logger.rb +9 -0
- data/lib/corepro/utils/requestor.rb +120 -0
- data/lib/corepro/version.rb +4 -0
- data/q2labs_public.pem +9 -0
- data/test.pdf +0 -0
- data/test/a_program_test.rb +12 -0
- data/test/aa_customer_test.rb +78 -0
- data/test/ab_account_test.rb +45 -0
- data/test/ac_external_account_test.rb +39 -0
- data/test/ad_customer_beneficiary_test.rb +43 -0
- data/test/ae_customer_document_test.rb +16 -0
- data/test/af_bankdocument_test.rb +20 -0
- data/test/ag_external_account_document_test.rb +18 -0
- data/test/ai_statement_test.rb +23 -0
- data/test/aj_transfer_test.rb +53 -0
- data/test/ak_transaction_test.rb +19 -0
- data/test/al_card_test.rb +51 -0
- data/test/core_pro_test_base.rb +30 -0
- metadata +170 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
require_relative 'customer_answer'
|
3
|
+
module CorePro
|
4
|
+
module Models
|
5
|
+
class CustomerQuestion < JsonBase
|
6
|
+
attr_accessor :answers
|
7
|
+
attr_accessor :prompt
|
8
|
+
attr_accessor :type
|
9
|
+
|
10
|
+
def from_json! json, classDefs
|
11
|
+
classDefs = classDefs || {}
|
12
|
+
super json, classDefs
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
super
|
17
|
+
@answers = []
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'model_base'
|
2
|
+
require_relative 'customer_message'
|
3
|
+
require_relative 'customer_question'
|
4
|
+
|
5
|
+
module CorePro
|
6
|
+
module Models
|
7
|
+
class CustomerResponse < ModelBase
|
8
|
+
attr_accessor :customerId
|
9
|
+
attr_accessor :messages
|
10
|
+
attr_accessor :questions
|
11
|
+
attr_accessor :verificationId
|
12
|
+
attr_accessor :verificationStatus
|
13
|
+
|
14
|
+
def from_json! json, classDefs
|
15
|
+
classDefs = classDefs || {}
|
16
|
+
classDefs['messages'] = CustomerMessage
|
17
|
+
classDefs['questions'] = CustomerQuestion
|
18
|
+
super json, classDefs
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
super
|
23
|
+
@messages = []
|
24
|
+
@questions = []
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative 'model_base'
|
2
|
+
require_relative '../utils/requestor'
|
3
|
+
require_relative 'customer_response'
|
4
|
+
require_relative 'customer_answer'
|
5
|
+
|
6
|
+
module CorePro
|
7
|
+
module Models
|
8
|
+
class CustomerVerifyRequest < ModelBase
|
9
|
+
attr_accessor :customerId
|
10
|
+
attr_accessor :verificationId
|
11
|
+
attr_accessor :answers
|
12
|
+
|
13
|
+
def from_json! json, classDefs
|
14
|
+
classDefs = classDefs || {}
|
15
|
+
classDefs['answers'] = CustomerAnswer
|
16
|
+
super json, classDefs
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@answers = []
|
21
|
+
end
|
22
|
+
|
23
|
+
def verify(connection = nil, loggingObject = nil)
|
24
|
+
CorePro::Utils::Requestor.post('/customer/verify', CustomerResponse, self, connection, loggingObject)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'model_base'
|
2
|
+
require_relative 'api_error'
|
3
|
+
|
4
|
+
module CorePro
|
5
|
+
module Models
|
6
|
+
class Envelope < ModelBase
|
7
|
+
attr_accessor :data
|
8
|
+
attr_accessor :errors
|
9
|
+
attr_accessor :status
|
10
|
+
attr_accessor :rawRequestBody
|
11
|
+
attr_accessor :rawResponseBody
|
12
|
+
|
13
|
+
def from_json! json, classDefs = {}
|
14
|
+
classDefs = classDefs || {}
|
15
|
+
classDefs['errors'] = ApiError
|
16
|
+
super json, classDefs
|
17
|
+
|
18
|
+
if classDefs.has_key?('data')
|
19
|
+
if @data.kind_of?(Array)
|
20
|
+
@data.each {|item|
|
21
|
+
if item.instance_variable_defined?('@requestId')
|
22
|
+
item.requestId = @requestId
|
23
|
+
end
|
24
|
+
}
|
25
|
+
else
|
26
|
+
if @data.instance_variable_defined?('@requestId')
|
27
|
+
@data.requestId = @requestId
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
self
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module CorePro
|
4
|
+
module Models
|
5
|
+
class JsonBase
|
6
|
+
def is_hash?
|
7
|
+
false
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_hash
|
11
|
+
hash = {}
|
12
|
+
self.instance_variables.each do |var|
|
13
|
+
val = self.instance_variable_get var
|
14
|
+
if val != nil
|
15
|
+
if val.instance_of?(Array)
|
16
|
+
arr = []
|
17
|
+
val.each do |x|
|
18
|
+
arr.push(x.to_hash)
|
19
|
+
end
|
20
|
+
hash[var.to_s.delete('@')] = arr
|
21
|
+
else
|
22
|
+
hash[var.to_s.delete('@')] = val
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
hash
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_json
|
31
|
+
hash = {}
|
32
|
+
self.instance_variables.each do |var|
|
33
|
+
val = self.instance_variable_get var
|
34
|
+
if val != nil
|
35
|
+
if val.instance_of?(String)
|
36
|
+
hash[var.to_s.delete('@')] = val
|
37
|
+
elsif val.instance_of?(Array)
|
38
|
+
# do not serialize empty arrays. no point.
|
39
|
+
if val.length > 0
|
40
|
+
arr = []
|
41
|
+
val.each do |x|
|
42
|
+
h = x.to_hash
|
43
|
+
arr.push h
|
44
|
+
end
|
45
|
+
hash[var.to_s.delete('@')] = arr
|
46
|
+
end
|
47
|
+
else
|
48
|
+
hash[var.to_s.delete('@')] = val.to_json
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
hash.to_json
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
def from_json! json, classDefs = nil
|
58
|
+
classDefs = classDefs || {}
|
59
|
+
json.each do |var, val|
|
60
|
+
# if self.instance_variable_defined?("@#{var}")
|
61
|
+
cd = nil
|
62
|
+
cd = classDefs[var] if classDefs.has_key? var
|
63
|
+
if cd == nil
|
64
|
+
self.instance_variable_set "@#{var}", val
|
65
|
+
else
|
66
|
+
if val.kind_of?(Array)
|
67
|
+
arr = []
|
68
|
+
val.each do |x|
|
69
|
+
item = cd.new
|
70
|
+
item.from_json! x, nil
|
71
|
+
arr.push item
|
72
|
+
end
|
73
|
+
self.instance_variable_set "@#{var}", arr
|
74
|
+
elsif cd.new.is_hash?
|
75
|
+
# elsif val.kind_of?(Hash)
|
76
|
+
hash = {}
|
77
|
+
val.each do |key, itemJson|
|
78
|
+
item = cd.new
|
79
|
+
item.from_json! itemJson, nil
|
80
|
+
hash[key] = item
|
81
|
+
end
|
82
|
+
self.instance_variable_set "@#{var}", hash
|
83
|
+
else
|
84
|
+
item = cd.new
|
85
|
+
item.from_json! val, nil
|
86
|
+
self.instance_variable_set "@#{var}", item
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
module CorePro
|
5
|
+
module Models
|
6
|
+
class ModelBase < JsonBase
|
7
|
+
attr_accessor :requestId
|
8
|
+
|
9
|
+
def self.escape(val)
|
10
|
+
if val.to_s.empty?
|
11
|
+
''
|
12
|
+
else
|
13
|
+
URI::escape(val)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_s
|
18
|
+
vars = self.instance_variables.map{|v|
|
19
|
+
"#{v}=#{instance_variable_get(v).inspect}"
|
20
|
+
}.join(", ")
|
21
|
+
"<#{self.class}: #{vars}>"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
module CorePro
|
3
|
+
module Models
|
4
|
+
class ProgramAccount < JsonBase
|
5
|
+
|
6
|
+
def is_hash?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_accessor :programAccountId
|
11
|
+
attr_accessor :type
|
12
|
+
attr_accessor :accountNumber
|
13
|
+
attr_accessor :accountNumberMasked
|
14
|
+
attr_accessor :description
|
15
|
+
attr_accessor :accountBalance
|
16
|
+
attr_accessor :isActive
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
require_relative 'program_interest_rate'
|
3
|
+
require_relative 'program_limit'
|
4
|
+
module CorePro
|
5
|
+
module Models
|
6
|
+
class ProgramChecking < JsonBase
|
7
|
+
|
8
|
+
def is_hash?
|
9
|
+
true
|
10
|
+
end
|
11
|
+
attr_accessor :category
|
12
|
+
attr_accessor :type
|
13
|
+
attr_accessor :productId
|
14
|
+
attr_accessor :balanceLimit
|
15
|
+
attr_accessor :interestRates
|
16
|
+
attr_accessor :isExternalWithdrawEnabled
|
17
|
+
attr_accessor :isInterestEnabled
|
18
|
+
attr_accessor :isRecurringContributionEnabled
|
19
|
+
attr_accessor :perTransactionDepositLimit
|
20
|
+
attr_accessor :perTransactionWithdrawLimit
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
super
|
24
|
+
@interestRates = []
|
25
|
+
end
|
26
|
+
|
27
|
+
def from_json! json, classDefs
|
28
|
+
classDefs = classDefs || {}
|
29
|
+
classDefs['balanceLimit'] = CorePro::Models::ProgramLimit
|
30
|
+
classDefs['interestRates'] = CorePro::Models::ProgramInterestRate
|
31
|
+
classDefs['perTransactionDepositLimit'] = CorePro::Models::ProgramLimit
|
32
|
+
classDefs['perTransactionWithdrawLimit'] = CorePro::Models::ProgramLimit
|
33
|
+
|
34
|
+
super json, classDefs
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
module CorePro
|
3
|
+
module Models
|
4
|
+
class ProgramECode < JsonBase
|
5
|
+
|
6
|
+
def is_hash?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_accessor :category
|
11
|
+
attr_accessor :type
|
12
|
+
attr_accessor :programECodeId
|
13
|
+
attr_accessor :productCode
|
14
|
+
attr_accessor :minimumAmount
|
15
|
+
attr_accessor :maximumAmount
|
16
|
+
attr_accessor :name
|
17
|
+
attr_accessor :imageUrl
|
18
|
+
attr_accessor :isReissueSupported
|
19
|
+
|
20
|
+
def initialize
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
24
|
+
def from_json! json, classDefs
|
25
|
+
classDefs = classDefs || {}
|
26
|
+
|
27
|
+
super json, classDefs
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
module CorePro
|
3
|
+
module Models
|
4
|
+
class ProgramExternalAccount < JsonBase
|
5
|
+
|
6
|
+
def is_hash?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_accessor :programExternalAccountId
|
11
|
+
attr_accessor :type
|
12
|
+
attr_accessor :routingNumber
|
13
|
+
attr_accessor :accountNumber
|
14
|
+
attr_accessor :accountNumberMasked
|
15
|
+
attr_accessor :description
|
16
|
+
attr_accessor :nachaName
|
17
|
+
attr_accessor :isActive
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'json_base'
|
2
|
+
module CorePro
|
3
|
+
module Models
|
4
|
+
class ProgramInterestRate < JsonBase
|
5
|
+
attr_accessor :tier
|
6
|
+
attr_accessor :apy
|
7
|
+
attr_accessor :apr
|
8
|
+
attr_accessor :minimumAmount
|
9
|
+
attr_accessor :maximumAmount
|
10
|
+
attr_accessor :effectiveDate
|
11
|
+
attr_accessor :expireDate
|
12
|
+
attr_accessor :rateEffectiveDate
|
13
|
+
attr_accessor :rateExpireDate
|
14
|
+
attr_accessor :description
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|