corepro 0.0.9 → 1.0.0
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 +5 -13
- data/.gitignore +15 -15
- data/.idea/.rakeTasks +1 -1
- data/.idea/corepro-sdk-ruby.iml +12 -134
- data/.idea/modules.xml +1 -3
- data/CorePro.gemspec +25 -23
- data/Gemfile +14 -14
- data/README.md +47 -47
- data/Rakefile +2 -2
- data/lib/corepro.rb +13 -13
- data/lib/corepro/account.rb +47 -6
- data/lib/corepro/bank_document.rb +2 -2
- data/lib/corepro/card.rb +91 -0
- data/lib/corepro/customer.rb +28 -34
- data/lib/corepro/customer_beneficiary.rb +4 -15
- data/lib/corepro/customer_document.rb +0 -10
- data/lib/corepro/external_account.rb +8 -21
- data/lib/corepro/models/account_access.rb +25 -0
- data/lib/corepro/models/customer_beneficiary_id_only.rb +8 -8
- data/lib/corepro/models/model_base.rb +1 -1
- data/lib/corepro/models/program_account.rb +20 -0
- data/lib/corepro/models/program_checking.rb +36 -36
- data/lib/corepro/models/program_e_code.rb +30 -30
- data/lib/corepro/models/program_external_account.rb +21 -0
- data/lib/corepro/models/program_interest_rate.rb +5 -0
- data/lib/corepro/models/program_prepaid.rb +36 -36
- data/lib/corepro/models/program_savings.rb +35 -35
- data/lib/corepro/program.rb +9 -0
- data/lib/corepro/transaction.rb +8 -1
- data/lib/corepro/utils/requestor.rb +3 -3
- data/lib/corepro/version.rb +4 -4
- data/test/a_program_test.rb +12 -0
- data/test/aa_customer_test.rb +74 -0
- data/test/ab_account_test.rb +44 -0
- data/test/ac_external_account_test.rb +39 -0
- data/test/ad_customer_beneficiary_test.rb +42 -42
- data/test/ae_customer_document_test.rb +15 -15
- data/test/af_bankdocument_test.rb +19 -19
- data/test/ag_external_account_document_test.rb +17 -17
- data/test/ai_statement_test.rb +22 -22
- data/test/aj_transfer_test.rb +53 -0
- data/test/ak_transaction_test.rb +18 -8
- data/test/core_pro_test_base.rb +9 -23
- metadata +50 -41
- data/.idea/runConfigurations/All_tests_in_corepro_sdk_ruby__corepro_sdk_ruby.xml +0 -34
- data/test/aa_customer_nacha_test.rb +0 -63
- data/test/aa_customer_prepaid_test.rb +0 -55
- data/test/aaa_program_test.rb +0 -11
- data/test/ab_account_nacha_test.rb +0 -46
- data/test/ab_account_prepaid_test.rb +0 -46
- data/test/ac_external_account_nacha_test.rb +0 -6
- data/test/ac_external_account_prepaid_test.rb +0 -46
- data/test/aj_transfer_nacha_test.rb +0 -6
- data/test/aj_transfer_prepaid_test.rb +0 -36
@@ -1,34 +0,0 @@
|
|
1
|
-
<component name="ProjectRunConfigurationManager">
|
2
|
-
<configuration default="false" name="All tests in corepro-sdk-ruby: corepro-sdk-ruby" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
|
3
|
-
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
|
4
|
-
<module name="corepro-sdk-ruby" />
|
5
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
6
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
7
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
8
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
9
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
10
|
-
<envs>
|
11
|
-
<env name="JRUBY_OPTS" value="-X+O" />
|
12
|
-
</envs>
|
13
|
-
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
14
|
-
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
15
|
-
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov" />
|
16
|
-
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
17
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="$MODULE_DIR$/test" />
|
18
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
19
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/{*_test,test_*}.rb" />
|
20
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
|
21
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="ALL_IN_FOLDER" />
|
22
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
23
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
24
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
25
|
-
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
26
|
-
<RunnerSettings RunnerId="RubyCover" />
|
27
|
-
<RunnerSettings RunnerId="RubyDebugRunner" />
|
28
|
-
<RunnerSettings RunnerId="RubyRunner" />
|
29
|
-
<ConfigurationWrapper RunnerId="RubyCover" />
|
30
|
-
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
31
|
-
<ConfigurationWrapper RunnerId="RubyRunner" />
|
32
|
-
<method />
|
33
|
-
</configuration>
|
34
|
-
</component>
|
@@ -1,63 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/customer'
|
3
|
-
require_relative '../lib/corepro/models/customer_response'
|
4
|
-
|
5
|
-
class AaCustomerNachaTest # < CoreProTestBase
|
6
|
-
|
7
|
-
def test_aaa_initiate
|
8
|
-
c = CorePro::Customer.new
|
9
|
-
c.birthDate = '01/01/1985'
|
10
|
-
c.culture = 'en-US'
|
11
|
-
c.firstName = 'Joey'
|
12
|
-
c.middleName = 'Flanagan'
|
13
|
-
c.lastName = "McTester#{@@timestamp}"
|
14
|
-
c.gender = 'M'
|
15
|
-
c.isDocumentsAccepted = true
|
16
|
-
c.isSubjectToBackupWithholding = false
|
17
|
-
c.isOptedInToBankCommunication = false
|
18
|
-
c.tag = "jfm#{@@timestamp}"
|
19
|
-
c.taxId = '012341234'
|
20
|
-
|
21
|
-
@@nachaCustomerInitiateResponse = c.initiate(@@nachaConn, nil)
|
22
|
-
@@nachaCustomerId = @@nachaCustomerInitiateResponse.customerId
|
23
|
-
|
24
|
-
assert @@nachaCustomerId > 0
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_aaa_verify
|
28
|
-
c = CorePro::Customer.new
|
29
|
-
c.customerId = @@nachaCustomerId
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_get
|
34
|
-
c = CorePro::Customer.get @@nachaCustomerId, @@nachaConn, nil
|
35
|
-
assert c != nil, "Could not 'get' customerId #{@@nachaCustomerId}"
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_getByTag
|
39
|
-
c = CorePro::Customer.getByTag "jfm#{@@timestamp}", @@nachaConn, nil
|
40
|
-
assert c != nil, "Could not 'getByTag' tag 'jfm#{@@timestamp}'"
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_list
|
44
|
-
cs = CorePro::Customer.list 0, 15, @@nachaConn, nil
|
45
|
-
assert cs != nil && cs.length > 0, "Could not list customers"
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_search
|
49
|
-
c = CorePro::Customer.new
|
50
|
-
c.lastName = "McTester#{@@timestamp}"
|
51
|
-
cs = c.search nil, nil, @@nachaConn, nil
|
52
|
-
assert cs != nil && cs.length > 0, "Could not search 'McTester#{@@timestamp}'"
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_update
|
56
|
-
c = CorePro::Customer.new
|
57
|
-
c.customerId = @@nachaCustomerId
|
58
|
-
c.firstName = "Joey#{@@timestamp}"
|
59
|
-
customerId = c.update @@nachaConn, nil
|
60
|
-
assert customerId > 0
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/customer'
|
3
|
-
|
4
|
-
class AaCustomerPrepaidTest < CoreProTestBase
|
5
|
-
|
6
|
-
def test_create
|
7
|
-
|
8
|
-
c = CorePro::Customer.new
|
9
|
-
c.birthDate = '01/01/1985'
|
10
|
-
c.culture = 'en-US'
|
11
|
-
c.firstName = 'Joey'
|
12
|
-
c.middleName = 'Flanagan'
|
13
|
-
c.lastName = "McTester Ruby #{@@timestamp}"
|
14
|
-
c.gender = 'M'
|
15
|
-
c.isDocumentsAccepted = true
|
16
|
-
c.isSubjectToBackupWithholding = false
|
17
|
-
c.isOptedInToBankCommunication = false
|
18
|
-
c.tag = "jfm#{@@timestamp}"
|
19
|
-
c.taxId = '012341234'
|
20
|
-
|
21
|
-
@@prepaidCustomerId = c.create(@@prepaidConn, nil)
|
22
|
-
assert @@prepaidCustomerId > 0
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_get
|
26
|
-
c = CorePro::Customer.get @@prepaidCustomerId, @@prepaidConn, nil
|
27
|
-
assert c != nil, "Could not 'get' customerId #{@@prepaidCustomerId}"
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_getByTag
|
31
|
-
c = CorePro::Customer.getByTag "jfm#{@@timestamp}", @@prepaidConn, nil
|
32
|
-
assert c != nil, "Could not 'getByTag' tag 'jfm#{@@timestamp}'"
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_list
|
36
|
-
cs = CorePro::Customer.list 0, 15, @@prepaidConn, nil
|
37
|
-
assert cs != nil && cs.length > 0, "Could not list customers"
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_search
|
41
|
-
c = CorePro::Customer.new
|
42
|
-
c.lastName = "McTester Ruby #{@@timestamp}"
|
43
|
-
cs = c.search nil, nil, @@prepaidConn, nil
|
44
|
-
assert cs != nil && cs.length > 0, "Could not search 'McTester#{@@timestamp}'"
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_update
|
48
|
-
c = CorePro::Customer.new
|
49
|
-
c.customerId = @@prepaidCustomerId
|
50
|
-
c.firstName = "Joey#{@@timestamp}"
|
51
|
-
customerId = c.update @@prepaidConn, nil
|
52
|
-
assert customerId > 0
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
data/test/aaa_program_test.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require_relative 'core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/program'
|
3
|
-
|
4
|
-
class AaaProgramTest < CoreProTestBase
|
5
|
-
def test_get
|
6
|
-
puts @@prepaidConn
|
7
|
-
p = CorePro::Program.get @@prepaidConn, nil
|
8
|
-
puts p.prepaidProducts['Prepaid']
|
9
|
-
assert_equal 'CoreProPrepaidTester', p.name
|
10
|
-
end
|
11
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/account'
|
3
|
-
|
4
|
-
class AbAccountNachaTest #< CoreProTestBase
|
5
|
-
|
6
|
-
def test_create
|
7
|
-
a = CorePro::Account.new
|
8
|
-
a.customerId = @@nachaCustomerId
|
9
|
-
a.tag = "act ruby #{@@timestamp}"
|
10
|
-
a.type = 'Client'
|
11
|
-
a.category = 'CategoryA'
|
12
|
-
a.subCategory = 'CategoryB'
|
13
|
-
a.isCloseable = true
|
14
|
-
a.name = "Account #{@@timestamp}"
|
15
|
-
a.targetAmount = 500
|
16
|
-
a.targetDate = '01/01/2030'
|
17
|
-
@@nachaAccountId = a.create @@nachaConn, nil
|
18
|
-
|
19
|
-
assert @@nachaAccountId > 0
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_list
|
24
|
-
accounts = CorePro::Account.list(@@nachaCustomerId, @@nachaConn, nil)
|
25
|
-
assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@nachaCustomerId}"
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_get
|
29
|
-
a = CorePro::Account.get(@@nachaCustomerId, @@nachaAccountId, @@nachaConn, nil)
|
30
|
-
assert_not_empty a.accountNumber
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_update
|
34
|
-
a = CorePro::Account.get(@@nachaCustomerId, @@nachaAccountId, @@nachaConn, nil)
|
35
|
-
a = CorePro::Account.new
|
36
|
-
a.accountId = @@nachaAccountId
|
37
|
-
a.customerId = @@nachaCustomerId
|
38
|
-
a.name = "Updated account #{@@timestamp}"
|
39
|
-
accountId = a.update @@nachaConn, nil
|
40
|
-
assert accountId == @@nachaAccountId
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_zzz_close
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/account'
|
3
|
-
|
4
|
-
class AbAccountPrepaidTest < CoreProTestBase
|
5
|
-
|
6
|
-
def test_create
|
7
|
-
a = CorePro::Account.new
|
8
|
-
a.customerId = @@prepaidCustomerId
|
9
|
-
a.tag = "act#{@@timestamp}"
|
10
|
-
a.type = 'Prepaid'
|
11
|
-
a.category = 'CategoryA'
|
12
|
-
a.subCategory = 'CategoryB'
|
13
|
-
a.isCloseable = true
|
14
|
-
a.name = "Account Ruby #{@@timestamp}"
|
15
|
-
a.targetAmount = 500
|
16
|
-
a.targetDate = '01/01/2030'
|
17
|
-
@@prepaidAccountId = a.create @@prepaidConn, nil
|
18
|
-
|
19
|
-
assert @@prepaidAccountId > 0
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_list
|
24
|
-
accounts = CorePro::Account.list(@@prepaidCustomerId, @@prepaidConn, nil)
|
25
|
-
assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@prepaidCustomerId}"
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_get
|
29
|
-
a = CorePro::Account.get(@@prepaidCustomerId, @@prepaidAccountId, @@prepaidConn, nil)
|
30
|
-
assert_not_empty a.accountNumber
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_update
|
34
|
-
a = CorePro::Account.get(@@prepaidCustomerId, @@prepaidAccountId, @@prepaidConn, nil)
|
35
|
-
a = CorePro::Account.new
|
36
|
-
a.accountId = @@prepaidAccountId
|
37
|
-
a.customerId = @@prepaidCustomerId
|
38
|
-
a.name = "Updated Account Ruby #{@@timestamp}"
|
39
|
-
accountId = a.update @@prepaidConn, nil
|
40
|
-
assert accountId == @@prepaidAccountId
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_zzz_close
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/external_account'
|
3
|
-
|
4
|
-
class AcExternalAccountPrepaidTest < CoreProTestBase
|
5
|
-
|
6
|
-
def test_create
|
7
|
-
ea = CorePro::ExternalAccount.new
|
8
|
-
ea.customerId = @@prepaidCustomerId
|
9
|
-
ea.nickName = "Ext acct #{@@timestamp}"
|
10
|
-
ea.tag = "tag ruby #{@@timestamp}"
|
11
|
-
ea.accountNumber = '00001234'
|
12
|
-
ea.firstName = 'Jimmy'
|
13
|
-
ea.lastName = 'Jameson'
|
14
|
-
ea.type = 'Prepaid'
|
15
|
-
externalAccountId = ea.create @@prepaidConn, nil
|
16
|
-
@@prepaidExternalAccountId = externalAccountId
|
17
|
-
assert @@prepaidExternalAccountId > 0
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_get
|
21
|
-
ea = CorePro::ExternalAccount.get @@prepaidCustomerId, @@prepaidExternalAccountId, @@prepaidConn, nil
|
22
|
-
assert_instance_of CorePro::ExternalAccount, ea
|
23
|
-
assert_equal @@prepaidExternalAccountId, ea.externalAccountId
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_getByTag
|
27
|
-
ea = CorePro::ExternalAccount.getByTag @@prepaidCustomerId, "tag ruby #{@@timestamp}", @@prepaidConn, nil
|
28
|
-
assert_instance_of CorePro::ExternalAccount, ea
|
29
|
-
assert_equal @@prepaidExternalAccountId, ea.externalAccountId
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_list
|
33
|
-
eas = CorePro::ExternalAccount.list @@prepaidCustomerId, @@prepaidConn, nil
|
34
|
-
assert eas != nil && eas.length > 0
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_update
|
38
|
-
ea = CorePro::ExternalAccount.new
|
39
|
-
ea.customerId = @@prepaidCustomerId
|
40
|
-
ea.externalAccountId = @@prepaidExternalAccountId
|
41
|
-
ea.nickName = "Updated ext acct #{@@timestamp}"
|
42
|
-
externalAccountId = ea.update @@prepaidConn, nil
|
43
|
-
assert_equal @@prepaidExternalAccountId, externalAccountId
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require_relative '../test/core_pro_test_base'
|
2
|
-
require_relative '../lib/corepro/transfer'
|
3
|
-
|
4
|
-
class AjTransferPrepaidTest < CoreProTestBase
|
5
|
-
|
6
|
-
def test_create_external_to_internal
|
7
|
-
t = CorePro::Transfer.new
|
8
|
-
t.customerId = @@prepaidCustomerId
|
9
|
-
t.fromId = @@prepaidExternalAccountId
|
10
|
-
t.toId = @@prepaidAccountId
|
11
|
-
t.amount = 1.25
|
12
|
-
t.tag = "ruby #{@@timestamp}"
|
13
|
-
results = t.create @@prepaidConn, nil
|
14
|
-
@@prepaidExternalToInternalTransactionId = results[0].transactionId
|
15
|
-
assert @@prepaidExternalToInternalTransactionId > 0
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_create_internal_to_external
|
19
|
-
t = CorePro::Transfer.new
|
20
|
-
t.customerId = @@prepaidCustomerId
|
21
|
-
t.fromId = @@prepaidAccountId
|
22
|
-
t.toId = @@prepaidExternalAccountId
|
23
|
-
t.amount = 1.20
|
24
|
-
t.tag = "ruby 2 #{@@timestamp}"
|
25
|
-
results = t.create @@prepaidConn, nil
|
26
|
-
@@prepaidInternalToExternalTransactionId = results[0].transactionId
|
27
|
-
assert @@prepaidInternalToExternalTransactionId > 0
|
28
|
-
end
|
29
|
-
|
30
|
-
# def test_void
|
31
|
-
# t = CorePro::Transfer.new
|
32
|
-
# t.customerId = @@prepaidCustomerId
|
33
|
-
# t.transactionId = @@prepaidExternalToInternalTransactionId
|
34
|
-
# t.void @@prepaidConn, nil
|
35
|
-
# end
|
36
|
-
end
|