corepro_eg 1.0.2
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 +16 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/codeStyleSettings.xml +14 -0
- data/.idea/corepro-sdk-ruby.iml +27 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +8 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -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_eg.gemspec +25 -0
- data/lib/corepro/account.rb +109 -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 +86 -0
- data/lib/corepro/core_pro_api_exception.rb +26 -0
- data/lib/corepro/customer.rb +139 -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 +22 -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 +40 -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/lib/corepro.rb +15 -0
- data/q2labs_public.pem +9 -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
- data/test.pdf +0 -0
- metadata +175 -0
data/lib/corepro.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require_relative 'corepro/connection'
|
|
2
|
+
require_relative 'corepro/account'
|
|
3
|
+
require_relative 'corepro/account_close'
|
|
4
|
+
require_relative 'corepro/card'
|
|
5
|
+
require_relative 'corepro/core_pro_api_exception'
|
|
6
|
+
require_relative 'corepro/customer'
|
|
7
|
+
require_relative 'corepro/customer_beneficiary'
|
|
8
|
+
require_relative 'corepro/customer_document'
|
|
9
|
+
require_relative 'corepro/bank_document'
|
|
10
|
+
require_relative 'corepro/external_account'
|
|
11
|
+
require_relative 'corepro/external_account_document'
|
|
12
|
+
require_relative 'corepro/program'
|
|
13
|
+
require_relative 'corepro/statement'
|
|
14
|
+
require_relative 'corepro/transaction'
|
|
15
|
+
require_relative 'corepro/transfer'
|
data/q2labs_public.pem
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
|
2
|
+
MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAvWp5DhHGFUQnMl7elQ2T
|
|
3
|
+
TQ+grCpsmo+ZsKE7K+FDqaCs0dxge0Sepju5wbusXCgPv1c0297foYLqfF7zHxIY
|
|
4
|
+
k5T/O8jsgt26iHAjUIOJx+qsMnWUR3/RUMscH4Ft8GVCWrJL+dRUM6rUFPDDwmbp
|
|
5
|
+
aQuVgvm/a0igDFZLykuBDTDaSTul35dPrRWsi+f8bQ3g+VdDQqB0A/eup2UxByts
|
|
6
|
+
zDf65xDIG8oC6C2Mf2Ws6i6zb69Su24a6jxwKDvglIlCDFxgGNDvZ2pyv8ifIgds
|
|
7
|
+
YPKw4UYnffRTJlRphrv/KiUIp8TluB0NPYQfJnGAcsheGjYuHCHkig0WEQ69GBRx
|
|
8
|
+
0QIBJQ==
|
|
9
|
+
-----END PUBLIC KEY-----
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require_relative 'core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/program'
|
|
3
|
+
|
|
4
|
+
class AProgramTest < CoreProTestBase
|
|
5
|
+
def test_get
|
|
6
|
+
p = CorePro::Program.get @@exampleConn, nil
|
|
7
|
+
pa = p.accounts.select {|e| e.type == 'ProgramReserve'}
|
|
8
|
+
@@exampleProgramReserveAccountId = pa[0].programAccountId
|
|
9
|
+
puts "Program Reserve AccountId=#{@@exampleProgramReserveAccountId}"
|
|
10
|
+
assert_equal 'Example1', p.name
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
require_relative 'core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/customer'
|
|
3
|
+
require_relative '../lib/corepro/models/customer_address'
|
|
4
|
+
require_relative '../lib/corepro/models/customer_response'
|
|
5
|
+
|
|
6
|
+
class AaCustomerTest < CoreProTestBase
|
|
7
|
+
|
|
8
|
+
def test_aaa_create
|
|
9
|
+
c = CorePro::Customer.new
|
|
10
|
+
c.birthDate = '01/01/1985'
|
|
11
|
+
c.culture = 'en-US'
|
|
12
|
+
c.firstName = 'Joey'
|
|
13
|
+
c.middleName = 'Flanagan'
|
|
14
|
+
c.lastName = "McTester#{@@timestamp}"
|
|
15
|
+
c.gender = 'M'
|
|
16
|
+
c.isDocumentsAccepted = true
|
|
17
|
+
c.isSubjectToBackupWithholding = false
|
|
18
|
+
c.isOptedInToBankCommunication = false
|
|
19
|
+
c.tag = "jfm#{@@timestamp}"
|
|
20
|
+
c.taxId = '012341234'
|
|
21
|
+
p = CorePro::Models::CustomerPhone.new
|
|
22
|
+
p.phoneType = 'mobile'
|
|
23
|
+
p.number = '515-555-1234'
|
|
24
|
+
c.phones.push(p)
|
|
25
|
+
|
|
26
|
+
ra = CorePro::Models::CustomerAddress.new
|
|
27
|
+
ra.addressLine1 = '123 Main Street'
|
|
28
|
+
ra.city = 'Anytown'
|
|
29
|
+
ra.state = 'IA'
|
|
30
|
+
ra.postalCode = '55555'
|
|
31
|
+
ra.addressType = 'residence'
|
|
32
|
+
ra.country = 'US'
|
|
33
|
+
ra.isActive = 1
|
|
34
|
+
c.addresses.push(ra)
|
|
35
|
+
|
|
36
|
+
#@@exampleCustomerInitiateResponse = c.initiate(@@exampleConn, nil)
|
|
37
|
+
@@exampleCustomerId = c.create(@@exampleConn, nil)
|
|
38
|
+
puts "customerId=#{@@exampleCustomerId}"
|
|
39
|
+
assert @@exampleCustomerId > 0
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# def test_aaa_verify
|
|
43
|
+
# c = CorePro::Customer.new
|
|
44
|
+
# c.customerId = @@exampleCustomerId
|
|
45
|
+
# end
|
|
46
|
+
|
|
47
|
+
def test_get
|
|
48
|
+
puts "getting #{@@exampleCustomerId}..."
|
|
49
|
+
c = CorePro::Customer.get @@exampleCustomerId, @@exampleConn, nil
|
|
50
|
+
assert c != nil, "Could not 'get' customerId #{@@exampleCustomerId}"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def test_getByTag
|
|
54
|
+
c = CorePro::Customer.getByTag "jfm#{@@timestamp}", @@exampleConn, nil
|
|
55
|
+
assert c != nil, "Could not 'getByTag' tag 'jfm#{@@timestamp}'"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def test_list
|
|
59
|
+
cs = CorePro::Customer.list 0, 15, @@exampleConn, nil
|
|
60
|
+
assert cs != nil && cs.length > 0, "Could not list customers"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def test_search
|
|
64
|
+
c = CorePro::Customer.new
|
|
65
|
+
c.lastName = "McTester#{@@timestamp}"
|
|
66
|
+
cs = c.search nil, nil, @@exampleConn, nil
|
|
67
|
+
assert cs != nil && cs.length > 0, "Could not search 'McTester#{@@timestamp}'"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def test_update
|
|
71
|
+
c = CorePro::Customer.new
|
|
72
|
+
c.customerId = @@exampleCustomerId
|
|
73
|
+
c.firstName = "Joey#{@@timestamp}"
|
|
74
|
+
customerId = c.update @@exampleConn, nil
|
|
75
|
+
assert customerId > 0
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/account'
|
|
3
|
+
|
|
4
|
+
class AbAccountTest < CoreProTestBase
|
|
5
|
+
|
|
6
|
+
def test_create
|
|
7
|
+
a = CorePro::Account.new
|
|
8
|
+
a.customerId = @@exampleCustomerId
|
|
9
|
+
a.tag = "act ruby #{@@timestamp}"
|
|
10
|
+
a.type = 'Checking'
|
|
11
|
+
a.productId = 348741
|
|
12
|
+
a.category = 'CategoryA'
|
|
13
|
+
a.subCategory = 'CategoryB'
|
|
14
|
+
a.isCloseable = true
|
|
15
|
+
a.name = "Account #{@@timestamp}"
|
|
16
|
+
a.targetAmount = 500
|
|
17
|
+
a.targetDate = '01/01/2030'
|
|
18
|
+
@@exampleAccountId = a.create @@exampleConn, nil
|
|
19
|
+
puts "accountId=#{@@exampleAccountId}"
|
|
20
|
+
assert @@exampleAccountId > 0
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_list
|
|
25
|
+
accounts = CorePro::Account.list(@@exampleCustomerId, @@exampleConn, nil)
|
|
26
|
+
assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@exampleCustomerId}"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def test_get
|
|
30
|
+
puts "getting #{@@exampleAccountId}..."
|
|
31
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
|
32
|
+
assert_equal 'CategoryB', a.subCategory
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_update
|
|
36
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
|
37
|
+
a = CorePro::Account.new
|
|
38
|
+
a.accountId = @@exampleAccountId
|
|
39
|
+
a.customerId = @@exampleCustomerId
|
|
40
|
+
a.name = "Updated account #{@@timestamp}"
|
|
41
|
+
accountId = a.update @@exampleConn, nil
|
|
42
|
+
assert accountId == @@exampleAccountId
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/external_account'
|
|
3
|
+
|
|
4
|
+
class AcExternalAccountTest < CoreProTestBase
|
|
5
|
+
def test_create
|
|
6
|
+
ea = CorePro::ExternalAccount.new
|
|
7
|
+
ea.customerId = @@exampleCustomerId
|
|
8
|
+
ea.tag = "extact ruby #{@@timestamp}"
|
|
9
|
+
ea.routingNumber = '123456789'
|
|
10
|
+
ea.accountNumber = '987654321'
|
|
11
|
+
ea.firstName = 'Edwin'
|
|
12
|
+
ea.lastName = 'Awesome'
|
|
13
|
+
ea.nickName = "Savings #{@@timestamp}"
|
|
14
|
+
ea.type = 'Savings'
|
|
15
|
+
ea.tag = "ext_acct_#{@@timestamp}"
|
|
16
|
+
@@exampleExternalAccountId = ea.create @@exampleConn, nil
|
|
17
|
+
puts "externalAccountId=#{@@exampleExternalAccountId}"
|
|
18
|
+
assert @@exampleExternalAccountId > 0
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def test_get
|
|
23
|
+
puts "getting #{@@exampleExternalAccountId}..."
|
|
24
|
+
ea = CorePro::ExternalAccount.get(@@exampleCustomerId, @@exampleExternalAccountId, @@exampleConn, nil)
|
|
25
|
+
assert_equal 'COREPRO SANDBOX BANK', ea.name
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def test_list
|
|
29
|
+
externalAccounts = CorePro::ExternalAccount.list(@@exampleCustomerId, @@exampleConn, nil)
|
|
30
|
+
assert_equal 1, externalAccounts.length, "Listed #{externalAccounts.length} external accounts for customerId=#{@@exampleCustomerId}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def test_update
|
|
34
|
+
ea = CorePro::ExternalAccount.get(@@exampleCustomerId, @@exampleExternalAccountId, @@exampleConn, nil)
|
|
35
|
+
ea.nickName = "Updated external account #{@@timestamp}"
|
|
36
|
+
externalAccountId = ea.update @@exampleConn, nil
|
|
37
|
+
assert externalAccountId == @@exampleExternalAccountId
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/customer_beneficiary'
|
|
3
|
+
|
|
4
|
+
class AdCustomerBeneficiaryTest < CoreProTestBase
|
|
5
|
+
|
|
6
|
+
def test_create
|
|
7
|
+
cb = CorePro::CustomerBeneficiary.new
|
|
8
|
+
cb.customerId = @@exampleCustomerId
|
|
9
|
+
cb.firstName = 'Freddie'
|
|
10
|
+
cb.lastName = "Mercury Ruby #{@@timestamp}"
|
|
11
|
+
cb.birthDate = '1969-05-05T00:00:00.000+00:00'
|
|
12
|
+
cb.taxId = '123412349'
|
|
13
|
+
@@exampleCustomerBeneficiaryId = cb.create @@exampleConn, nil
|
|
14
|
+
assert @@exampleCustomerBeneficiaryId > 0
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def test_get
|
|
18
|
+
cb = CorePro::CustomerBeneficiary.get @@exampleCustomerId, @@exampleCustomerBeneficiaryId, @@exampleConn, nil
|
|
19
|
+
assert_instance_of CorePro::CustomerBeneficiary, cb
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def test_list
|
|
23
|
+
cbs = CorePro::CustomerBeneficiary.list @@exampleCustomerId, @@exampleConn, nil
|
|
24
|
+
assert cbs.length > 0
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def test_update
|
|
28
|
+
cb = CorePro::CustomerBeneficiary.new
|
|
29
|
+
cb.customerId = @@exampleCustomerId
|
|
30
|
+
cb.customerBeneficiaryId = @@exampleCustomerBeneficiaryId
|
|
31
|
+
cb.firstName = "Freddie #{@@timestamp}"
|
|
32
|
+
cbid = cb.update @@exampleConn, nil
|
|
33
|
+
assert_equal @@exampleCustomerBeneficiaryId, cbid
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def test_zzz_deactivate
|
|
37
|
+
cb = CorePro::CustomerBeneficiary.new
|
|
38
|
+
cb.customerId = @@exampleCustomerId
|
|
39
|
+
cb.customerBeneficiaryId = @@exampleCustomerBeneficiaryId
|
|
40
|
+
cbid = cb.deactivate @@exampleConn, nil
|
|
41
|
+
assert_equal @@exampleCustomerBeneficiaryId, cbid
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/customer_document'
|
|
3
|
+
|
|
4
|
+
class AeCustomerDocumentTest < CoreProTestBase
|
|
5
|
+
def test_upload
|
|
6
|
+
cd = CorePro::CustomerDocument.new
|
|
7
|
+
cd.customerId = @@exampleCustomerId
|
|
8
|
+
cd.documentType = 'DriversLicense'
|
|
9
|
+
cd.reasonType = 'NameChange'
|
|
10
|
+
cd.documentName = 'test.pdf'
|
|
11
|
+
folder = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
|
12
|
+
cd.documentContent = File.read(folder + '/test.pdf')
|
|
13
|
+
cd.upload @@exampleConn, nil
|
|
14
|
+
assert true
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/bank_document'
|
|
3
|
+
require_relative '../lib/corepro/models/file_content'
|
|
4
|
+
|
|
5
|
+
class AfBankDocumentTest < CoreProTestBase
|
|
6
|
+
def test_list
|
|
7
|
+
docs = CorePro::BankDocument.list 'en-US', nil, @@exampleConn, nil
|
|
8
|
+
doc = nil
|
|
9
|
+
docs.each do |x|
|
|
10
|
+
doc = x # if x.documentType == 'eStatement'
|
|
11
|
+
end
|
|
12
|
+
@@documentId = doc.documentId
|
|
13
|
+
assert_instance_of CorePro::BankDocument, doc
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def test_zzz_download
|
|
17
|
+
doc = CorePro::BankDocument.download 'en-US', @@documentId, @@exampleConn, nil
|
|
18
|
+
assert_instance_of CorePro::Models::FileContent, doc
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/external_account_document'
|
|
3
|
+
|
|
4
|
+
class AgExternalAccountDocumentTest < CoreProTestBase
|
|
5
|
+
def test_upload
|
|
6
|
+
ead = CorePro::ExternalAccountDocument.new
|
|
7
|
+
ead.customerId = @@exampleCustomerId
|
|
8
|
+
ead.externalAccountId = @@exampleExternalAccountId
|
|
9
|
+
ead.documentType = 'DriversLicense'
|
|
10
|
+
ead.documentName = 'test.pdf'
|
|
11
|
+
ead.reasonType = 'NameChange'
|
|
12
|
+
folder = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
|
13
|
+
ead.documentContent = File.read(folder + '/test.pdf')
|
|
14
|
+
ead.upload @@exampleConn, nil
|
|
15
|
+
assert true
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/statement'
|
|
3
|
+
|
|
4
|
+
class AiStatementTest # < CoreProTestBase
|
|
5
|
+
|
|
6
|
+
def test_download
|
|
7
|
+
assert false
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def test_get
|
|
11
|
+
assert false
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def test_list
|
|
15
|
+
assert false
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_search
|
|
19
|
+
assert false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/transfer'
|
|
3
|
+
|
|
4
|
+
class AjTransferTest < CoreProTestBase
|
|
5
|
+
|
|
6
|
+
def test_01_create_external_to_internal
|
|
7
|
+
t = CorePro::Transfer.new
|
|
8
|
+
t.customerId = @@exampleCustomerId
|
|
9
|
+
t.fromId = @@exampleExternalAccountId
|
|
10
|
+
t.toId = @@exampleAccountId
|
|
11
|
+
t.amount = 2.75
|
|
12
|
+
t.tag = "e_2_i #{@@timestamp}"
|
|
13
|
+
@@exampleExternalToInternalTransactionTag = t.tag
|
|
14
|
+
results = t.create @@exampleConn, nil
|
|
15
|
+
@@exampleExternalToInternalTransactionId = results[0].transactionId
|
|
16
|
+
puts "external to internal transactionid=#{@@exampleExternalToInternalTransactionId}"
|
|
17
|
+
assert @@exampleExternalToInternalTransactionId > 0
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_02_create_programreserve_to_internal
|
|
21
|
+
t = CorePro::Transfer.new
|
|
22
|
+
t.customerId = @@exampleCustomerId
|
|
23
|
+
t.fromId = @@exampleProgramReserveAccountId
|
|
24
|
+
t.toId = @@exampleAccountId
|
|
25
|
+
t.amount = 1.25
|
|
26
|
+
t.tag = "pr_2_i #{@@timestamp}"
|
|
27
|
+
results = t.create @@exampleConn, nil
|
|
28
|
+
@@exampleProgramReserveToInternalTransactionId = results[0].transactionId
|
|
29
|
+
puts "program reserve to internal transactionid=#{@@exampleProgramReserveToInternalTransactionId}"
|
|
30
|
+
assert @@exampleProgramReserveToInternalTransactionId > 0
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def test_03_create_internal_to_external
|
|
34
|
+
t = CorePro::Transfer.new
|
|
35
|
+
t.customerId = @@exampleCustomerId
|
|
36
|
+
t.fromId = @@exampleAccountId
|
|
37
|
+
t.toId = @@exampleExternalAccountId
|
|
38
|
+
t.amount = 1.20
|
|
39
|
+
t.tag = "i_2_e #{@@timestamp}"
|
|
40
|
+
results = t.create @@exampleConn, nil
|
|
41
|
+
@@exampleInternalToExternalTransactionId = results[0].transactionId
|
|
42
|
+
puts "internal to external transactionid=#{@@exampleInternalToExternalTransactionId}"
|
|
43
|
+
assert @@exampleInternalToExternalTransactionId > 0
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# def test_void
|
|
48
|
+
# t = CorePro::Transfer.new
|
|
49
|
+
# t.customerId = @@prepaidCustomerId
|
|
50
|
+
# t.transactionId = @@prepaidExternalToInternalTransactionId
|
|
51
|
+
# t.void @@prepaidConn, nil
|
|
52
|
+
# end
|
|
53
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/transaction'
|
|
3
|
+
|
|
4
|
+
class AkTransactionTest < CoreProTestBase
|
|
5
|
+
def test_01_list
|
|
6
|
+
ts = CorePro::Transaction.list @@exampleCustomerId, @@exampleAccountId, nil, nil, nil, nil, nil, @@exampleConn, nil
|
|
7
|
+
assert ts.length > 0
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def test_02_get
|
|
11
|
+
ts = CorePro::Transaction.get @@exampleCustomerId, @@exampleProgramReserveToInternalTransactionId, @@exampleConn, nil
|
|
12
|
+
assert ts.length > 0
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_03_getByTag
|
|
16
|
+
ts = CorePro::Transaction.getByTag @@exampleCustomerId, @@exampleExternalToInternalTransactionTag, @@exampleConn, nil
|
|
17
|
+
assert ts.length > 0
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
|
2
|
+
require_relative '../lib/corepro/card'
|
|
3
|
+
|
|
4
|
+
require 'openssl'
|
|
5
|
+
require 'base64'
|
|
6
|
+
|
|
7
|
+
class AlCardTest < CoreProTestBase
|
|
8
|
+
|
|
9
|
+
def test_create
|
|
10
|
+
c = CorePro::Card.new
|
|
11
|
+
c.customerId = @@exampleCustomerId
|
|
12
|
+
c.primaryAccountId = @@exampleAccountId
|
|
13
|
+
c.tag = "card ruby #{@@timestamp}"
|
|
14
|
+
c.nickName = "Card #{@@timestamp}"
|
|
15
|
+
c.firstName = 'Frank'
|
|
16
|
+
c.lastName = 'Drummond'
|
|
17
|
+
c.vendorTypeCode = 'VS'
|
|
18
|
+
|
|
19
|
+
rawPin = '1234'
|
|
20
|
+
publicKey = OpenSSL::PKey::RSA.new(File.read('q2labs_public.pem'))
|
|
21
|
+
c.newPin = encrypted_string = Base64.encode64(publicKey.public_encrypt(rawPin, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING))
|
|
22
|
+
puts "#{rawPin}, #{c.newPin}"
|
|
23
|
+
newCard = c.initiate @@exampleConn, nil
|
|
24
|
+
@@exampleCardId = newCard.cardId
|
|
25
|
+
puts "cardId=#{@@exampleCardId}"
|
|
26
|
+
assert @@exampleCardId > 0
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def test_list
|
|
31
|
+
accounts = CorePro::Account.list(@@exampleCustomerId, @@exampleConn, nil)
|
|
32
|
+
assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@exampleCustomerId}"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_get
|
|
36
|
+
puts "getting #{@@exampleAccountId}..."
|
|
37
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
|
38
|
+
assert_equal 'CategoryB', a.subCategory
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def test_update
|
|
42
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
|
43
|
+
a = CorePro::Account.new
|
|
44
|
+
a.accountId = @@exampleAccountId
|
|
45
|
+
a.customerId = @@exampleCustomerId
|
|
46
|
+
a.name = "Updated account #{@@timestamp}"
|
|
47
|
+
accountId = a.update @@exampleConn, nil
|
|
48
|
+
assert accountId == @@exampleAccountId
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require "test/unit"
|
|
2
|
+
require_relative "../lib/corepro/connection"
|
|
3
|
+
require_relative "../lib/corepro/core_pro_api_exception"
|
|
4
|
+
|
|
5
|
+
class CoreProTestBase < Test::Unit::TestCase
|
|
6
|
+
|
|
7
|
+
# common properties for tests
|
|
8
|
+
@@timestamp = Time.now.to_s
|
|
9
|
+
|
|
10
|
+
@@documentId = nil
|
|
11
|
+
|
|
12
|
+
@@exampleConn = CorePro::Connection.new 'example1', 'example1', 'sandbox-api.corepro.io' #, '127.0.0.1', '8888'
|
|
13
|
+
|
|
14
|
+
@@exampleProgramReserveAccountId = nil
|
|
15
|
+
|
|
16
|
+
@@exampleCustomerId = nil
|
|
17
|
+
|
|
18
|
+
@@exampleAccountId = nil
|
|
19
|
+
|
|
20
|
+
@@exampleExternalAccountId = nil
|
|
21
|
+
|
|
22
|
+
@@exampleCardId = nil
|
|
23
|
+
|
|
24
|
+
@@exampleExternalToInternalTransactionId = nil
|
|
25
|
+
|
|
26
|
+
@@exampleExternalToInternalTransactionTag = nil
|
|
27
|
+
|
|
28
|
+
@@exampleProgramReserveToInternalTransactionId = nil
|
|
29
|
+
|
|
30
|
+
end
|
data/test.pdf
ADDED
|
Binary file
|
metadata
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: corepro_eg
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.2
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- devsupport
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.6'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: test-unit
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.2'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.2'
|
|
55
|
+
description: See https://docs.corepro.io for more detail.
|
|
56
|
+
email:
|
|
57
|
+
- devsupport@socialmoney.com
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- ".gitignore"
|
|
63
|
+
- ".idea/.name"
|
|
64
|
+
- ".idea/.rakeTasks"
|
|
65
|
+
- ".idea/codeStyleSettings.xml"
|
|
66
|
+
- ".idea/corepro-sdk-ruby.iml"
|
|
67
|
+
- ".idea/encodings.xml"
|
|
68
|
+
- ".idea/misc.xml"
|
|
69
|
+
- ".idea/modules.xml"
|
|
70
|
+
- ".idea/scopes/scope_settings.xml"
|
|
71
|
+
- ".idea/vcs.xml"
|
|
72
|
+
- Gemfile
|
|
73
|
+
- LICENSE
|
|
74
|
+
- README.md
|
|
75
|
+
- Rakefile
|
|
76
|
+
- config-sample.yml
|
|
77
|
+
- corepro_eg.gemspec
|
|
78
|
+
- lib/corepro.rb
|
|
79
|
+
- lib/corepro/account.rb
|
|
80
|
+
- lib/corepro/account_close.rb
|
|
81
|
+
- lib/corepro/bank_document.rb
|
|
82
|
+
- lib/corepro/card.rb
|
|
83
|
+
- lib/corepro/connection.rb
|
|
84
|
+
- lib/corepro/core_pro_api_exception.rb
|
|
85
|
+
- lib/corepro/customer.rb
|
|
86
|
+
- lib/corepro/customer_beneficiary.rb
|
|
87
|
+
- lib/corepro/customer_document.rb
|
|
88
|
+
- lib/corepro/external_account.rb
|
|
89
|
+
- lib/corepro/external_account_document.rb
|
|
90
|
+
- lib/corepro/models/account_access.rb
|
|
91
|
+
- lib/corepro/models/account_id_only.rb
|
|
92
|
+
- lib/corepro/models/api_error.rb
|
|
93
|
+
- lib/corepro/models/customer_address.rb
|
|
94
|
+
- lib/corepro/models/customer_answer.rb
|
|
95
|
+
- lib/corepro/models/customer_beneficiary_id_only.rb
|
|
96
|
+
- lib/corepro/models/customer_id_only.rb
|
|
97
|
+
- lib/corepro/models/customer_message.rb
|
|
98
|
+
- lib/corepro/models/customer_phone.rb
|
|
99
|
+
- lib/corepro/models/customer_question.rb
|
|
100
|
+
- lib/corepro/models/customer_response.rb
|
|
101
|
+
- lib/corepro/models/customer_verify_request.rb
|
|
102
|
+
- lib/corepro/models/envelope.rb
|
|
103
|
+
- lib/corepro/models/external_account_id_only.rb
|
|
104
|
+
- lib/corepro/models/external_account_verify.rb
|
|
105
|
+
- lib/corepro/models/file_content.rb
|
|
106
|
+
- lib/corepro/models/json_base.rb
|
|
107
|
+
- lib/corepro/models/model_base.rb
|
|
108
|
+
- lib/corepro/models/program_account.rb
|
|
109
|
+
- lib/corepro/models/program_checking.rb
|
|
110
|
+
- lib/corepro/models/program_e_code.rb
|
|
111
|
+
- lib/corepro/models/program_external_account.rb
|
|
112
|
+
- lib/corepro/models/program_interest_rate.rb
|
|
113
|
+
- lib/corepro/models/program_limit.rb
|
|
114
|
+
- lib/corepro/models/program_prepaid.rb
|
|
115
|
+
- lib/corepro/models/program_savings.rb
|
|
116
|
+
- lib/corepro/program.rb
|
|
117
|
+
- lib/corepro/statement.rb
|
|
118
|
+
- lib/corepro/transaction.rb
|
|
119
|
+
- lib/corepro/transfer.rb
|
|
120
|
+
- lib/corepro/utils/logger.rb
|
|
121
|
+
- lib/corepro/utils/requestor.rb
|
|
122
|
+
- lib/corepro/version.rb
|
|
123
|
+
- q2labs_public.pem
|
|
124
|
+
- test.pdf
|
|
125
|
+
- test/a_program_test.rb
|
|
126
|
+
- test/aa_customer_test.rb
|
|
127
|
+
- test/ab_account_test.rb
|
|
128
|
+
- test/ac_external_account_test.rb
|
|
129
|
+
- test/ad_customer_beneficiary_test.rb
|
|
130
|
+
- test/ae_customer_document_test.rb
|
|
131
|
+
- test/af_bankdocument_test.rb
|
|
132
|
+
- test/ag_external_account_document_test.rb
|
|
133
|
+
- test/ai_statement_test.rb
|
|
134
|
+
- test/aj_transfer_test.rb
|
|
135
|
+
- test/ak_transaction_test.rb
|
|
136
|
+
- test/al_card_test.rb
|
|
137
|
+
- test/core_pro_test_base.rb
|
|
138
|
+
homepage: https://github.com/socialmoney/corepro-sdk-ruby
|
|
139
|
+
licenses:
|
|
140
|
+
- MIT
|
|
141
|
+
metadata: {}
|
|
142
|
+
post_install_message:
|
|
143
|
+
rdoc_options: []
|
|
144
|
+
require_paths:
|
|
145
|
+
- lib
|
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
|
+
requirements:
|
|
148
|
+
- - "~>"
|
|
149
|
+
- !ruby/object:Gem::Version
|
|
150
|
+
version: '2.4'
|
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
|
+
requirements:
|
|
153
|
+
- - ">="
|
|
154
|
+
- !ruby/object:Gem::Version
|
|
155
|
+
version: '0'
|
|
156
|
+
requirements: []
|
|
157
|
+
rubyforge_project:
|
|
158
|
+
rubygems_version: 2.7.7
|
|
159
|
+
signing_key:
|
|
160
|
+
specification_version: 4
|
|
161
|
+
summary: A Ruby SDK for consuming the CorePro API.
|
|
162
|
+
test_files:
|
|
163
|
+
- test/a_program_test.rb
|
|
164
|
+
- test/aa_customer_test.rb
|
|
165
|
+
- test/ab_account_test.rb
|
|
166
|
+
- test/ac_external_account_test.rb
|
|
167
|
+
- test/ad_customer_beneficiary_test.rb
|
|
168
|
+
- test/ae_customer_document_test.rb
|
|
169
|
+
- test/af_bankdocument_test.rb
|
|
170
|
+
- test/ag_external_account_document_test.rb
|
|
171
|
+
- test/ai_statement_test.rb
|
|
172
|
+
- test/aj_transfer_test.rb
|
|
173
|
+
- test/ak_transaction_test.rb
|
|
174
|
+
- test/al_card_test.rb
|
|
175
|
+
- test/core_pro_test_base.rb
|