CroemincRubyGem 0.1.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.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.idea/.gitignore +3 -0
  4. data/.idea/.rakeTasks +7 -0
  5. data/.idea/MetropagoRubyGem.iml +19 -0
  6. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  7. data/.idea/metropago-gateway-rubygem-sdk.iml +19 -0
  8. data/.idea/misc.xml +7 -0
  9. data/.idea/modules.xml +8 -0
  10. data/.idea/vcs.xml +6 -0
  11. data/.rspec +3 -0
  12. data/.travis.yml +7 -0
  13. data/CODE_OF_CONDUCT.md +74 -0
  14. data/CroemincRubyGem.gemspec +42 -0
  15. data/Gemfile +4 -0
  16. data/Gemfile.lock +35 -0
  17. data/LICENSE.txt +21 -0
  18. data/Rakefile +6 -0
  19. data/SDKDemo.rb +464 -0
  20. data/bin/console +14 -0
  21. data/bin/setup +8 -0
  22. data/lib/Catalogs/environment_type.rb +3 -0
  23. data/lib/Certificates/ca-bundle.crt +3866 -0
  24. data/lib/Config/application.yml +2 -0
  25. data/lib/CroemincRubyGem/version.rb +3 -0
  26. data/lib/CroemincRubyGem.rb +13 -0
  27. data/lib/Entities/ach.rb +37 -0
  28. data/lib/Entities/address.rb +97 -0
  29. data/lib/Entities/amount_range_filter.rb +60 -0
  30. data/lib/Entities/base_entity.rb +15 -0
  31. data/lib/Entities/beneficiary.rb +89 -0
  32. data/lib/Entities/credit_card.rb +150 -0
  33. data/lib/Entities/customer.rb +218 -0
  34. data/lib/Entities/customer_entity.rb +130 -0
  35. data/lib/Entities/customer_entity_response.rb +79 -0
  36. data/lib/Entities/customer_response.rb +90 -0
  37. data/lib/Entities/customer_search.rb +80 -0
  38. data/lib/Entities/customer_search_option.rb +55 -0
  39. data/lib/Entities/date_range_filter.rb +59 -0
  40. data/lib/Entities/instruction.rb +136 -0
  41. data/lib/Entities/instruction_response.rb +63 -0
  42. data/lib/Entities/instrument.rb +73 -0
  43. data/lib/Entities/instrument_response.rb +70 -0
  44. data/lib/Entities/request_model.rb +80 -0
  45. data/lib/Entities/response_model.rb +39 -0
  46. data/lib/Entities/service.rb +70 -0
  47. data/lib/Entities/text_filter.rb +45 -0
  48. data/lib/Entities/transaction.rb +162 -0
  49. data/lib/Entities/transaction_options.rb +49 -0
  50. data/lib/Entities/transaction_response.rb +79 -0
  51. data/lib/Entities/transaction_search_request.rb +57 -0
  52. data/lib/Entities/validation_error.rb +60 -0
  53. data/lib/Entities/wallet.rb +20 -0
  54. data/lib/Gateway/croeminc_gateway.rb +56 -0
  55. data/lib/Helpers/api_helper.rb +96 -0
  56. data/lib/Helpers/jso_nable.rb +56 -0
  57. data/lib/Helpers/model_parser.rb +235 -0
  58. data/lib/Managers/customer_manager.rb +148 -0
  59. data/lib/Managers/transaction_manager.rb +264 -0
  60. data/lib/MetropagoRubyGem/version.rb +3 -0
  61. data/lib/Test/customer_operations.rb +395 -0
  62. data/lib/Test/transaction_operations.rb +259 -0
  63. metadata +146 -0
@@ -0,0 +1,130 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ require_relative '../Entities/beneficiary'
3
+ require_relative '../Entities/customer_entity_response'
4
+ class CustomerEntity < JSONable
5
+
6
+ def initialize(h = nil)
7
+
8
+ if(h != nil)
9
+ h.each {
10
+ |k,v|
11
+
12
+ propNameFormatted = k.to_s + "="
13
+
14
+
15
+ if(CustomerEntity.instance_methods(false).include?(propNameFormatted.to_sym))
16
+ public_send("#{k}=",v)
17
+ end
18
+ }
19
+ end
20
+
21
+ end
22
+
23
+ def CustomerId=(customerId)
24
+ @customerId = customerId
25
+ end
26
+
27
+ def FriendlyName=(friendlyName)
28
+ @friendlyName = friendlyName
29
+ end
30
+
31
+ def Status=(status)
32
+ @status = status
33
+ end
34
+
35
+ def Id=(id)
36
+ @id = id
37
+ end
38
+
39
+ def AccountNumber=(accountNumber)
40
+ @accountNumber = accountNumber
41
+ end
42
+
43
+ def ServiceType=(serviceType)
44
+ @serviceType = serviceType
45
+ end
46
+
47
+ def ServiceTypeName=(serviceTypeName)
48
+ @serviceTypeName = serviceTypeName
49
+ end
50
+
51
+ def CustomFields=(customFields) #Hash type
52
+ @customFields = customFields
53
+ end
54
+
55
+ def PrimaryReferenceEntityValue=(primaryReferenceEntityValue)
56
+ @primaryReferenceEntityValue = primaryReferenceEntityValue
57
+ end
58
+
59
+ def EntityBeneficiary=(entityBeneficiary) #Beneficiary type
60
+ @entityBeneficiary = entityBeneficiary
61
+ end
62
+
63
+ def ResponseDetails=(responseDetails) #CustomerEntityResponse type
64
+ @responseDetails = responseDetails
65
+ end
66
+
67
+ def AccountToken=(accountToken)
68
+ @accountToken = accountToken
69
+ end
70
+
71
+ #Getters
72
+ def getCustomerId
73
+ return @customerId
74
+ end
75
+
76
+ def getFriendlyName
77
+ return @friendlyName
78
+ end
79
+
80
+ def getStatus
81
+ return @status
82
+ end
83
+
84
+ def getId
85
+ return @id
86
+ end
87
+
88
+ def getAccountNumber
89
+ return @accountNumber
90
+ end
91
+
92
+ def getServiceType
93
+ return @serviceType
94
+ end
95
+
96
+ def getServiceTypeName
97
+ return @serviceTypeName
98
+ end
99
+
100
+ def getCustomFields
101
+ return @customFields
102
+ end
103
+
104
+ def getPrimaryReferenceEntityValue
105
+ return @primaryReferenceEntityValue
106
+ end
107
+
108
+ def getEntityBeneficiary
109
+ return @entityBeneficiary
110
+ end
111
+
112
+ def getResponseDetails
113
+ return @responseDetails
114
+ end
115
+
116
+ def getAccountToken
117
+ return @accountToken
118
+ end
119
+
120
+ #private String Id;
121
+ #private String AccountNumber;
122
+ #private String ServiceType;
123
+ #private String ServiceTypeName;
124
+ #private HashMap CustomFields;
125
+ #private String PrimaryReferenceEntityValue;
126
+ #private Beneficiary EntityBeneficiary;
127
+ #private CustomerEntityResponse ResponseDetails;
128
+ #private String AccountToken;
129
+
130
+ end
@@ -0,0 +1,79 @@
1
+ require_relative '../Entities/validation_error'
2
+ require_relative '../Helpers/jso_nable'
3
+ class CustomerEntityResponse < JSONable
4
+
5
+ def initialize(h = nil)
6
+
7
+ if(h != nil)
8
+
9
+ h.each {
10
+ |k,v|
11
+
12
+ propNameFormatted = k.to_s + "="
13
+
14
+ if(CustomerEntityResponse.instance_methods(false).include?(propNameFormatted.to_sym))
15
+ public_send("#{k}=",v)
16
+ end
17
+
18
+ }
19
+
20
+ end
21
+
22
+ end
23
+
24
+ def ValidationErrors=(validationErrors) #ValidationError type
25
+ @validationErrors = validationErrors
26
+ end
27
+
28
+ def IsSuccess=(isSuccess)
29
+ @isSuccess = isSuccess
30
+ end
31
+
32
+ def ResponseSummary=(responseSummary)
33
+ @responseSummary = responseSummary
34
+ end
35
+
36
+ def responseCode=(responseCode)
37
+ @responseCode = responseCode
38
+ end
39
+
40
+ def Id=(id)
41
+ @id = id
42
+ end
43
+
44
+ def accountToken=(accountToken)
45
+ @accountToken = accountToken
46
+ end
47
+
48
+
49
+ #Getters
50
+ def getValidationErrors
51
+ return @validationErrors
52
+ end
53
+
54
+ def getIsSuccess
55
+ return @isSuccess
56
+ end
57
+
58
+ def getResponseSummary
59
+ return @responseSummary
60
+ end
61
+
62
+ def getResponseCode
63
+ return @responseCode
64
+ end
65
+
66
+ def getId
67
+ return @id
68
+ end
69
+
70
+
71
+
72
+ #private ValidationError ValidationErrors;
73
+ #private boolean IsSuccess;
74
+ #private String ResponseSummary;
75
+ #private String ResponseCode;
76
+ #private String Id;
77
+ #private String AccountToken;
78
+
79
+ end
@@ -0,0 +1,90 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ require_relative '../Entities/validation_error'
3
+ class CustomerResponse < JSONable
4
+
5
+ def initialize(h = nil)
6
+
7
+ if(h != nil)
8
+
9
+ h.each {
10
+ |k,v|
11
+
12
+ propNameFormatted = k.to_s + "="
13
+
14
+ if(CustomerResponse.instance_methods(false).include?(propNameFormatted.to_sym))
15
+ public_send("#{k}=",v)
16
+ end
17
+
18
+ }
19
+
20
+ end
21
+
22
+ end
23
+
24
+ def ValidationErrors=(validationErrors) #ValidationError type
25
+ @validationErrors = validationErrors
26
+ end
27
+
28
+ def IsSuccess=(isSuccess)
29
+ @isSuccess = isSuccess
30
+ end
31
+
32
+ def ResponseSummary=(responseSummary)
33
+ @responseSummary = responseSummary
34
+ end
35
+
36
+ def ResponseCode=(responseCode)
37
+ @responseCode = responseCode
38
+ end
39
+
40
+ def CustomerId=(customerId)
41
+ @customerId = customerId
42
+ end
43
+
44
+ def CustomerToken=(customerToken)
45
+ @customerToken = customerToken
46
+ end
47
+
48
+ def UniqueIdentification=(uniqueIdentification)
49
+ @uniqueIdentification = uniqueIdentification
50
+ end
51
+
52
+
53
+ #Getters
54
+ def getValidationErrors
55
+ return @validationErrors
56
+ end
57
+
58
+ def getIsSuccess
59
+ return @isSuccess
60
+ end
61
+
62
+ def getResponseSummary
63
+ return @responseSummary
64
+ end
65
+
66
+ def getResponseCode
67
+ return @responseCode
68
+ end
69
+
70
+ def getCustomerId
71
+ return @customerId
72
+ end
73
+
74
+ def getCustomerToken
75
+ return @customerToken
76
+ end
77
+
78
+ def getUniqueIdentification
79
+ return @uniqueIdentification
80
+ end
81
+
82
+ #private ValidationError ValidationErrors;
83
+ #private boolean IsSuccess;
84
+ #private String ResponseSummary;
85
+ #private String ResponseCode;
86
+ #private String CustomerId;
87
+ #private String CustomerToken;
88
+ #private String UniqueIdentification;#
89
+
90
+ end
@@ -0,0 +1,80 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ class CustomerSearch < JSONable
3
+
4
+ def CustomerId=(customerId)
5
+ @customerId = customerId
6
+ end
7
+
8
+ def UniqueIdentifier=(uniqueIdentifier)
9
+ @uniqueIdentifier = uniqueIdentifier
10
+ end
11
+
12
+ def CardToken=(cardToken)
13
+ @cardToken = cardToken
14
+ end
15
+
16
+ def Merchant=(merchant)
17
+ @merchant = merchant
18
+ end
19
+
20
+ def Email=(email)
21
+ @email = email
22
+ end
23
+
24
+ def Fax=(fax)
25
+ @fax = fax
26
+ end
27
+
28
+ def FirstName=(firstName)
29
+ @firstName = firstName
30
+ end
31
+
32
+ def LastName=(lastName)
33
+ @lastName = lastName
34
+ end
35
+
36
+ def Phone=(phone)
37
+ @phone = phone
38
+ end
39
+
40
+ def Website=(website)
41
+ @website = website
42
+ end
43
+
44
+ def Company=(company)
45
+ @company = company
46
+ end
47
+
48
+ def CardNumber=(cardNumber)
49
+ @cardNumber = cardNumber
50
+ end
51
+
52
+ def CardHolderName=(cardHolderName)
53
+ @cardHolderName = cardHolderName
54
+ end
55
+
56
+ def DateCreated=(dateCreated) #DateRangeFilter type
57
+ @dateCreated = dateCreated
58
+ end
59
+
60
+ def SearchOption=(searchOption)
61
+ @searchOption = searchOption
62
+ end
63
+
64
+ #private String CustomerId;
65
+ #private String UniqueIdentifier;
66
+ #private String CardToken;
67
+ #private String Merchant;
68
+ #private TextFilter Email;
69
+ #private TextFilter Fax;
70
+ #private TextFilter FirstName;
71
+ #private TextFilter LastName;
72
+ #private TextFilter Phone;
73
+ #private TextFilter Website;
74
+ #private TextFilter Company;
75
+ #private TextFilter CardNumber;
76
+ #private TextFilter CardHolderName;
77
+ #private DateRangeFilter DateCreated;
78
+ #private CustomerSearchOption SearchOption;
79
+
80
+ end
@@ -0,0 +1,55 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ class CustomerSearchOption < JSONable
3
+
4
+ def IncludeAll=(includeAll)
5
+ @includeAll = includeAll
6
+ end
7
+
8
+ def IncludeCardInstruments=(includeCardInstruments)
9
+ @includeCardInstruments = includeCardInstruments
10
+ end
11
+
12
+ def IncludeACHInstruments=(includeACHInstruments)
13
+ @includeACHInstruments = includeACHInstruments
14
+ end
15
+
16
+ def IncludeWallet=(includeWallet)
17
+ @includeWallet = includeWallet
18
+ end
19
+
20
+ def IncludeAssociatedEntities=(includeAssociatedEntities)
21
+ @includeAssociatedEntities = includeAssociatedEntities
22
+ end
23
+
24
+ def IncludeBillingAddress=(includeBillingAddress)
25
+ @includeBillingAddress = includeBillingAddress
26
+ end
27
+
28
+ def IncludeShippingAddress=(includeShippingAddress)
29
+ @includeShippingAddress = includeShippingAddress
30
+ end
31
+
32
+ def IncludeCustomFields=(includeCustomFields)
33
+ @includeCustomFields = includeCustomFields
34
+ end
35
+
36
+ def UpdateCustomerEntityBalance=(updateCustomerEntityBalance)
37
+ @updateCustomerEntityBalance = updateCustomerEntityBalance
38
+ end
39
+
40
+ def IncludePaymentInstructions=(includePaymentInstructions)
41
+ @includePaymentInstructions = includePaymentInstructions
42
+ end
43
+
44
+ #private boolean IncludeAll;
45
+ #private boolean IncludeCardInstruments;
46
+ #private boolean IncludeACHInstruments;
47
+ #private boolean IncludeWallet;
48
+ #private boolean IncludeAssociatedEntities;
49
+ #private boolean IncludeBillingAddress;
50
+ #private boolean IncludeShippingAddress;
51
+ #private boolean IncludeCustomFields;
52
+ #private boolean UpdateCustomerEntityBalance;
53
+ #private boolean IncludePaymentInstructions;
54
+
55
+ end
@@ -0,0 +1,59 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ class DateRangeFilter < JSONable
3
+
4
+ def Date1=(date1)
5
+ @date1 = date1
6
+ end
7
+
8
+ def Date2=(date2)
9
+ @date2 = date2
10
+ end
11
+
12
+ def Operation=(operation)
13
+ @operation = operation
14
+ end
15
+
16
+ #Methods
17
+ def GreaterThan(date)
18
+ self.ClearFilter
19
+ @date1 = date
20
+ @operation = "GREATER_THAN"
21
+ return self
22
+ end
23
+
24
+ def LessThan(date)
25
+ self.ClearFilter
26
+ @date1 = date
27
+ @operation = "LESS_THAN"
28
+ return self
29
+ end
30
+
31
+ def EqualTo(date)
32
+ self.ClearFilter
33
+ @date1 = date
34
+ @operation = "EQUAL_TO"
35
+ return self
36
+ end
37
+
38
+ def Between(dateFrom, dateTo)
39
+ self.ClearFilter
40
+ @date1 = dateFrom
41
+ @date2 = dateTo
42
+ @operation = "BETWEEN"
43
+ return self
44
+ end
45
+
46
+
47
+ #private
48
+ def ClearFilter
49
+ @date1 = ""
50
+ @date2 = ""
51
+ @operation = ""
52
+ end
53
+
54
+
55
+ #private String Date1;
56
+ #private String Date2;
57
+ #private String Operation = "";
58
+
59
+ end
@@ -0,0 +1,136 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ require_relative '../Entities/instruction_response'
3
+ class Instruction < JSONable
4
+
5
+ def initialize(h = nil)
6
+
7
+ if(h != nil)
8
+
9
+ h.each {
10
+ |k,v|
11
+
12
+ propNameFormatted = k.to_s + "="
13
+
14
+ if(Instruction.instance_methods(false).include?(propNameFormatted.to_sym))
15
+ public_send("#{k}=",v)
16
+ end
17
+
18
+ }
19
+
20
+ end
21
+
22
+ end
23
+
24
+ def Id=(id)
25
+ @id = id
26
+ end
27
+
28
+ def CustomerId=(customerId)
29
+ @customerId = customerId
30
+ end
31
+
32
+ def CustomerEntityId=(customerEntityId)
33
+ @customerEntityId = customerEntityId
34
+ end
35
+
36
+ def InstrumentToken=(instrumentToken)
37
+ @instrumentToken = instrumentToken
38
+ end
39
+
40
+ def Status=(status)
41
+ @status = status
42
+ end
43
+
44
+ def ScheduleDay=(scheduleDay)
45
+ @scheduleDay = scheduleDay
46
+ end
47
+
48
+ def CustomFields=(customFields) # Hash type
49
+ @customFields = customFields
50
+ end
51
+
52
+ def Response=(response) #InstructionResponse type
53
+ @response = response
54
+ end
55
+
56
+ def ExpirationDate=(expirationDate)
57
+ @expirationDate = expirationDate
58
+ end
59
+
60
+ def AccountToken=(accountToken)
61
+ @accountToken = accountToken
62
+ end
63
+
64
+ def CustomerEntityValue=(customerEntityValue)
65
+ @customerEntityValue = customerEntityValue
66
+ end
67
+
68
+ def AccountNumber=(accountNumber)
69
+ @accountNumber = accountNumber
70
+ end
71
+
72
+
73
+
74
+ #Getters
75
+ def getId
76
+ return @id
77
+ end
78
+
79
+ def getCustomerId
80
+ return @customerId
81
+ end
82
+
83
+ def getCustomerEntityId
84
+ return @customerEntityId
85
+ end
86
+
87
+ def getInstrumentToken
88
+ return @instrumentToken
89
+ end
90
+
91
+ def getStatus
92
+ return @status
93
+ end
94
+
95
+ def getScheduleDay
96
+ return @scheduleDay
97
+ end
98
+
99
+ def getCustomFields
100
+ return @customFields
101
+ end
102
+
103
+ def getResponse
104
+ return @response
105
+ end
106
+
107
+ def getExpirationDate
108
+ return @expirationDate
109
+ end
110
+
111
+ def getAccountToken
112
+ return @accountToken
113
+ end
114
+
115
+ def getCustomerEntityValue
116
+ return @customerEntityValue
117
+ end
118
+
119
+ def getAccountNumber
120
+ return @accountNumber
121
+ end
122
+
123
+ #private String Id;
124
+ #private String CustomerId;
125
+ #private String CustomerEntityId;
126
+ #private String InstrumentToken;
127
+ #private String Status;
128
+ #private String ScheduleDay;
129
+ #private HashMap CustomFields;
130
+ #private InstructionResponse Response;
131
+ #private String ExpirationDate;
132
+ #private String AccountToken;
133
+ #private String CustomerEntityValue;
134
+ #private String AccountNumber;
135
+
136
+ end
@@ -0,0 +1,63 @@
1
+ require_relative '../Helpers/jso_nable'
2
+ class InstructionResponse < JSONable
3
+
4
+
5
+ def ValidationErrors=(validationErrors) #ValidationError type
6
+ @validationErrors = validationErrors
7
+ end
8
+
9
+ def IsSuccess=(isSuccess)
10
+ @isSuccess = isSuccess
11
+ end
12
+
13
+ def ResponseSummary=(responseSummary)
14
+ @responseSummary = responseSummary
15
+ end
16
+
17
+ def responseCode=(responseCode)
18
+ @responseCode = responseCode
19
+ end
20
+
21
+ def Id=(id)
22
+ @id = id
23
+ end
24
+
25
+ def PaymentInstructionToken(paymentInstructionToken)
26
+ @paymentInstructionToken = paymentInstructionToken
27
+ end
28
+
29
+
30
+
31
+ #Getters
32
+ def getValidationErrors
33
+ return @validationErrors
34
+ end
35
+
36
+ def getIsSuccess
37
+ return @isSuccess
38
+ end
39
+
40
+ def getResponseSummary
41
+ return @responseSummary
42
+ end
43
+
44
+ def getResponseCode
45
+ return @responseCode
46
+ end
47
+
48
+ def getId
49
+ return @id
50
+ end
51
+
52
+ def getPaymentInstructionToken
53
+ return @paymentInstructionToken
54
+ end
55
+
56
+ #private ValidationError ValidationErrors;
57
+ #private boolean IsSuccess;
58
+ #private String ResponseSummary;
59
+ #private String ResponseCode;
60
+ #private String Id;
61
+ #private String PaymentInstructionToken;
62
+
63
+ end