CnpOnline 12.3.0 → 12.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +12 -0
  3. data/Rakefile +1 -1
  4. data/lib/CnpBatchRequest.rb +17 -8
  5. data/lib/CnpOnline.rb +2 -0
  6. data/lib/CnpOnlineRequest.rb +30 -2
  7. data/lib/CnpRequest.rb +24 -4
  8. data/lib/CnpTransaction.rb +70 -7
  9. data/lib/CommManager.rb +185 -0
  10. data/lib/Communications.rb +7 -3
  11. data/lib/EnvironmentVariables.rb +8 -0
  12. data/lib/RequestTarget.rb +10 -0
  13. data/lib/XMLFields.rb +148 -11
  14. data/out/production/cnp-sdk-for-ruby/CnpBatchRequest.rb +787 -0
  15. data/out/production/cnp-sdk-for-ruby/CnpListeners.rb +265 -0
  16. data/out/production/cnp-sdk-for-ruby/CnpOnline.rb +65 -0
  17. data/out/production/cnp-sdk-for-ruby/CnpOnlineRequest.rb +370 -0
  18. data/out/production/cnp-sdk-for-ruby/CnpRequest.rb +670 -0
  19. data/out/production/cnp-sdk-for-ruby/CnpTransaction.rb +831 -0
  20. data/out/production/cnp-sdk-for-ruby/CnpXmlMapper.rb +71 -0
  21. data/out/production/cnp-sdk-for-ruby/CommManager.rb +185 -0
  22. data/out/production/cnp-sdk-for-ruby/Communications.rb +90 -0
  23. data/out/production/cnp-sdk-for-ruby/Configuration.rb +75 -0
  24. data/out/production/cnp-sdk-for-ruby/EnvironmentVariables.rb +33 -0
  25. data/out/production/cnp-sdk-for-ruby/RequestTarget.rb +10 -0
  26. data/out/production/cnp-sdk-for-ruby/Setup.rb +147 -0
  27. data/out/production/cnp-sdk-for-ruby/XMLFields.rb +2638 -0
  28. data/out/production/cnp-sdk-for-ruby/cacert.pem +3331 -0
  29. data/out/production/cnp-sdk-for-ruby/sample_batch_driver.rb +123 -0
  30. data/out/production/cnp-sdk-for-ruby/sample_driver.rb +49 -0
  31. data/out/test/cnp-sdk-for-ruby/certification/certTest1_base.rb +948 -0
  32. data/out/test/cnp-sdk-for-ruby/certification/certTest2_authenhanced.rb +577 -0
  33. data/out/test/cnp-sdk-for-ruby/certification/certTest3_authreversal.rb +190 -0
  34. data/out/test/cnp-sdk-for-ruby/certification/certTest4_echeck.rb +288 -0
  35. data/out/test/cnp-sdk-for-ruby/certification/certTest5_token.rb +209 -0
  36. data/out/test/cnp-sdk-for-ruby/certification/certTest_batchAll.rb +610 -0
  37. data/out/test/cnp-sdk-for-ruby/certification/ts_all.rb +33 -0
  38. data/out/test/cnp-sdk-for-ruby/functional/test_activate.rb +133 -0
  39. data/out/test/cnp-sdk-for-ruby/functional/test_activateReversal.rb +73 -0
  40. data/out/test/cnp-sdk-for-ruby/functional/test_auth.rb +478 -0
  41. data/out/test/cnp-sdk-for-ruby/functional/test_authReversal.rb +74 -0
  42. data/out/test/cnp-sdk-for-ruby/functional/test_balanceInquiry.rb +107 -0
  43. data/out/test/cnp-sdk-for-ruby/functional/test_batch.rb +264 -0
  44. data/out/test/cnp-sdk-for-ruby/functional/test_batchStream.rb +154 -0
  45. data/out/test/cnp-sdk-for-ruby/functional/test_cancelSubscription.rb +57 -0
  46. data/out/test/cnp-sdk-for-ruby/functional/test_capture.rb +147 -0
  47. data/out/test/cnp-sdk-for-ruby/functional/test_captureGivenAuth.rb +352 -0
  48. data/out/test/cnp-sdk-for-ruby/functional/test_commManager.rb +302 -0
  49. data/out/test/cnp-sdk-for-ruby/functional/test_configuration.rb +89 -0
  50. data/out/test/cnp-sdk-for-ruby/functional/test_createPlan.rb +87 -0
  51. data/out/test/cnp-sdk-for-ruby/functional/test_credit.rb +222 -0
  52. data/out/test/cnp-sdk-for-ruby/functional/test_ctx.rb +124 -0
  53. data/out/test/cnp-sdk-for-ruby/functional/test_deactivate.rb +105 -0
  54. data/out/test/cnp-sdk-for-ruby/functional/test_deactivateReversal.rb +71 -0
  55. data/out/test/cnp-sdk-for-ruby/functional/test_depositReversal.rb +70 -0
  56. data/out/test/cnp-sdk-for-ruby/functional/test_echeckCredit.rb +179 -0
  57. data/out/test/cnp-sdk-for-ruby/functional/test_echeckRedeposit.rb +117 -0
  58. data/out/test/cnp-sdk-for-ruby/functional/test_echeckSale.rb +255 -0
  59. data/out/test/cnp-sdk-for-ruby/functional/test_echeckVerification.rb +160 -0
  60. data/out/test/cnp-sdk-for-ruby/functional/test_echeckVoid.rb +42 -0
  61. data/out/test/cnp-sdk-for-ruby/functional/test_fastAccessFunding.rb +177 -0
  62. data/out/test/cnp-sdk-for-ruby/functional/test_forceCapture.rb +272 -0
  63. data/out/test/cnp-sdk-for-ruby/functional/test_fraudCheck.rb +76 -0
  64. data/out/test/cnp-sdk-for-ruby/functional/test_giftCardAuthReversal.rb +72 -0
  65. data/out/test/cnp-sdk-for-ruby/functional/test_giftCardCapture.rb +72 -0
  66. data/out/test/cnp-sdk-for-ruby/functional/test_giftCardCredit.rb +69 -0
  67. data/out/test/cnp-sdk-for-ruby/functional/test_litle_requests.rb +355 -0
  68. data/out/test/cnp-sdk-for-ruby/functional/test_load.rb +108 -0
  69. data/out/test/cnp-sdk-for-ruby/functional/test_loadReversal.rb +71 -0
  70. data/out/test/cnp-sdk-for-ruby/functional/test_override.rb +68 -0
  71. data/out/test/cnp-sdk-for-ruby/functional/test_pgp_cnp_requests.rb +295 -0
  72. data/out/test/cnp-sdk-for-ruby/functional/test_queryTransaction.rb +154 -0
  73. data/out/test/cnp-sdk-for-ruby/functional/test_refundReversal.rb +71 -0
  74. data/out/test/cnp-sdk-for-ruby/functional/test_sale.rb +459 -0
  75. data/out/test/cnp-sdk-for-ruby/functional/test_token.rb +137 -0
  76. data/out/test/cnp-sdk-for-ruby/functional/test_translateToken.rb +203 -0
  77. data/out/test/cnp-sdk-for-ruby/functional/test_unload.rb +108 -0
  78. data/out/test/cnp-sdk-for-ruby/functional/test_unloadReversal.rb +71 -0
  79. data/out/test/cnp-sdk-for-ruby/functional/test_updateCardValidationNumOnToken.rb +44 -0
  80. data/out/test/cnp-sdk-for-ruby/functional/test_updatePlan.rb +61 -0
  81. data/out/test/cnp-sdk-for-ruby/functional/test_updateSubscription.rb +80 -0
  82. data/out/test/cnp-sdk-for-ruby/functional/test_wallet.rb +74 -0
  83. data/out/test/cnp-sdk-for-ruby/functional/test_xmlfields.rb +429 -0
  84. data/out/test/cnp-sdk-for-ruby/functional/ts_all.rb +69 -0
  85. data/out/test/cnp-sdk-for-ruby/unit/test_LitleAUBatch.rb +244 -0
  86. data/out/test/cnp-sdk-for-ruby/unit/test_LitleBatchRequest.rb +791 -0
  87. data/out/test/cnp-sdk-for-ruby/unit/test_LitleOnlineRequest.rb +253 -0
  88. data/out/test/cnp-sdk-for-ruby/unit/test_LitleRequest.rb +317 -0
  89. data/out/test/cnp-sdk-for-ruby/unit/test_LitleTransaction.rb +426 -0
  90. data/out/test/cnp-sdk-for-ruby/unit/test_LitleXmlMapper.rb +139 -0
  91. data/out/test/cnp-sdk-for-ruby/unit/test_activate.rb +92 -0
  92. data/out/test/cnp-sdk-for-ruby/unit/test_activateReversal.rb +56 -0
  93. data/out/test/cnp-sdk-for-ruby/unit/test_auth.rb +463 -0
  94. data/out/test/cnp-sdk-for-ruby/unit/test_authReversal.rb +82 -0
  95. data/out/test/cnp-sdk-for-ruby/unit/test_balanceInquiry.rb +52 -0
  96. data/out/test/cnp-sdk-for-ruby/unit/test_cancelSubscription.rb +43 -0
  97. data/out/test/cnp-sdk-for-ruby/unit/test_capture.rb +99 -0
  98. data/out/test/cnp-sdk-for-ruby/unit/test_captureGivenAuth.rb +234 -0
  99. data/out/test/cnp-sdk-for-ruby/unit/test_createPlan.rb +52 -0
  100. data/out/test/cnp-sdk-for-ruby/unit/test_credit.rb +355 -0
  101. data/out/test/cnp-sdk-for-ruby/unit/test_deactivate.rb +71 -0
  102. data/out/test/cnp-sdk-for-ruby/unit/test_deactivateReversal.rb +56 -0
  103. data/out/test/cnp-sdk-for-ruby/unit/test_depositReversal.rb +56 -0
  104. data/out/test/cnp-sdk-for-ruby/unit/test_echeckCredit.rb +103 -0
  105. data/out/test/cnp-sdk-for-ruby/unit/test_echeckRedeposit.rb +109 -0
  106. data/out/test/cnp-sdk-for-ruby/unit/test_echeckSale.rb +107 -0
  107. data/out/test/cnp-sdk-for-ruby/unit/test_echeckVerification.rb +74 -0
  108. data/out/test/cnp-sdk-for-ruby/unit/test_echeckVoid.rb +54 -0
  109. data/out/test/cnp-sdk-for-ruby/unit/test_forceCapture.rb +163 -0
  110. data/out/test/cnp-sdk-for-ruby/unit/test_fraudCheck.rb +45 -0
  111. data/out/test/cnp-sdk-for-ruby/unit/test_giftCardAuthReversal.rb +58 -0
  112. data/out/test/cnp-sdk-for-ruby/unit/test_giftCardCapture.rb +57 -0
  113. data/out/test/cnp-sdk-for-ruby/unit/test_giftCardCredit.rb +57 -0
  114. data/out/test/cnp-sdk-for-ruby/unit/test_load.rb +53 -0
  115. data/out/test/cnp-sdk-for-ruby/unit/test_loadReversal.rb +56 -0
  116. data/out/test/cnp-sdk-for-ruby/unit/test_pgp_CnpRequest.rb +139 -0
  117. data/out/test/cnp-sdk-for-ruby/unit/test_queryTransaction.rb +106 -0
  118. data/out/test/cnp-sdk-for-ruby/unit/test_refundReversal.rb +56 -0
  119. data/out/test/cnp-sdk-for-ruby/unit/test_sale.rb +551 -0
  120. data/out/test/cnp-sdk-for-ruby/unit/test_token.rb +159 -0
  121. data/out/test/cnp-sdk-for-ruby/unit/test_unload.rb +53 -0
  122. data/out/test/cnp-sdk-for-ruby/unit/test_unloadReversal.rb +56 -0
  123. data/out/test/cnp-sdk-for-ruby/unit/test_updateCardValidationNumOnToken.rb +80 -0
  124. data/out/test/cnp-sdk-for-ruby/unit/test_updatePlan.rb +45 -0
  125. data/out/test/cnp-sdk-for-ruby/unit/test_updateSubscription.rb +172 -0
  126. data/out/test/cnp-sdk-for-ruby/unit/test_wallet.rb +262 -0
  127. data/out/test/cnp-sdk-for-ruby/unit/test_xmlfields.rb +2930 -0
  128. data/out/test/cnp-sdk-for-ruby/unit/ts_unit.rb +67 -0
  129. data/test/certification/certTest2_authenhanced.rb +28 -27
  130. data/test/functional/test_batch.rb +106 -1
  131. data/test/functional/test_batchStream.rb +3 -2
  132. data/test/functional/test_captureGivenAuth.rb +24 -0
  133. data/test/functional/test_commManager.rb +302 -0
  134. data/test/functional/test_ctx.rb +124 -0
  135. data/test/functional/test_fastAccessFunding.rb +21 -0
  136. data/test/functional/test_forceCapture.rb +21 -0
  137. data/test/functional/test_xmlfields.rb +20 -1
  138. metadata +122 -4
@@ -0,0 +1,10 @@
1
+ module CnpOnline
2
+ class RequestTarget
3
+ attr_reader :targetUrl, :urlIndex, :requestTime
4
+ def initialize(url, index)
5
+ @targetUrl = url
6
+ @urlIndex = index
7
+ @requestTime = Time.now.to_i * 1000
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ =begin
4
+ Copyright (c) 2017 Vantiv eCommerce
5
+
6
+ Permission is hereby granted, free of charge, to any person
7
+ obtaining a copy of this software and associated documentation
8
+ files (the "Software"), to deal in the Software without
9
+ restriction, including without limitation the rights to use,
10
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the
12
+ Software is furnished to do so, subject to the following
13
+ conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+ OTHER DEALINGS IN THE SOFTWARE.
26
+ =end
27
+
28
+ # make setup file executable
29
+
30
+ require 'iostreams'
31
+
32
+ #
33
+ # Configuration generation for URL and credentials
34
+ #
35
+ class Setup
36
+ attr_reader :handle, :path
37
+ def initialize(filename)
38
+ @handle = File.new(filename, File::CREAT|File::TRUNC|File::RDWR, 0600)
39
+ File.open(filename, 'w') do |f|
40
+ puts 'Welcome to Vantiv eCommerce Ruby_SDK'
41
+ puts 'Please input your user name:'
42
+ f.puts 'user: '+ gets
43
+ puts 'Please input your password:'
44
+ f.puts 'password: ' + gets
45
+ puts 'Please input your merchantId:'
46
+ f.puts 'currency_merchant_map:'
47
+ f.puts ' DEFAULT: ' + gets
48
+ f.puts "default_report_group: 'Default Report Group'"
49
+ puts "Please choose Vantiv eCommerce url from the following list (example: 'prelive') or directly input another URL:
50
+ sandbox => hhttps://www.testvantivcnp.com/sandbox/new/sandbox/communicator/online
51
+ prelive => https://payments.vantivprelive.com/vap/communicator/online
52
+ postlive => https://payments.vantivpostlive.com/vap/communicator/online
53
+ production => https://payments.vantivcnp.com/vap/communicator/online
54
+ transact_prelive => https://transact.vantivprelive.com/vap/communicator/online
55
+ transact_postlive => https://transact.vantivpostlive.com/vap/communicator/online
56
+ transact_production => https://transact.vantivcnp.com/vap/communicator/online"
57
+ f.puts 'url: ' + Setup.choice(gets)
58
+ puts 'Please input the proxy address, if no proxy hit enter key: '
59
+ f.puts 'proxy_addr: ' + gets
60
+ puts 'Please input the proxy port, if no proxy hit enter key: '
61
+ f.puts 'proxy_port: ' + gets
62
+ puts 'Please input your sFTP username for batch processing; if no sFTP, hit enter key: '
63
+ f.puts 'sftp_username: ' + gets
64
+ puts 'Please input your sFTP password for batch processing; if no sFTP, hit enter key: '
65
+ f.puts 'sftp_password: ' + gets
66
+ puts 'Please input your sFTP url for batch processing; if no sFTP, hit enter key: '
67
+ f.puts 'sftp_url: ' + gets
68
+ puts 'Please input your url for fast batch processing; if no fast batch, hit enter key: '
69
+ f.puts 'fast_url: ' + gets
70
+ puts 'Please input your port for fast batch processing; if no fast batch, hit enter key: '
71
+ f.puts 'fast_port: ' + gets
72
+ f.puts 'printxml: false'
73
+ # default http timeout set to 500 ms
74
+ f.puts 'timeout: 500'
75
+
76
+ puts 'Delete batch files after sending request/processing response (true/false) (false by default): '
77
+ deleteBatchFiles = (gets.chomp() == 'true')
78
+ f.puts "deleteBatchFiles: #{deleteBatchFiles}"
79
+ puts 'Use PGP encryption for sending batch files through sftp (true/false) (No encryption by default): '
80
+ useEncryption = (gets.chomp() == 'true')
81
+ f.puts "useEncryption: #{useEncryption}"
82
+ if useEncryption
83
+ puts "Path to Vantiv's Public key (For encryption of batch files): "
84
+ puts "Note: The key from the provided file path will be added to your gpg keyring. If you do not have gpg2 installed, please install it before proceeding"
85
+ key_path = gets.chomp()
86
+ key = File.read(key_path)
87
+ key_info = IOStreams::Pgp.import(key: key)
88
+ if key_info.empty?
89
+ key_info = IOStreams::Pgp.key_info(key: key)
90
+ end
91
+ key_id = key_info[0][:key_id]
92
+ f.puts "vantivPublicKeyID: " + key_id
93
+ puts "Enter passphrase of your merchant key for decrypting responses: "
94
+ f.puts "passphrase: " + gets.chomp()
95
+ end
96
+ end
97
+ end
98
+
99
+ def finished
100
+ @handle.close
101
+ end
102
+
103
+ def Setup.choice(cnp_env)
104
+ cnp_online_ctx = 'vap/communicator/online'
105
+ if cnp_env == "sandbox\n"
106
+ return 'https://www.testvantivcnp.com/sandbox/communicator/online'
107
+ elsif cnp_env == "prelive\n"
108
+ return 'https://payments.vantivprelive.com/' + cnp_online_ctx
109
+ elsif cnp_env == "postlive\n"
110
+ return 'https://payments.vantivpostlive.com/' + cnp_online_ctx
111
+ elsif cnp_env == "production\n"
112
+ return 'https://payments.vantivcnp.com/' + cnp_online_ctx
113
+ elsif cnp_env == "transact_production\n"
114
+ return 'https://transact.vantivcnp.com/' + cnp_online_ctx
115
+ elsif cnp_env == "transact_prelive\n"
116
+ return 'https://transact.vantivprelive.com/' + cnp_online_ctx
117
+ elsif cnp_env == "transact_postlive\n"
118
+ return 'https://transact.vantivpostlive.com/' + cnp_online_ctx
119
+ else
120
+ return 'https://www.testvantivcnp.com/sandbox/communicator/online'
121
+ end
122
+ end
123
+ end
124
+
125
+ #
126
+ #
127
+ # Optionally enable the configuration to reside in a custom location
128
+ # if the $CNP_CONFIG_DIR directory is set
129
+ #
130
+
131
+ # make the config.yml file in the CNP_CONFIG_DIR directory or HOME directory
132
+ if !(ENV['CNP_CONFIG_DIR'].nil?)
133
+ path = ENV['CNP_CONFIG_DIR']
134
+ else
135
+ path = ENV['HOME']
136
+ end
137
+
138
+ # make the config.yml file hidden
139
+ # create a config file contain all the configuration data
140
+ config_file = path + '/.cnp_SDK_config.yml'
141
+ f = Setup.new(config_file)
142
+
143
+ # return the path of the config file and the path file
144
+ @path = File.expand_path(config_file)
145
+ puts 'The Vantiv eCommerce configuration file has been generated, the file is located at: ' + @path
146
+ f.finished
147
+
@@ -0,0 +1,2638 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ OTHER DEALINGS IN THE SOFTWARE.
21
+ =end
22
+ #
23
+ # Contains all of the underlying XML fields and specifications needed to create the transaction set
24
+ #
25
+
26
+ module CnpOnline
27
+ class OptionalChoiceNode < XML::Mapping::ChoiceNode
28
+ def obj_to_xml(obj,xml)
29
+ count = 0
30
+ @choices.each do |path,node|
31
+ if node.is_present_in? obj
32
+ count = count + 1
33
+ end
34
+ end
35
+ if(count > 1)
36
+ raise RuntimeError, "Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!"
37
+ end
38
+ @choices.each do |path,node|
39
+ if node.is_present_in? obj
40
+ node.obj_to_xml(obj,xml)
41
+ path.first(xml, :ensure_created=>true)
42
+ return true
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ XML::Mapping.add_node_class OptionalChoiceNode
49
+
50
+ class Authentication
51
+ include XML::Mapping
52
+ text_node :user, "user"
53
+ text_node :password, "password"
54
+ end
55
+
56
+ class SchemaValidation
57
+ def self.validate_required(value, required, class_name, field_name)
58
+ if(required)
59
+ if(value.nil?)
60
+ raise "If #{class_name} is specified, it must have a #{field_name}"
61
+ end
62
+ end
63
+ end
64
+
65
+ def self.validate_length(value, required, min, max, class_name, field_name)
66
+ validate_required(value, required, class_name, field_name)
67
+ if(value.nil?)
68
+ return
69
+ end
70
+ if(value.length < min || value.length > max)
71
+ raise "If " + class_name + " " + field_name + " is specified, it must be between " + min.to_s + " and " + max.to_s + " characters long"
72
+ end
73
+ end
74
+
75
+ def self.validate_size(value, required, min, max, class_name, field_name)
76
+ validate_required(value, required, class_name, field_name)
77
+ if(value.nil?)
78
+ return
79
+ end
80
+ if(value.to_i < min || value.to_i > max || !(/\A\-?\d+\Z/ =~ value))
81
+ raise "If " + class_name + " " + field_name + " is specified, it must be between " + min.to_s + " and " + max.to_s
82
+ end
83
+ end
84
+
85
+ def self.validate_country(value, class_name, field_name)
86
+ if(value.nil?)
87
+ return
88
+ end
89
+ list = ["USA","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","TL","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","KN","LC","MF","VC","WS","SM","ST","SA","SN","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","ES","LK","SH","PM","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","RS","ME"]
90
+ if(!list.include? value)
91
+ raise "If " + class_name + " " + field_name + " is specified, it must be valid. You specified " + value
92
+ end
93
+ end
94
+
95
+ def self.validate_regex(value, required, regex, class_name, field_name)
96
+ validate_required(value, required, class_name, field_name)
97
+ if(value.nil?)
98
+ return
99
+ end
100
+ if(!(regex =~ value))
101
+ raise "If #{class_name} #{field_name} is specified, it must match the regular expression #{regex.inspect}"
102
+ end
103
+ end
104
+
105
+ def self.validate_enum(value, required, list, class_name, field_name)
106
+ validate_required(value, required, class_name, field_name)
107
+ if(value.nil?)
108
+ return
109
+ end
110
+ if(!list.include?(value))
111
+ str = '["'+ list.join('", "') + '"]'
112
+ raise "If #{class_name} #{field_name} is specified, it must be in #{str}"
113
+ end
114
+ end
115
+
116
+ def self.validate_long(value, required, class_name, field_name)
117
+ validate_size(value, required, -9223372036854775808, 9223372036854775807, class_name, field_name)
118
+ end
119
+
120
+ def self.validate_currency(value, required, class_name, field_name)
121
+ validate_enum(value, required, ['AUD','CAD','CHF','DKK','EUR','GBP','HKD','JPY','NOK','NZD','SEK','SGD','USD'], class_name, field_name)
122
+ end
123
+
124
+ def self.validate_boolean(value, required, class_name, field_name)
125
+ validate_enum(value, required, ['true','false','1','0'], class_name, field_name)
126
+ end
127
+
128
+ def self.validate_date(value, required, class_name, field_name)
129
+ validate_regex(value, required, /\A\d{4}-\d{2}-\d{2}\Z/, class_name, field_name)
130
+ end
131
+
132
+ end
133
+
134
+ class Contact
135
+ include XML::Mapping
136
+ text_node :name, "name", :default_value=>nil
137
+ text_node :firstName, "firstName", :default_value=>nil
138
+ text_node :middleInitial, "middleInitial", :default_value=>nil
139
+ text_node :lastName, "lastName", :default_value=>nil
140
+ text_node :companyName, "companyName", :default_value=>nil
141
+ text_node :addressLine1, "addressLine1", :default_value=>nil
142
+ text_node :addressLine2, "addressLine2", :default_value=>nil
143
+ text_node :addressLine3, "addressLine3", :default_value=>nil
144
+ text_node :city, "city", :default_value=>nil
145
+ text_node :state, "state", :default_value=>nil
146
+ text_node :zip, "zip", :default_value=>nil
147
+ text_node :country, "country", :default_value=>nil
148
+ text_node :email, "email", :default_value=>nil
149
+ text_node :phone, "phone", :default_value=>nil
150
+ def self.from_hash(hash, name='contact')
151
+ base = hash[name]
152
+ if(base)
153
+ this = Contact.new
154
+ this.name = base['name']
155
+ this.firstName = base['firstName']
156
+ this.middleInitial = base['middleInitial']
157
+ this.lastName = base['lastName']
158
+ this.companyName = base['companyName']
159
+ this.addressLine1 = base['addressLine1']
160
+ this.addressLine2 = base['addressLine2']
161
+ this.addressLine3 = base['addressLine3']
162
+ this.city = base['city']
163
+ this.state = base['state']
164
+ this.zip = base['zip']
165
+ this.country = base['country']
166
+ this.email = base['email']
167
+ this.phone = base['phone']
168
+ SchemaValidation.validate_length(this.name, false, 1, 100, name, "name")
169
+ SchemaValidation.validate_length(this.firstName, false, 1, 25, name, "firstName")
170
+ SchemaValidation.validate_length(this.middleInitial, false, 1, 1, name, "middleInitial")
171
+ SchemaValidation.validate_length(this.lastName, false, 1, 25, name, "lastName")
172
+ SchemaValidation.validate_length(this.companyName, false, 1, 40, name, "companyName")
173
+ SchemaValidation.validate_length(this.addressLine1, false, 1, 35, name, "addressLine1")
174
+ SchemaValidation.validate_length(this.addressLine2, false, 1, 35, name, "addressLine2")
175
+ SchemaValidation.validate_length(this.addressLine3, false, 1, 35, name, "addressLine3")
176
+ SchemaValidation.validate_length(this.city, false, 1, 35, name, "city")
177
+ SchemaValidation.validate_length(this.state, false, 1, 30, name, "state")
178
+ SchemaValidation.validate_length(this.zip, false, 1, 20, name, "zip")
179
+ SchemaValidation.validate_length(this.country, false, 1, 3, name, "country")
180
+ SchemaValidation.validate_country(this.country, name, "country")
181
+ SchemaValidation.validate_length(this.email, false, 1, 100, name, "email")
182
+ SchemaValidation.validate_length(this.phone, false, 1, 20, name, "phone")
183
+ this
184
+ else
185
+ nil
186
+ end
187
+ end
188
+ end
189
+
190
+ class CustomerInfo
191
+ include XML::Mapping
192
+ text_node :ssn, "ssn", :default_value=>nil
193
+ text_node :dob, "dob", :default_value=>nil
194
+ text_node :customerRegistrationDate, "customerRegistrationDate", :default_value=>nil
195
+ text_node :customerType, "customerType", :default_value=>nil
196
+ text_node :incomeAmount, "incomeAmount", :default_value=>nil
197
+ text_node :incomeCurrency, "incomeCurrency", :default_value=>nil
198
+ text_node :customerCheckingAccount, "customerCheckingAccount", :default_value=>nil
199
+ text_node :customerSavingAccount, "customerSavingAccount", :default_value=>nil
200
+ text_node :employerName, "employerName", :default_value=>nil
201
+ text_node :customerWorkTelephone, "customerWorkTelephone", :default_value=>nil
202
+ text_node :residenceStatus, "residenceStatus", :default_value=>nil
203
+ text_node :yearsAtResidence, "yearsAtResidence", :default_value=>nil
204
+ text_node :yearsAtEmployer, "yearsAtEmployer", :default_value=>nil
205
+ def self.from_hash(hash, name='customerInfo')
206
+ base = hash[name]
207
+ if(base)
208
+ this = CustomerInfo.new
209
+ this.ssn = base['ssn']
210
+ this.dob = base['dob']
211
+ this.customerRegistrationDate = base['customerRegistrationDate']
212
+ this.customerType = base['customerType']
213
+ this.incomeAmount = base['incomeAmount']
214
+ this.incomeCurrency = base['incomeCurrency']
215
+ this.customerCheckingAccount = base['customerCheckingAccount']
216
+ this.customerSavingAccount = base['customerSavingAccount']
217
+ this.employerName = base['employerName']
218
+ this.customerWorkTelephone = base['customerWorkTelephone']
219
+ this.residenceStatus = base['residenceStatus']
220
+ this.yearsAtResidence = base['yearsAtResidence']
221
+ this.yearsAtEmployer = base['yearsAtEmployer']
222
+ SchemaValidation.validate_regex(this.ssn, false, /\A\d{9}\Z/, name, 'ssn')
223
+ SchemaValidation.validate_date(this.dob, false, name, 'dob')
224
+ SchemaValidation.validate_regex(this.customerRegistrationDate, false, /\A\d{4}-\d{2}-\d{2}/, name, 'customerRegistrationDate')
225
+ SchemaValidation.validate_enum(this.customerType, false, ['New','Existing'], name, 'customerType')
226
+ SchemaValidation.validate_long(this.incomeAmount, false, name, 'incomeAmount')
227
+ SchemaValidation.validate_currency(this.incomeCurrency, false, name, 'incomeCurrency')
228
+ SchemaValidation.validate_boolean(this.customerCheckingAccount, false, name, 'customerCheckingAccount')
229
+ SchemaValidation.validate_boolean(this.customerSavingAccount, false, name, 'customerSavingAccount')
230
+ SchemaValidation.validate_length(this.employerName, false, 1, 20, name, "employerName")
231
+ SchemaValidation.validate_length(this.customerWorkTelephone, false, 1, 20, name, "customerWorkTelephone")
232
+ SchemaValidation.validate_enum(this.residenceStatus, false, ['Own','Rent','Other'], name, 'residenceStatus')
233
+ SchemaValidation.validate_size(this.yearsAtResidence, false, 0, 99, name, 'yearsAtResidence')
234
+ SchemaValidation.validate_size(this.yearsAtEmployer, false, 0, 99, name, 'yearsAtEmployer')
235
+ this
236
+ else
237
+ nil
238
+ end
239
+ end
240
+ end
241
+
242
+ class BillMeLaterRequest
243
+ include XML::Mapping
244
+ text_node :bmlMerchantId, "bmlMerchantId", :default_value=>nil
245
+ text_node :bmlProductType, "bmlProductType", :default_value=>nil
246
+ text_node :termsAndConditions, "termsAndConditions", :default_value=>nil
247
+ text_node :preapprovalNumber, "preapprovalNumber", :default_value=>nil
248
+ text_node :merchantPromotionalCode, "merchantPromotionalCode", :default_value=>nil
249
+ text_node :customerPasswordChanged, "customerPasswordChanged", :default_value=>nil
250
+ text_node :customerBillingAddressChanged, "customerBillingAddressChanged", :default_value=>nil
251
+ text_node :customerEmailChanged, "customerEmailChanged", :default_value=>nil
252
+ text_node :customerPhoneChanged, "customerPhoneChanged", :default_value=>nil
253
+ text_node :secretQuestionCode, "secretQuestionCode", :default_value=>nil
254
+ text_node :secretQuestionAnswer, "secretQuestionAnswer", :default_value=>nil
255
+ text_node :virtualAuthenticationKeyPresenceIndicator, "virtualAuthenticationKeyPresenceIndicator", :default_value=>nil
256
+ text_node :virtualAuthenticationKeyData, "virtualAuthenticationKeyData", :default_value=>nil
257
+ text_node :itemCategoryCode, "itemCategoryCode", :default_value=>nil
258
+ text_node :authorizationSourcePlatform, "authorizationSourcePlatform", :default_value=>nil
259
+ def self.from_hash(hash, name='billMeLaterRequest')
260
+ base = hash[name]
261
+ if(base)
262
+ this = BillMeLaterRequest.new
263
+ this.bmlMerchantId = base['bmlMerchantId']
264
+ this.bmlProductType = base['bmlProductType']
265
+ this.termsAndConditions = base['termsAndConditions']
266
+ this.preapprovalNumber = base['preapprovalNumber']
267
+ this.merchantPromotionalCode = base['merchantPromotionalCode']
268
+ this.customerPasswordChanged = base['customerPasswordChanged']
269
+ this.customerBillingAddressChanged = base['customerBillingAddressChanged']
270
+ this.customerEmailChanged = base['customerEmailChanged']
271
+ this.customerPhoneChanged = base['customerPhoneChanged']
272
+ this.secretQuestionCode = base['secretQuestionCode']
273
+ this.secretQuestionAnswer = base['secretQuestionAnswer']
274
+ this.virtualAuthenticationKeyPresenceIndicator = base['virtualAuthenticationKeyPresenceIndicator']
275
+ this.virtualAuthenticationKeyData = base['virtualAuthenticationKeyData']
276
+ this.itemCategoryCode = base['itemCategoryCode']
277
+ this.authorizationSourcePlatform = base['authorizationSourcePlatform']
278
+ SchemaValidation.validate_long(this.bmlMerchantId, false, name, 'bmlMerchantId')
279
+ SchemaValidation.validate_length(this.bmlProductType, false, 1, 2, name, "bmlProductType")
280
+ SchemaValidation.validate_size(this.termsAndConditions, false, -99999, 99999, name, 'termsAndConditions')
281
+ SchemaValidation.validate_length(this.preapprovalNumber, false, 13, 25, name, "preapprovalNumber")
282
+ SchemaValidation.validate_size(this.merchantPromotionalCode, false, -9999, 9999, name, 'merchantPromotionalCode')
283
+ SchemaValidation.validate_boolean(this.customerPasswordChanged, false, name, 'customerPasswordChanged')
284
+ SchemaValidation.validate_boolean(this.customerBillingAddressChanged, false, name, 'customerBillingAddressChanged')
285
+ SchemaValidation.validate_boolean(this.customerEmailChanged, false, name, 'customerEmailChanged')
286
+ SchemaValidation.validate_boolean(this.customerPhoneChanged, false, name, 'customerPhoneChanged')
287
+ SchemaValidation.validate_length(this.secretQuestionCode, false, 1, 2, name, "secretQuestionCode")
288
+ SchemaValidation.validate_length(this.secretQuestionAnswer, false, 1, 25, name, "secretQuestionAnswer")
289
+ SchemaValidation.validate_length(this.virtualAuthenticationKeyPresenceIndicator, false, 1, 1, name, "virtualAuthenticationKeyPresenceIndicator")
290
+ SchemaValidation.validate_length(this.virtualAuthenticationKeyData, false, 1, 4, name, "virtualAuthenticationKeyData")
291
+ SchemaValidation.validate_size(this.itemCategoryCode, false, -9999, 9999, name, 'itemCategoryCode')
292
+ this
293
+ else
294
+ nil
295
+ end
296
+ end
297
+ end
298
+
299
+
300
+ #SDK XML 10
301
+ class Wallet
302
+ include XML::Mapping
303
+ text_node :walletSourceType, "walletSourceType", :default_value=>nil
304
+ text_node :walletSourceTypeId, "walletSourceTypeId", :default_value=>nil
305
+ def self.from_hash(hash, name='wallet')
306
+ base = hash[name]
307
+ if(base)
308
+ this = Wallet.new
309
+ this.walletSourceType = base['walletSourceType']
310
+ this.walletSourceTypeId = base['walletSourceTypeId']
311
+ SchemaValidation.validate_required(this.walletSourceType,true,name,'walletSourceType')
312
+ SchemaValidation.validate_required(this.walletSourceTypeId,true,name,'walletSourceTypeId')
313
+ SchemaValidation.validate_enum(this.walletSourceType, false, ['MasterPass','VisaCheckout'], name, 'walletSourceType')
314
+ this
315
+ else
316
+ nil
317
+ end
318
+ end
319
+ end
320
+
321
+
322
+ class FraudCheck
323
+ include XML::Mapping
324
+ text_node :authenticationValue, "authenticationValue", :default_value=>nil
325
+ text_node :authenticationTransactionId, "authenticationTransactionId", :default_value=>nil
326
+ text_node :customerIpAddress, "customerIpAddress", :default_value=>nil
327
+ text_node :authenticatedByMerchant, "authenticatedByMerchant", :default_value=>nil
328
+ def self.from_hash(hash, name='fraudCheck')
329
+ base = hash[name]
330
+ if(base)
331
+ this = FraudCheck.new
332
+ this.authenticationValue = base['authenticationValue']
333
+ this.authenticationTransactionId = base['authenticationTransactionId']
334
+ this.customerIpAddress = base['customerIpAddress']
335
+ this.authenticatedByMerchant = base['authenticatedByMerchant']
336
+ SchemaValidation.validate_length(this.authenticationValue, false, 1, 56, name, "authenticationValue")
337
+ SchemaValidation.validate_length(this.authenticationTransactionId, false, 1, 28, name, "authenticationTransactionId")
338
+ SchemaValidation.validate_regex(this.customerIpAddress, false, /\A(\d{1,3}.){3}\d{1,3}\Z/, name, 'customerIpAddress')
339
+ SchemaValidation.validate_boolean(this.authenticatedByMerchant, false, name, 'authenticatedByMerchant')
340
+ this
341
+ else
342
+ nil
343
+ end
344
+ end
345
+ end
346
+
347
+ class AdvancedFraudResults
348
+ include XML::Mapping
349
+ root_element_name "advanceFraudResults"
350
+ text_node :deviceReviewStatus, "deviceReviewStatus", :default_value=>nil
351
+ text_node :deviceReputationScore, "deviceReputationScore", :default_value=>nil
352
+ array_node :triggeredRule, "", "triggeredRule", :default_value=>[]
353
+ def self.from_hash(hash, name="advancedFraudResults")
354
+ base = hash[name]
355
+ if(base)
356
+ this = AdvancedFraudResults.new
357
+ this.deviceReviewStatus = base['deviceReviewStatus']
358
+ this.deviceReputationScore = base['deviceReputationScore']
359
+ if(base['triggeredRule'])
360
+ base['triggeredRule'].each_index {|index| this.triggeredRule << base['triggeredRule'][index]}
361
+ end
362
+ this
363
+ end
364
+ end
365
+ end
366
+
367
+ class FraudResult
368
+ include XML::Mapping
369
+ text_node :avsResult, "avsResult", :default_value=>nil
370
+ text_node :cardValidationResult, "cardValidationResult", :default_value=>nil
371
+ text_node :authenticationResult, "authenticationResult", :default_value=>nil
372
+ text_node :advancedAVSResult, "advancedAVSResult", :default_value=>nil
373
+ object_node :advancedFraudResults, "advancedFraudResults",:class => AdvancedFraudResults, :default_value=>nil
374
+ def self.from_hash(hash, name='fraudResult')
375
+ base = hash[name]
376
+ if(base)
377
+ this = FraudResult.new
378
+ this.avsResult = base['avsResult']
379
+ this.cardValidationResult = base['cardValidationResult']
380
+ this.authenticationResult = base['authenticationResult']
381
+ this.advancedAVSResult = base['advancedAVSResult']
382
+ this.advancedFraudResults = AdvancedFraudResults.from_hash(base)
383
+ SchemaValidation.validate_length(this.avsResult, false, 1, 2, name, "avsResult")
384
+ SchemaValidation.validate_length(this.authenticationResult, false, 1, 1, name, "authenticationResult")
385
+ SchemaValidation.validate_length(this.advancedAVSResult, false, 1, 3, name, "advancedAVSResult")
386
+ this
387
+ else
388
+ nil
389
+ end
390
+ end
391
+ end
392
+
393
+ class AuthInformation
394
+ include XML::Mapping
395
+ text_node :authDate, "authDate", :default_value=>nil
396
+ text_node :authCode, "authCode", :default_value=>nil
397
+ object_node :fraudResult, "fraudResult", :class=>FraudResult, :default_value=>nil
398
+ text_node :authAmount, "authAmount", :default_value=>nil
399
+ def self.from_hash(hash, name='authInformation')
400
+ base = hash[name]
401
+ if(base)
402
+ this = AuthInformation.new
403
+ this.authDate = base['authDate']
404
+ this.authCode = base['authCode']
405
+ this.fraudResult = FraudResult.from_hash(base)
406
+ this.authAmount = base['authAmount']
407
+ SchemaValidation.validate_date(this.authDate, false, name, 'authDate')
408
+ SchemaValidation.validate_length(this.authCode, false, 1, 6, name, "authCode")
409
+ SchemaValidation.validate_size(this.authAmount, false, -999999999999, 999999999999, name, 'authAmount')
410
+ this
411
+ else
412
+ nil
413
+ end
414
+ end
415
+ end
416
+
417
+ class HealthcareAmounts
418
+ include XML::Mapping
419
+ text_node :totalHealthcareAmount, "totalHealthcareAmount", :default_value=>nil
420
+ text_node :rxAmount, "RxAmount", :default_value=>nil
421
+ text_node :visionAmount, "visionAmount", :default_value=>nil
422
+ text_node :clinicOtherAmount, "clinicOtherAmount", :default_value=>nil
423
+ text_node :dentalAmount, "dentalAmount", :default_value=>nil
424
+ def self.from_hash(hash, name='healthcareAmounts')
425
+ base = hash[name]
426
+ if(base)
427
+ this = HealthcareAmounts.new
428
+ this.totalHealthcareAmount = base['totalHealthcareAmount']
429
+ this.rxAmount = base['RxAmount']
430
+ this.visionAmount = base['visionAmount']
431
+ this.clinicOtherAmount = base['clinicOtherAmount']
432
+ this.dentalAmount = base['dentalAmount']
433
+ SchemaValidation.validate_size(this.totalHealthcareAmount, true, -999999999999, 999999999999, name, 'totalHealthcareAmount')
434
+ SchemaValidation.validate_size(this.rxAmount, false, -999999999999, 999999999999, name, 'RxAmount')
435
+ SchemaValidation.validate_size(this.visionAmount, false, -999999999999, 999999999999, name, 'visionAmount')
436
+ SchemaValidation.validate_size(this.clinicOtherAmount, false, -999999999999, 999999999999, name, 'clinicOtherAmount')
437
+ SchemaValidation.validate_size(this.dentalAmount, false, -999999999999, 999999999999, name, 'dentalAmount')
438
+ this
439
+ else
440
+ nil
441
+ end
442
+ end
443
+ end
444
+
445
+ class HealthcareIIAS
446
+ include XML::Mapping
447
+ object_node :healthcareAmounts, "healthcareAmounts", :class=>HealthcareAmounts, :default_value=>nil
448
+ text_node :iiasFlag, "IIASFlag", :default_value=>nil
449
+ def self.from_hash(hash, name='healthcareIIAS')
450
+ base = hash[name]
451
+ if(base)
452
+ this = HealthcareIIAS.new
453
+ this.healthcareAmounts = HealthcareAmounts.from_hash(base)
454
+ this.iiasFlag = base['IIASFlag']
455
+ SchemaValidation.validate_enum(this.iiasFlag, true, ['Y'], name, 'IIASFlag')
456
+ this
457
+ else
458
+ nil
459
+ end
460
+ end
461
+ end
462
+
463
+ class Pos
464
+ include XML::Mapping
465
+ text_node :capability, "capability", :default_value=>nil
466
+ text_node :entryMode, "entryMode", :default_value=>nil
467
+ text_node :cardholderId, "cardholderId", :default_value=>nil
468
+ text_node :terminalId, "terminalId", :default_value=>nil
469
+ text_node :catLevel, "catLevel", :default_value=>nil
470
+ def self.from_hash(hash, name='pos')
471
+ base = hash[name]
472
+ if(base)
473
+ this = Pos.new
474
+ this.capability = base['capability']
475
+ this.entryMode = base['entryMode']
476
+ this.cardholderId = base['cardholderId']
477
+ this.terminalId = base['terminalId']
478
+ this.catLevel =base['catLevel']
479
+ SchemaValidation.validate_enum(this.capability, true, ['notused','magstripe','keyedonly'], name, 'capability')
480
+ SchemaValidation.validate_enum(this.entryMode, true, ['notused','keyed','track1','track2','completeread'], name, 'entryMode')
481
+ SchemaValidation.validate_enum(this.cardholderId, true, ['signature','pin','nopin','directmarket'], name, 'cardholderId')
482
+ SchemaValidation.validate_enum(this.catLevel, false, ['self service'], name, 'catLevel')
483
+ this
484
+ else
485
+ nil
486
+ end
487
+ end
488
+ end
489
+
490
+ class DetailTax
491
+ include XML::Mapping
492
+ text_node :taxIncludedInTotal, "taxIncludedInTotal", :default_value=>nil
493
+ text_node :taxAmount, "taxAmount", :default_value=>nil
494
+ text_node :taxRate, "taxRate", :default_value=>nil
495
+ text_node :taxTypeIdentifier, "taxTypeIdentifier", :default_value=>nil
496
+ text_node :cardAcceptorTaxId, "cardAcceptorTaxId", :default_value=>nil
497
+ def self.from_hash(hash, index=0, name='detailTax')
498
+ base = hash[name][index]
499
+ if(base)
500
+ this = DetailTax.new
501
+ this.taxIncludedInTotal = base['taxIncludedInTotal']
502
+ this.taxAmount = base['taxAmount']
503
+ this.taxRate = base['taxRate']
504
+ this.taxTypeIdentifier = base['taxTypeIdentifier']
505
+ this.cardAcceptorTaxId = base['cardAcceptorTaxId']
506
+ SchemaValidation.validate_boolean(this.taxIncludedInTotal, false, name, 'taxIncludedInTotal')
507
+ SchemaValidation.validate_size(this.taxAmount, true, -999999999999, 999999999999, name, 'taxAmount')
508
+ SchemaValidation.validate_regex(this.taxRate, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'taxRate')
509
+ SchemaValidation.validate_enum(this.taxTypeIdentifier, false, ['00','01','02','03','04','05','06','10','11','12','13','14','20','21','22'], name, 'taxTypeIdentifier')
510
+ SchemaValidation.validate_length(this.cardAcceptorTaxId, false, 1, 20, name, 'cardAcceptorTaxId')
511
+ this
512
+ else
513
+ nil
514
+ end
515
+ end
516
+ end
517
+
518
+ class LineItemData
519
+ include XML::Mapping
520
+ text_node :itemSequenceNumber, "itemSequenceNumber", :default_value=>nil
521
+ text_node :itemDescription, "itemDescription", :default_value=>nil
522
+ text_node :productCode, "productCode", :default_value=>nil
523
+ text_node :quantity, "quantity", :default_value=>nil
524
+ text_node :unitOfMeasure, "unitOfMeasure", :default_value=>nil
525
+ text_node :taxAmount, "taxAmount", :default_value=>nil
526
+ text_node :lineItemTotal, "lineItemTotal", :default_value=>nil
527
+ text_node :lineItemTotalWithTax, "lineItemTotalWithTax", :default_value=>nil
528
+ text_node :itemDiscountAmount, "itemDiscountAmount", :default_value=>nil
529
+ text_node :commodityCode, "commodityCode", :default_value=>nil
530
+ text_node :unitCost, "unitCost", :default_value=>nil
531
+ array_node :detailTax, "", "detailTax", :class=>DetailTax, :default_value=>[]
532
+ def self.from_hash(hash, index=0, name='lineItemData')
533
+ base = hash[name][index]
534
+ if(base)
535
+ this = LineItemData.new
536
+ this.itemSequenceNumber = base['itemSequenceNumber']
537
+ this.itemDescription = base['itemDescription']
538
+ this.productCode = base['productCode']
539
+ this.quantity = base['quantity']
540
+ this.unitOfMeasure = base['unitOfMeasure']
541
+ this.taxAmount = base['taxAmount']
542
+ this.lineItemTotal = base['lineItemTotal']
543
+ this.lineItemTotalWithTax = base['lineItemTotalWithTax']
544
+ this.itemDiscountAmount = base['itemDiscountAmount']
545
+ this.commodityCode = base['commodityCode']
546
+ this.unitCost = base['unitCost']
547
+ if(base['detailTax'])
548
+ base['detailTax'].each_index {|index| this.detailTax << DetailTax.from_hash(base,index)}
549
+ end
550
+ SchemaValidation.validate_size(this.itemSequenceNumber, false, 1, 99, name, 'itemSequenceNumber')
551
+ SchemaValidation.validate_length(this.itemDescription, true, 1, 26, name, 'itemDescription')
552
+ SchemaValidation.validate_length(this.productCode, false, 1, 12, name, 'productCode')
553
+ SchemaValidation.validate_regex(this.quantity, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'quantity')
554
+ SchemaValidation.validate_length(this.unitOfMeasure, false, 1, 12, name, 'unitOfMeasure')
555
+ SchemaValidation.validate_size(this.taxAmount, false, -999999999999, 999999999999, name, 'taxAmount')
556
+ SchemaValidation.validate_size(this.lineItemTotal, false, -999999999999, 999999999999, name, 'lineItemTotal')
557
+ SchemaValidation.validate_size(this.lineItemTotalWithTax, false, -999999999999, 999999999999, name, 'lineItemTotalWithTax')
558
+ SchemaValidation.validate_size(this.itemDiscountAmount, false, -999999999999, 999999999999, name, 'itemDiscountAmount')
559
+ SchemaValidation.validate_length(this.commodityCode, false, 1, 12, name, 'commodityCode')
560
+ SchemaValidation.validate_regex(this.unitCost, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'unitCost')
561
+ this
562
+ else
563
+ nil
564
+ end
565
+ end
566
+ end
567
+
568
+ class EnhancedData
569
+ include XML::Mapping
570
+ text_node :customerReference, "customerReference", :default_value=>nil
571
+ text_node :salesTax, "salesTax", :default_value=>nil
572
+ text_node :deliveryType, "deliveryType", :default_value=>nil
573
+ text_node :taxExempt, "taxExempt", :default_value=>nil
574
+ text_node :discountAmount, "discountAmount", :default_value=>nil
575
+ text_node :shippingAmount, "shippingAmount", :default_value=>nil
576
+ text_node :dutyAmount, "dutyAmount", :default_value=>nil
577
+ text_node :shipFromPostalCode, "shipFromPostalCode", :default_value=>nil
578
+ text_node :destinationPostalCode, "destinationPostalCode", :default_value=>nil
579
+ text_node :destinationCountryCode, "destinationCountryCode", :default_value=>nil
580
+ text_node :invoiceReferenceNumber, "invoiceReferenceNumber", :default_value=>nil
581
+ text_node :orderDate, "orderDate", :default_value=>nil
582
+ array_node :detailTax, "", "detailTax", :class=>DetailTax, :default_value=>[]
583
+ array_node :lineItemData, "", "lineItemData", :class=>LineItemData, :default_value=>[]
584
+ def self.from_hash(hash, name='enhancedData')
585
+ base = hash[name]
586
+ if(base)
587
+ this = EnhancedData.new
588
+ this.customerReference = base['customerReference']
589
+ this.salesTax = base['salesTax']
590
+ this.deliveryType = base['deliveryType']
591
+ this.taxExempt = base['taxExempt']
592
+ this.discountAmount = base['discountAmount']
593
+ this.shippingAmount = base['shippingAmount']
594
+ this.dutyAmount = base['dutyAmount']
595
+ this.shipFromPostalCode = base['shipFromPostalCode']
596
+ this.destinationPostalCode = base['destinationPostalCode']
597
+ this.destinationCountryCode = base['destinationCountryCode']
598
+ this.invoiceReferenceNumber = base['invoiceReferenceNumber']
599
+ this.orderDate = base['orderDate']
600
+ if(base['detailTax'])
601
+ base['detailTax'].each_index {|index| this.detailTax << DetailTax.from_hash(base,index)}
602
+ end
603
+ if(base['lineItemData'])
604
+ base['lineItemData'].each_index {|index| this.lineItemData << LineItemData.from_hash(base,index)}
605
+ end
606
+ SchemaValidation.validate_length(this.customerReference, false, 1, 17, name, 'customerReference')
607
+ SchemaValidation.validate_size(this.salesTax, false, -999999999999, 999999999999, name, 'salesTax')
608
+ SchemaValidation.validate_enum(this.deliveryType, false, ['CNC','DIG','PHY','SVC','TBD'], name, 'deliveryType')
609
+ SchemaValidation.validate_boolean(this.taxExempt, false, name, 'taxExempt')
610
+ SchemaValidation.validate_size(this.discountAmount, false, -999999999999, 999999999999, name, 'discountAmount')
611
+ SchemaValidation.validate_size(this.shippingAmount, false, -999999999999, 999999999999, name, 'shippingAmount')
612
+ SchemaValidation.validate_size(this.dutyAmount, false, -999999999999, 999999999999, name, 'dutyAmount')
613
+ SchemaValidation.validate_length(this.shipFromPostalCode, false, 1, 20, name, 'shipFromPostalCode')
614
+ SchemaValidation.validate_length(this.destinationPostalCode, false, 1, 20, name, 'destinationPostalCode')
615
+ SchemaValidation.validate_country(this.destinationCountryCode, name, 'destinationCountryCode')
616
+ SchemaValidation.validate_length(this.invoiceReferenceNumber, false, 1, 15, name, 'invoiceReferenceNumber')
617
+ SchemaValidation.validate_date(this.orderDate, false, name, 'orderDate')
618
+ this
619
+ else
620
+ nil
621
+ end
622
+ end
623
+ end
624
+
625
+ class AmexAggregatorData
626
+ include XML::Mapping
627
+ text_node :sellerId, "sellerId", :default_value=>nil
628
+ text_node :sellerMerchantCategoryCode, "sellerMerchantCategoryCode", :default_value=>nil
629
+ def self.from_hash(hash, name='amexAggregatorData')
630
+ base = hash[name]
631
+ if(base)
632
+ this = AmexAggregatorData.new
633
+ this.sellerId = base['sellerId']
634
+ this.sellerMerchantCategoryCode = base['sellerMerchantCategoryCode']
635
+ SchemaValidation.validate_length(this.sellerId, false, 1, 16, name, 'sellerId')
636
+ SchemaValidation.validate_length(this.sellerMerchantCategoryCode, false, 1, 4, name, 'sellerMerchantCategoryCode')
637
+ this
638
+ else
639
+ nil
640
+ end
641
+ end
642
+ end
643
+
644
+ class Card
645
+ include XML::Mapping
646
+ text_node :mop, "type", :default_value=>nil
647
+ text_node :track, "track", :default_value=>nil
648
+ text_node :number, "number", :default_value=>nil
649
+ text_node :expDate, "expDate", :default_value=>nil
650
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
651
+ text_node :pin, "pin", :default_value=>nil
652
+ def self.from_hash(hash, name='card')
653
+ base = hash[name]
654
+ if(base)
655
+ this = Card.new
656
+ this.mop = base['type']
657
+ this.track = base['track']
658
+ this.number = base['number']
659
+ this.expDate = base['expDate']
660
+ this.cardValidationNum = base['cardValidationNum']
661
+ this.pin = base['pin']
662
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC','GC'], name, 'type')
663
+ SchemaValidation.validate_length(this.track, false, 1, 256, name, 'track')
664
+ SchemaValidation.validate_length(this.number, false, 13, 25, name, 'number')
665
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
666
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
667
+ SchemaValidation.validate_length(this.pin, false, 4, 12, name, 'pin')
668
+ this
669
+ else
670
+ nil
671
+ end
672
+ end
673
+ end
674
+
675
+ class ApplepayHeader
676
+ include XML::Mapping
677
+ text_node :applicationData, "applicationData", :default_value=>nil
678
+ text_node :ephemeralPublicKey, "ephemeralPublicKey", :default_value=>nil
679
+ text_node :publicKeyHash, "publicKeyHash", :default_value=>nil
680
+ text_node :transactionId, "transactionId", :default_value=>nil
681
+ def self.from_hash(hash, name='header')
682
+ base = hash[name]
683
+ if(base)
684
+ this = ApplepayHeader.new
685
+ this.applicationData = base['applicationData']
686
+ this.ephemeralPublicKey = base['ephemeralPublicKey']
687
+ this.publicKeyHash = base['publicKeyHash']
688
+ this.transactionId = base['transactionId']
689
+ SchemaValidation.validate_required(this.applicationData,true,name,'applicationData')
690
+ SchemaValidation.validate_required(this.ephemeralPublicKey,true,name,'ephemeralPublicKey')
691
+ SchemaValidation.validate_required(this.publicKeyHash,true,name,'publicKeyHash')
692
+ SchemaValidation.validate_required(this.transactionId,true,name,'transactionId')
693
+ #01.28.2016
694
+ SchemaValidation.validate_length(this.applicationData, true, 1, 10000 , name, 'applicationData')
695
+ SchemaValidation.validate_length(this.ephemeralPublicKey, true, 1, 400 , name, 'ephemeralPublicKey')
696
+ SchemaValidation.validate_length(this.publicKeyHash, true, 1, 200 , name, 'publicKeyHash')
697
+ SchemaValidation.validate_length(this.transactionId, true, 1, 250 , name, 'transactionId')
698
+ #01.28.2016
699
+ this
700
+ else
701
+ nil
702
+ end
703
+ end
704
+ end
705
+
706
+ class Applepay
707
+ include XML::Mapping
708
+ text_node :data, "data", :default_value=>nil
709
+ object_node :header, "header", :class=>ApplepayHeader, :default_value=>nil
710
+ text_node :signature, "signature", :default_value=>nil
711
+ text_node :version, "version", :default_value=>nil
712
+ def self.from_hash(hash, name='applepay')
713
+ base = hash[name]
714
+ if(base)
715
+ this = Applepay.new
716
+ this.data = base['data']
717
+ this.header = ApplepayHeader.from_hash(base)
718
+ this.signature = base['signature']
719
+ this.version = base['version']
720
+ SchemaValidation.validate_required(this.data,true,name,'data')
721
+ SchemaValidation.validate_required(this.header,true,name,'header')
722
+ SchemaValidation.validate_required(this.signature,true,name,'signature')
723
+ SchemaValidation.validate_required(this.version,true,name,'version')
724
+ #01.28.2016
725
+ SchemaValidation.validate_length(this.data, true, 1, 2000 , name, 'data')
726
+ SchemaValidation.validate_length(this.signature, true, 1, 10000 , name, 'signature')
727
+ SchemaValidation.validate_length(this.version, true, 5, 20 , name, 'version')
728
+ #01.28.2016
729
+ this
730
+ else
731
+ nil
732
+ end
733
+ end
734
+ end
735
+
736
+ class Mpos
737
+ include XML::Mapping
738
+ text_node :ksn, "ksn", :default_value=>nil
739
+ text_node :formatId, "formatId", :default_value=>nil
740
+ text_node :encryptedTrack, "encryptedTrack", :default_value=>nil
741
+ text_node :track1Status,"track1Status", :default_value=>nil
742
+ text_node :track2Status,"track2Status", :default_value=>nil
743
+ def self.from_hash(hash, name='mpos')
744
+ base = hash[name]
745
+ if(base)
746
+ this = Mpos.new
747
+ this.ksn = base['ksn']
748
+ this.formatId = base['formatId']
749
+ this.encryptedTrack = base['encryptedTrack']
750
+ this.track1Status = base['track1Status']
751
+ this.track2Status = base['track2Status']
752
+ SchemaValidation.validate_length(this.ksn, true, 1, 1028 , name, 'ksn')
753
+ SchemaValidation.validate_length(this.formatId, true, 1, 1028, name, 'formatId')
754
+ SchemaValidation.validate_length(this.encryptedTrack, true, 1, 1028, name, 'encryptedTrack')
755
+ SchemaValidation.validate_size(this.track1Status, true, 0, 1028, name, 'track1Status')
756
+ SchemaValidation.validate_size(this.track2Status, true, 0, 1028, name, 'track2Status')
757
+ this
758
+ end
759
+ end
760
+ end
761
+
762
+ #XML 12.0
763
+ class SepaDirectDebit
764
+ include XML::Mapping
765
+ text_node :mandateProvider, "mandateProvider", :default_value=>nil
766
+ text_node :sequenceType, "sequenceType", :default_value=>nil
767
+ text_node :mandateReference, "mandateReference", :default_value=>nil
768
+ text_node :mandateURL, "mandateURL", :default_value=>nil
769
+ text_node :mandateSignatureDate, "mandateSignatureDate", :default_value=>nil
770
+ text_node :iban, "iban", :default_value=>nil
771
+ text_node :preferredLanguage, "preferredLanguage", :default_value=>nil
772
+ def self.from_hash(hash, name='sepaDirectDebit')
773
+ base = hash[name]
774
+ if(base)
775
+ this = SepaDirectDebit.new
776
+ this.iban = base['iban']
777
+ this.mandateProvider = base['mandateProvider']
778
+ this.sequenceType = base['sequenceType']
779
+ this.mandateReference = base['mandateReference']
780
+ this.mandateURL = base['mandateURL']
781
+ this.mandateSignatureDate = base['mandateSignatureDate']
782
+ this.preferredLanguage = base['preferredLanguage']
783
+ SchemaValidation.validate_required(this.iban, true, name, 'iban')
784
+ SchemaValidation.validate_required(this.mandateProvider, true, name, 'mandateProvider')
785
+ SchemaValidation.validate_required(this.sequenceType, true, name, 'sequenceType')
786
+ SchemaValidation.validate_length(this.iban, true, 15, 34 , name, 'iban')
787
+ SchemaValidation.validate_enum(this.mandateProvider, true, ['Merchant','Vantiv'], name, 'mandateProvider')
788
+ SchemaValidation.validate_enum(this.sequenceType, true, ['OneTime','FirstRecurring','SubsequentRecurring','FinalRecurring'], name, 'sequenceType')
789
+ SchemaValidation.validate_length(this.mandateReference, false, 0,256, name, 'mandateReference')
790
+ SchemaValidation.validate_regex(this.mandateURL, false, /\A([A-Z,a-z,0-9,\/,\-,_,.]){1,13}\Z/, name, 'mandateURL')
791
+ SchemaValidation.validate_date(this.mandateSignatureDate, false,name, 'mandateSignatureDate')
792
+ SchemaValidation.validate_length(this.preferredLanguage, false,3,3, name, 'preferredLanguage')
793
+ this
794
+ end
795
+ end
796
+ end
797
+
798
+ class CardToken
799
+ include XML::Mapping
800
+
801
+ optional_choice_node :if, 'cnpToken', :then, (text_node :cnpToken, "cnpToken", :default_value=>nil),
802
+ :elsif, 'tokenURL', :then, (text_node :tokenURL, "tokenURL", :default_value=>nil)
803
+ text_node :expDate, "expDate", :default_value=>nil
804
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
805
+ text_node :mop, "type", :default_value=>nil
806
+ def self.from_hash(hash, name='cardToken')
807
+ base = hash[name]
808
+ if(base)
809
+ this = CardToken.new
810
+ this.cnpToken = base['cnpToken']
811
+ this.tokenURL = base['tokenURL']
812
+ this.expDate = base['expDate']
813
+ this.cardValidationNum = base['cardValidationNum']
814
+ this.mop = base['type']
815
+
816
+ if (this.cnpToken == nil && this.tokenURL == nil)
817
+ raise raise "If " + name + " is specified, it must have a cnpToken"
818
+ elsif (this.cnpToken != nil)
819
+ SchemaValidation.validate_length(this.cnpToken, true, 13, 25, name, 'cnpToken')
820
+ elsif (this.tokenURL != nil)
821
+ SchemaValidation.validate_regex(this.tokenURL, false, /http.?:\/\/.*\/.*/, name, 'tokenURL')
822
+ end
823
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
824
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
825
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
826
+ this
827
+ else
828
+ nil
829
+ end
830
+ end
831
+ end
832
+
833
+ class CardPaypage
834
+ include XML::Mapping
835
+ text_node :paypageRegistrationId, "paypageRegistrationId", :default_value=>nil
836
+ text_node :expDate, "expDate", :default_value=>nil
837
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
838
+ text_node :mop, "type", :default_value=>nil
839
+ def self.from_hash(hash, name='cardPaypage')
840
+ base = hash[name]
841
+ if(base)
842
+ this = CardPaypage.new
843
+ this.paypageRegistrationId = base['paypageRegistrationId']
844
+ this.expDate = base['expDate']
845
+ this.cardValidationNum = base['cardValidationNum']
846
+ this.mop = base['type']
847
+ SchemaValidation.validate_length(this.paypageRegistrationId, true, 1, 512, name, 'paypageRegistrationId')
848
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
849
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
850
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
851
+ this
852
+ else
853
+ nil
854
+ end
855
+ end
856
+ end
857
+
858
+ class PayPal
859
+ include XML::Mapping
860
+ text_node :payerId, "payerId", :default_value=>nil
861
+ text_node :token, "token", :default_value=>nil
862
+ text_node :transactionId, "transactionId", :default_value=>nil
863
+ def self.from_hash(hash, name='payPal')
864
+ base = hash[name]
865
+ if(base)
866
+ this = PayPal.new
867
+ this.payerId = base['payerId']
868
+ this.token = base['token']
869
+ this.transactionId = base['transactionId']
870
+ SchemaValidation.validate_required(this.payerId, true, name, 'payerId')
871
+ SchemaValidation.validate_required(this.transactionId, true, name, 'transactionId')
872
+ this
873
+ else
874
+ nil
875
+ end
876
+ end
877
+ end
878
+
879
+ class CreditPayPal
880
+ include XML::Mapping
881
+ text_node :payerId, "payerId", :default_value=>nil
882
+ text_node :payerEmail, "payerEmail", :default_value=>nil
883
+ def self.from_hash(hash, name='creditPaypal')
884
+ base = hash[name]
885
+ if(base)
886
+ this = CreditPayPal.new
887
+ this.payerId = base['payerId']
888
+ this.payerEmail = base['payerEmail']
889
+ SchemaValidation.validate_length(this.payerId, false, 1, 17, name, 'payerId')
890
+ SchemaValidation.validate_length(this.payerEmail, false, 1, 127, name, 'payerEmail')
891
+ this
892
+ else
893
+ nil
894
+ end
895
+ end
896
+ end
897
+
898
+ class CustomBilling
899
+ include XML::Mapping
900
+ optional_choice_node :if, 'phone', :then, (text_node :phone, "phone", :default_value=>nil),
901
+ :elsif, 'city', :then, (text_node :city, "city", :default_value=>nil),
902
+ :elsif, 'url', :then, (text_node :url, "url", :default_value=>nil)
903
+ text_node :descriptor, "descriptor", :default_value=>nil
904
+ def self.from_hash(hash, name='customBilling')
905
+ base = hash[name]
906
+ if(base)
907
+ this = CustomBilling.new
908
+ this.phone = base['phone']
909
+ this.city = base['city']
910
+ this.url = base['url']
911
+ this.descriptor = base['descriptor']
912
+ SchemaValidation.validate_regex(this.phone, false, /\A\d{1,13}\Z/, name, 'phone')
913
+ SchemaValidation.validate_length(this.city, false, 1, 35, name, 'city')
914
+ SchemaValidation.validate_regex(this.url, false, /\A([A-Z,a-z,0-9,\/,\-,_,.]){1,13}\Z/, name, 'url')
915
+ SchemaValidation.validate_regex(this.descriptor, false, /\A([A-Z,a-z,0-9, ,\*,,,\-,',#,&,.]){4,25}\Z/, name, 'descriptor')
916
+ this
917
+ else
918
+ nil
919
+ end
920
+ end
921
+ end
922
+
923
+ class ProcessingInstructions
924
+ include XML::Mapping
925
+ text_node :bypassVelocityCheck, "bypassVelocityCheck", :default_value=>nil
926
+ def self.from_hash(hash, name='processingInstructions')
927
+ base = hash[name]
928
+ if(base)
929
+ this = ProcessingInstructions.new
930
+ this.bypassVelocityCheck = base['bypassVelocityCheck']
931
+ SchemaValidation.validate_boolean(this.bypassVelocityCheck, false, name, 'bypassVelocityCheck')
932
+ this
933
+ else
934
+ nil
935
+ end
936
+ end
937
+ end
938
+
939
+ class EcheckForToken
940
+ include XML::Mapping
941
+ text_node :accNum, "accNum", :default_value=>nil
942
+ text_node :routingNum, "routingNum", :default_value=>nil
943
+ def self.from_hash(hash, name='echeckForToken')
944
+ base = hash[name]
945
+ if(base)
946
+ this = EcheckForToken.new
947
+ this.accNum = base['accNum']
948
+ this.routingNum = base['routingNum']
949
+ SchemaValidation.validate_length(this.accNum, true, 1, 17, name, 'accNum')
950
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
951
+ this
952
+ else
953
+ nil
954
+ end
955
+ end
956
+ end
957
+
958
+ class Filtering
959
+ include XML::Mapping
960
+ text_node :prepaid, "prepaid", :default_value=>nil
961
+ text_node :international, "international", :default_value=>nil
962
+ text_node :chargeback, "chargeback", :default_value=>nil
963
+ def self.from_hash(hash, name='filtering')
964
+ base = hash[name]
965
+ if(base)
966
+ this = Filtering.new
967
+ this.prepaid = base['prepaid']
968
+ this.international = base['international']
969
+ this.chargeback = base['chargeback']
970
+ SchemaValidation.validate_boolean(this.prepaid, false, name, 'prepaid')
971
+ SchemaValidation.validate_boolean(this.international, false, name, 'international')
972
+ SchemaValidation.validate_boolean(this.chargeback, false, name, 'chargeback')
973
+ this
974
+ else
975
+ nil
976
+ end
977
+ end
978
+ end
979
+
980
+ class MerchantData
981
+ include XML::Mapping
982
+ text_node :campaign, "campaign", :default_value=>nil
983
+ text_node :affiliate, "affiliate", :default_value=>nil
984
+ text_node :merchantGroupingId, "merchantGroupingId", :default_value=>nil
985
+ def self.from_hash(hash, name='merchantData')
986
+ base = hash[name]
987
+ if(base)
988
+ this = MerchantData.new
989
+ this.campaign = base['campaign']
990
+ this.affiliate = base['affiliate']
991
+ this.merchantGroupingId = base['merchantGroupingId']
992
+ SchemaValidation.validate_length(this.campaign, false, 1, 25, name, 'campaign')
993
+ SchemaValidation.validate_length(this.affiliate, false, 1, 25, name, 'affiliate')
994
+ SchemaValidation.validate_length(this.merchantGroupingId, false, 1, 25, name, 'merchantGroupingId')
995
+ this
996
+ else
997
+ nil
998
+ end
999
+ end
1000
+ end
1001
+
1002
+ class Echeck
1003
+ include XML::Mapping
1004
+ text_node :accType, "accType", :default_value=>nil
1005
+ text_node :accNum, "accNum", :default_value=>nil
1006
+ text_node :routingNum, "routingNum", :default_value=>nil
1007
+ text_node :checkNum, "checkNum", :default_value=>nil
1008
+ text_node :ccdPaymentInformation, "ccdPaymentInformation", :default_value=>nil
1009
+ def self.from_hash(hash, name='echeck')
1010
+ base = hash[name]
1011
+ if(base)
1012
+ this = Echeck.new
1013
+ this.accType = base['accType']
1014
+ this.accNum = base['accNum']
1015
+ this.routingNum = base['routingNum']
1016
+ this.checkNum = base['checkNum']
1017
+ this.ccdPaymentInformation = base['ccdPaymentInformation']
1018
+ SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
1019
+ SchemaValidation.validate_length(this.accNum, true, 1, 17, name, 'accNum')
1020
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
1021
+ SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
1022
+ SchemaValidation.validate_length(this.ccdPaymentInformation, false, 1, 80, name, 'ccdPaymentInformation')
1023
+ this
1024
+ else
1025
+ nil
1026
+ end
1027
+ end
1028
+ end
1029
+
1030
+ class EcheckCtx
1031
+ include XML::Mapping
1032
+ text_node :accType, "accType", :default_value=>nil
1033
+ text_node :accNum, "accNum", :default_value=>nil
1034
+ text_node :routingNum, "routingNum", :default_value=>nil
1035
+ text_node :checkNum, "checkNum", :default_value=>nil
1036
+ text_node :ccdPaymentInformation, "ccdPaymentInformation", :default_value=>nil
1037
+ text_node :ctxPaymentInformation, "ctxPaymentInformation", :default_value=>nil
1038
+ def self.from_hash(hash, name='echeckCtx')
1039
+ base = hash[name]
1040
+ if(base)
1041
+ this = EcheckCtx.new
1042
+ this.accType = base['accType']
1043
+ this.accNum = base['accNum']
1044
+ this.routingNum = base['routingNum']
1045
+ this.checkNum = base['checkNum']
1046
+ this.ccdPaymentInformation = base['ccdPaymentInformation']
1047
+ this.ctxPaymentInformation = base['ctxPaymentInformation']
1048
+ SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
1049
+ SchemaValidation.validate_length(this.accNum, true, 1, 17, name, 'accNum')
1050
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
1051
+ SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
1052
+ SchemaValidation.validate_length(this.ccdPaymentInformation, false, 1, 80, name, 'ccdPaymentInformation')
1053
+ SchemaValidation.validate_length(this.ctxPaymentInformation, false, 1, 80, name, 'ctxPaymentInformation')
1054
+ this
1055
+ else
1056
+ nil
1057
+ end
1058
+ end
1059
+ end
1060
+
1061
+ class EcheckToken
1062
+ include XML::Mapping
1063
+ text_node :cnpToken, "cnpToken", :default_value=>nil
1064
+ text_node :routingNum, "routingNum", :default_value=>nil
1065
+ text_node :accType, "accType", :default_value=>nil
1066
+ text_node :checkNum, "checkNum", :default_value=>nil
1067
+ def self.from_hash(hash, name='echeckToken')
1068
+ base = hash[name]
1069
+ if(base)
1070
+ this = EcheckToken.new
1071
+ this.cnpToken = base['cnpToken']
1072
+ this.routingNum = base['routingNum']
1073
+ this.accType = base['accType']
1074
+ this.checkNum = base['checkNum']
1075
+ SchemaValidation.validate_length(this.cnpToken, true, 13, 25, name, 'cnpToken')
1076
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
1077
+ SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
1078
+ SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
1079
+ this
1080
+ else
1081
+ nil
1082
+ end
1083
+ end
1084
+ end
1085
+
1086
+ class RecyclingRequest
1087
+ include XML::Mapping
1088
+ text_node :recycleBy, "recycleBy", :default_value=>nil
1089
+ text_node :recycleId, "recycleId", :default_value=>nil
1090
+ def self.from_hash(hash, name='recyclingRequest')
1091
+ base = hash[name]
1092
+ if(base)
1093
+ this = RecyclingRequest.new
1094
+ this.recycleBy = base['recycleBy']
1095
+ this.recycleId = base['recycleId']
1096
+ SchemaValidation.validate_enum(this.recycleBy, false, ['Merchant','Cnp','None'], name, 'recycleBy')
1097
+ SchemaValidation.validate_length(this.recycleId, false, 1, 25, name, 'recycleId')
1098
+ this
1099
+ else
1100
+ nil
1101
+ end
1102
+ end
1103
+ end
1104
+
1105
+ class CreateDiscount
1106
+ include XML::Mapping
1107
+ text_node :discountCode, "discountCode", :default_value=>nil
1108
+ text_node :name, "name", :default_value=>nil
1109
+ text_node :amount, "amount", :default_value=>nil
1110
+ text_node :startDate, "startDate", :default_value=>nil
1111
+ text_node :endDate, "endDate", :default_value=>nil
1112
+ def self.from_hash(hash,index=0, name="createDiscount")
1113
+ base = hash[name][index]
1114
+ if(base)
1115
+ this = CreateDiscount.new
1116
+ this.discountCode = base['discountCode']
1117
+ this.name = base['name']
1118
+ this.amount = base['amount']
1119
+ this.startDate = base['startDate']
1120
+ this.endDate = base['endDate']
1121
+ SchemaValidation.validate_length(this.discountCode, true, 1, 25, name, 'discountCode')
1122
+ SchemaValidation.validate_length(this.name, true, 1, 100, name, "name")
1123
+ SchemaValidation.validate_size(this.amount,true,0,999999999999,name,'amount')
1124
+ SchemaValidation.validate_date(this.startDate, true, name, 'startDate')
1125
+ SchemaValidation.validate_date(this.endDate, true, name, 'endDate')
1126
+ this
1127
+ end
1128
+ end
1129
+ end
1130
+
1131
+ class CreateAddOn
1132
+ include XML::Mapping
1133
+ text_node :addOnCode, "addOnCode", :default_value=>nil
1134
+ text_node :name, "name", :default_value=>nil
1135
+ text_node :amount, "amount", :default_value=>nil
1136
+ text_node :startDate, "startDate", :default_value=>nil
1137
+ text_node :endDate, "endDate", :default_value=>nil
1138
+ def self.from_hash(hash,index=0, name="createAddOn")
1139
+ base = hash[name][index]
1140
+ if(base)
1141
+ this = CreateAddOn.new
1142
+ this.addOnCode = base['addOnCode']
1143
+ this.name = base['name']
1144
+ this.amount = base['amount']
1145
+ this.startDate = base['startDate']
1146
+ this.endDate = base['endDate']
1147
+ SchemaValidation.validate_length(this.addOnCode, true, 1, 25, name, 'addOnCode')
1148
+ SchemaValidation.validate_length(this.name, true, 1, 100, name, "name")
1149
+ SchemaValidation.validate_size(this.amount,true,0,999999999999,name,'amount')
1150
+ SchemaValidation.validate_date(this.startDate, true, name, 'startDate')
1151
+ SchemaValidation.validate_date(this.endDate, true, name, 'endDate')
1152
+ this
1153
+ end
1154
+ end
1155
+ end
1156
+
1157
+ class Subscription
1158
+ include XML::Mapping
1159
+ text_node :planCode, "planCode", :default_value=>nil
1160
+ text_node :numberOfPayments, "numberOfPayments", :default_value=>nil
1161
+ text_node :startDate,"startDate",:default_value=>nil
1162
+ text_node :amount,"amount",:default_value=>nil
1163
+ array_node :createDiscount, "", "createDiscount", :class=>CreateDiscount, :default_value=>[]
1164
+ array_node :createAddOn, "", "createAddOn", :class=>CreateAddOn, :default_value=>[]
1165
+ def self.from_hash(hash, name="subscription")
1166
+ base = hash[name]
1167
+ if(base)
1168
+ this = Subscription.new
1169
+ this.planCode = base['planCode']
1170
+ this.numberOfPayments = base['numberOfPayments']
1171
+ this.startDate = base['startDate']
1172
+ this.amount = base['amount']
1173
+ if(base['createDiscount'])
1174
+ base['createDiscount'].each_index {|index| this.createDiscount << CreateDiscount.from_hash(base,index)}
1175
+ end
1176
+
1177
+ if(base['createAddOn'])
1178
+ base['createAddOn'].each_index {|index| this.createAddOn << CreateAddOn.from_hash(base,index)}
1179
+ end
1180
+ SchemaValidation.validate_length(this.planCode, true, 1, 25, name, 'planCode')
1181
+ SchemaValidation.validate_size(this.numberOfPayments, false, 1, 99, name, 'numberOfPayments')
1182
+ SchemaValidation.validate_date(this.startDate,false,name,'startDate')
1183
+ SchemaValidation.validate_size(this.amount,false,0,999999999999,name,'amount')
1184
+ this
1185
+ end
1186
+ end
1187
+ end
1188
+
1189
+ class RecurringRequest
1190
+ include XML::Mapping
1191
+ object_node :subscription, "subscription", :class=>Subscription, :default_value=>nil
1192
+ def self.from_hash(hash, name="recurringRequest")
1193
+ base = hash[name]
1194
+ if(base)
1195
+ this = RecurringRequest.new
1196
+ this.subscription = Subscription.from_hash(base)
1197
+ this
1198
+ end
1199
+ end
1200
+ end
1201
+
1202
+ class CnpInternalRecurringRequest
1203
+ include XML::Mapping
1204
+ text_node :subscriptionId, "subscriptionId", :default_value=>nil
1205
+ text_node :recurringTxnId, "recurringTxnId", :default_value=>nil
1206
+ text_node :finalPayment, "finalPayment", :default_value=>nil
1207
+ def self.from_hash(hash, name="cnpInternalRecurringRequest")
1208
+ base = hash[name]
1209
+ if(base)
1210
+ this = CnpInternalRecurringRequest.new
1211
+ this.subscriptionId = base['subscriptionId']
1212
+ this.recurringTxnId = base['recurringTxnId']
1213
+ this.finalPayment = base['finalPayment']
1214
+ SchemaValidation.validate_length(this.subscriptionId, true, 19, 19, name, "subscriptionId")
1215
+ SchemaValidation.validate_length(this.recurringTxnId, true, 19, 19, name, "recurringTxnId")
1216
+ SchemaValidation.validate_boolean(this.finalPayment, true, name, "finalPayment")
1217
+ this
1218
+ end
1219
+ end
1220
+ end
1221
+
1222
+ class UpdateDiscount
1223
+ include XML::Mapping
1224
+ text_node :discountCode, "discountCode", :default_value=>nil
1225
+ text_node :name, "name", :default_value=>nil
1226
+ text_node :amount, "amount", :default_value=>nil
1227
+ text_node :startDate, "startDate", :default_value=>nil
1228
+ text_node :endDate, "endDate", :default_value=>nil
1229
+ def self.from_hash(hash,index=0, name="updateDiscount")
1230
+ base = hash[name][index]
1231
+ if(base)
1232
+ this = UpdateDiscount.new
1233
+ this.discountCode = base['discountCode']
1234
+ this.name = base['name']
1235
+ this.amount = base['amount']
1236
+ this.startDate = base['startDate']
1237
+ this.endDate = base['endDate']
1238
+ SchemaValidation.validate_length(this.discountCode, true, 1, 25, name, 'discountCode')
1239
+ SchemaValidation.validate_length(this.name, false, 1, 100, name, "name")
1240
+ SchemaValidation.validate_size(this.amount,false,0,999999999999,name,'amount')
1241
+ SchemaValidation.validate_date(this.startDate, false, name, 'startDate')
1242
+ SchemaValidation.validate_date(this.endDate, false, name, 'endDate')
1243
+ this
1244
+ end
1245
+ end
1246
+ end
1247
+
1248
+ class DeleteDiscount
1249
+ include XML::Mapping
1250
+ text_node :discountCode, "discountCode", :default_value=>nil
1251
+ def self.from_hash(hash,index=0, name="deleteDiscount")
1252
+ base = hash[name][index]
1253
+ if(base)
1254
+ this = DeleteDiscount.new
1255
+ this.discountCode = base['discountCode']
1256
+ SchemaValidation.validate_length(this.discountCode, true, 1, 25, name, 'discountCode')
1257
+ this
1258
+ end
1259
+ end
1260
+ end
1261
+
1262
+ class DeleteAddOn
1263
+ include XML::Mapping
1264
+ text_node :addOnCode, "addOnCode", :default_value=>nil
1265
+ def self.from_hash(hash,index=0, name="updateDiscount")
1266
+ base = hash[name][index]
1267
+ if(base)
1268
+ this = DeleteAddOn.new
1269
+ this.addOnCode = base['addOnCode']
1270
+ SchemaValidation.validate_length(this.addOnCode, true, 1, 25, name, 'addOnCode')
1271
+ this
1272
+ end
1273
+ end
1274
+ end
1275
+
1276
+ class UpdateAddOn
1277
+ include XML::Mapping
1278
+ text_node :addOnCode, "addOnCode", :default_value=>nil
1279
+ text_node :name, "name", :default_value=>nil
1280
+ text_node :amount, "amount", :default_value=>nil
1281
+ text_node :startDate, "startDate", :default_value=>nil
1282
+ text_node :endDate, "endDate", :default_value=>nil
1283
+ def self.from_hash(hash,index=0, name="updateAddOn")
1284
+ base = hash[name][index]
1285
+ if(base)
1286
+ this = UpdateAddOn.new
1287
+ this.addOnCode = base['addOnCode']
1288
+ this.name = base['name']
1289
+ this.amount = base['amount']
1290
+ this.startDate = base['startDate']
1291
+ this.endDate = base['endDate']
1292
+ SchemaValidation.validate_length(this.addOnCode, true, 1, 25, name, 'addOnCode')
1293
+ SchemaValidation.validate_length(this.name, false, 1, 100, name, "name")
1294
+ SchemaValidation.validate_size(this.amount,false,0,999999999999,name,'amount')
1295
+ SchemaValidation.validate_date(this.startDate, false, name, 'startDate')
1296
+ SchemaValidation.validate_date(this.endDate, false, name, 'endDate')
1297
+ this
1298
+ end
1299
+ end
1300
+ end
1301
+
1302
+ class CancelSubscription
1303
+ include XML::Mapping
1304
+ root_element_name "cancelSubscription"
1305
+ text_node :subscriptionId, "subscriptionId", :default_value=>nil
1306
+ end
1307
+
1308
+ class UpdateSubscription
1309
+ include XML::Mapping
1310
+ root_element_name "updateSubscription"
1311
+ text_node :subscriptionId, "subscriptionId", :default_value=>nil
1312
+ text_node :planCode,"planCode",:default_value=>nil
1313
+ object_node :billToAddress , 'billToAddress', :class=>Contact, :default_value=>nil
1314
+ #object_node :card,'card',:class=>Card, :default_value=>nil
1315
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card, :default_value=>nil),
1316
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken, :default_value=>nil),
1317
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage, :default_value=>nil)
1318
+ text_node :billingDate,'billingDate', :default_value=>nil
1319
+ array_node :createDiscount, "", "createDiscount", :class=>CreateDiscount, :default_value=>[]
1320
+ array_node :updateDiscount, "", "updateDiscount", :class=>UpdateDiscount, :default_value=>[]
1321
+ array_node :deleteDiscount, "", "deleteDiscount", :class=>DeleteDiscount,:default_value=>[]
1322
+ array_node :createAddOn, "", "createAddOn", :class=>CreateAddOn, :default_value=>[]
1323
+ array_node :updateAddOn, "", "updateAddOn", :class=>UpdateAddOn, :default_value=>[]
1324
+ array_node :deleteAddOn, "", "deleteAddOn", :class=>DeleteAddOn, :default_value=>[]
1325
+ end
1326
+
1327
+ class CreatePlan
1328
+ include XML::Mapping
1329
+ root_element_name "createPlan"
1330
+ text_node :planCode,"planCode",:default_value=>nil
1331
+ text_node :name, "name", :default_value=>nil
1332
+ text_node :description, "description", :default_value=>nil
1333
+ text_node :intervalType, "intervalType", :defaul_value=>nil
1334
+ text_node :amount, "amount", :default_value=>nil
1335
+ text_node :numberOfPayments, "numberOfPayments", :default_value=>nil
1336
+ text_node :trialNumberOfIntervals,"trialNumberOfIntervals", :default_value=>nil
1337
+ text_node :trialIntervalType,"trialIntervalType", :default_value=>nil
1338
+ text_node :active,"active", :default_value=>nil
1339
+ end
1340
+
1341
+ class UpdatePlan
1342
+ include XML::Mapping
1343
+ root_element_name "updatePlan"
1344
+ text_node :planCode,"planCode",:default_value=>nil
1345
+ text_node :active,"active", :default_value=>nil
1346
+ end
1347
+
1348
+ class VirtualGiftCard
1349
+ include XML::Mapping
1350
+ root_element_name "virtualGiftCard"
1351
+ text_node "accountNumberLength","accountNumberLength", :default_value=>nil
1352
+ text_node "giftCardBin","giftCardBin", :default_value=>nil
1353
+ def self.from_hash(hash, name="virtualGiftCard")
1354
+ base = hash[name]
1355
+ if(base)
1356
+ this = VirtualGiftCard.new
1357
+ this.accountNumberLength = base['accountNumberLength']
1358
+ this.giftCardBin = base['giftCardBin']
1359
+ this
1360
+ end
1361
+ end
1362
+ end
1363
+
1364
+ class LodgingCharge
1365
+ include XML::Mapping
1366
+ text_node :name, "name", :default_value=>nil
1367
+ def self.from_hash(hash, name='lodgingCharge')
1368
+ base = hash[name]
1369
+ if(base)
1370
+ this = LodgingCharge.new
1371
+ this.name = base['name']
1372
+ SchemaValidation.validate_required(this.name,true,name,'name')
1373
+ SchemaValidation.validate_enum(this.name, false, ['RESTAURANT','GIFTSHOP','MINIBAR','TELEPHONE','OTHER','LAUNDRY'], name, 'name')
1374
+ this
1375
+ else
1376
+ nil
1377
+ end
1378
+ end
1379
+ end
1380
+
1381
+ class LodgingInfo
1382
+ include XML::Mapping
1383
+ text_node :hotelFolioNumber, "hotelFolioNumber", :default_value=>nil
1384
+ text_node :checkInDate, "checkInDate", :default_value=>nil
1385
+ text_node :checkOutDate, "checkOutDate", :default_value=>nil
1386
+ text_node :duration, "duration", :default_value=>nil
1387
+ text_node :customerServicePhone, "customerServicePhone", :default_value=>nil
1388
+ text_node :programCode, "programCode", :default_value=>nil
1389
+ text_node :roomRate, "roomRate", :default_value=>nil
1390
+ text_node :roomTax, "roomTax", :default_value=>nil
1391
+ text_node :numAdults, "numAdults", :default_value=>nil
1392
+ text_node :propertyLocalPhone, "propertyLocalPhone", :default_value=>nil
1393
+ text_node :fireSafetyIndicator, "fireSafetyIndicator", :default_value=>nil
1394
+ object_node :lodgingCharge, "lodgingCharge", :class=>LodgingCharge, :default_value=>nil
1395
+ def self.from_hash(hash, name='lodgingInfo')
1396
+ base = hash[name]
1397
+ if(base)
1398
+ this = LodgingInfo.new
1399
+ this.hotelFolioNumber = base['hotelFolioNumber']
1400
+ this.checkInDate = base['checkInDate']
1401
+ this.checkOutDate = base['checkOutDate']
1402
+ this.duration = base['duration']
1403
+ this.customerServicePhone = base['customerServicePhone']
1404
+ this.programCode = base['programCode']
1405
+ this.roomRate = base['roomRate']
1406
+ this.roomTax = base['roomTax']
1407
+ this.numAdults = base['numAdults']
1408
+ this.propertyLocalPhone = base['propertyLocalPhone']
1409
+ this.fireSafetyIndicator = base['fireSafetyIndicator']
1410
+ this.lodgingCharge = LodgingCharge.from_hash(base)
1411
+ SchemaValidation.validate_length(this.hotelFolioNumber, false, 1, 25, name, 'hotelFolioNumber')
1412
+ SchemaValidation.validate_date(this.checkInDate, false, name, 'hotelFolioNumber')
1413
+ SchemaValidation.validate_date(this.checkOutDate, false, name, 'hotelFolioNumber')
1414
+ SchemaValidation.validate_size(this.duration, false, 0, 999, name, 'duration')
1415
+ SchemaValidation.validate_length(this.customerServicePhone, false, 1, 17, name, 'customerServicePhone')
1416
+ SchemaValidation.validate_enum(this.programCode, false, ['LODGING','NOSHOW','ADVANCEDDEPOSIT'], name, 'programCode')
1417
+ SchemaValidation.validate_size(this.roomRate, false, -999999999999, 999999999999, name, 'roomRate')
1418
+ SchemaValidation.validate_size(this.roomTax, false, -999999999999, 999999999999, name, 'roomTax')
1419
+ SchemaValidation.validate_size(this.numAdults, false, 0, 99, name, 'numAdults')
1420
+ SchemaValidation.validate_length(this.propertyLocalPhone, false, 1, 17, name, 'propertyLocalPhone')
1421
+ SchemaValidation.validate_boolean(this.fireSafetyIndicator, false, name, 'fireSafetyIndicator')
1422
+ this
1423
+ else
1424
+ nil
1425
+ end
1426
+ end
1427
+ end
1428
+
1429
+ class PreferredDebitNetworksType
1430
+ include XML::Mapping
1431
+ text_node :debitNetworkName, "debitNetworkName", :default_value=>nil
1432
+ def self.from_hash(hash, name='preferredDebitNetworks')
1433
+ base = hash[name]
1434
+ if(base)
1435
+ this = PreferredDebitNetworksType.new
1436
+ this.debitNetworkName = base['debitNetworkName']
1437
+ SchemaValidation.validate_length(this.debitNetworkName, true, 1, 25, name, 'debitNetworkName')
1438
+ this
1439
+ else
1440
+ nil
1441
+ end
1442
+ end
1443
+ end
1444
+
1445
+ class PinlessDebitRequestType
1446
+ include XML::Mapping
1447
+ text_node :routingPreference, "routingPreference", :default_value=>nil
1448
+ object_node :preferredDebitNetworks, "preferredDebitNetworks", :class=>PreferredDebitNetworksType,:default_value=>nil
1449
+ def self.from_hash(hash, name='pinlessDebitRequest')
1450
+ base = hash[name]
1451
+ if(base)
1452
+ this = PinlessDebitRequestType.new
1453
+ this.routingPreference = base['routingPreference']
1454
+ this.preferredDebitNetworks = PreferredDebitNetworksType.from_hash(base)
1455
+ SchemaValidation.validate_enum(this.routingPreference, false, ['pinlessDebitOnly','signatureOnly','regular'], name, 'routingPreference')
1456
+ this
1457
+ else
1458
+ nil
1459
+ end
1460
+ end
1461
+ end
1462
+
1463
+
1464
+ class Activate
1465
+ include XML::Mapping
1466
+ root_element_name "activate"
1467
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1468
+ #SDK XML 10
1469
+ text_node :transactionId, "@id", :default_value=>nil
1470
+ text_node :orderId,'orderId', :default_value=>nil
1471
+ text_node :amount, "amount", :default_value=>nil
1472
+ text_node :orderSource, "orderSource", :default_value=>nil
1473
+ #object_node :card,'card',:class=>Card, :default_value=>nil
1474
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1475
+ :elsif, 'virtualGiftCard', :then, (object_node :virtualGiftCard, "virtualGiftCard", :class=>VirtualGiftCard)
1476
+ end
1477
+
1478
+ class Deactivate
1479
+ include XML::Mapping
1480
+ root_element_name "deactivate"
1481
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1482
+ #SDK XML 10
1483
+ text_node :transactionId, "@id", :default_value=>nil
1484
+ text_node :orderId,'orderId', :default_value=>nil
1485
+ text_node :orderSource, "orderSource", :default_value=>nil
1486
+ object_node :card, "card", :class => Card, :default_value=>nil
1487
+ end
1488
+
1489
+ class Load
1490
+ include XML::Mapping
1491
+ root_element_name "load"
1492
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1493
+ #SDK XML 10
1494
+ text_node :transactionId, "@id", :default_value=>nil
1495
+ text_node :orderId,'orderId', :default_value=>nil
1496
+ text_node :amount, "amount", :default_value=>nil
1497
+ text_node :orderSource, "orderSource", :default_value=>nil
1498
+ object_node :card,'card',:class=>Card, :default_value=>nil
1499
+ end
1500
+
1501
+ class Unload
1502
+ include XML::Mapping
1503
+ root_element_name "unload"
1504
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1505
+ #SDK XML 10
1506
+ text_node :transactionId, "@id", :default_value=>nil
1507
+ text_node :orderId,'orderId', :default_value=>nil
1508
+ text_node :amount, "amount", :default_value=>nil
1509
+ text_node :orderSource, "orderSource", :default_value=>nil
1510
+ object_node :card,'card',:class=>Card, :default_value=>nil
1511
+ end
1512
+
1513
+ class BalanceInquiry
1514
+ include XML::Mapping
1515
+ root_element_name "balanceInquiry"
1516
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1517
+ #SDK XML 10
1518
+ text_node :transactionId, "@id", :default_value=>nil
1519
+ text_node :orderId,'orderId', :default_value=>nil
1520
+ text_node :orderSource, "orderSource", :default_value=>nil
1521
+ object_node :card,'card',:class=>Card, :default_value=>nil
1522
+ end
1523
+
1524
+ class AdvancedFraudChecks
1525
+ include XML::Mapping
1526
+ root_element_name "advancedFraudChecks"
1527
+ text_node :threatMetrixSessionId, 'threatMetrixSessionId', :default_value=>nil
1528
+ text_node :webSessionId, 'webSessionId', :default_value=>nil
1529
+ text_node :customAttribute1, 'customAttribute1', :default_value=>nil
1530
+ text_node :customAttribute2, 'customAttribute2', :default_value=>nil
1531
+ text_node :customAttribute3, 'customAttribute3', :default_value=>nil
1532
+ text_node :customAttribute4, 'customAttribute4', :default_value=>nil
1533
+ text_node :customAttribute5, 'customAttribute5', :default_value=>nil
1534
+ def self.from_hash(hash, name="advancedFraudChecks")
1535
+ base = hash[name]
1536
+ if(base)
1537
+ this = AdvancedFraudChecks.new
1538
+ this.threatMetrixSessionId = base['threatMetrixSessionId'] # /\A([A-Z,a-z,0-9, ,\*,,,\-,',#,&,.]){4,25}\Z/
1539
+ #SchemaValidation.validate_regex(this.threatMetrixSessionId, true, '[-a-zA-Z0-9_]{1,128}', name, 'threatMetrixSessionId')
1540
+ this.webSessionId = base['webSessionId']
1541
+ #SchemaValidation.validate_regex(this.webSessionId, true, '[-a-zA-Z0-9_]{1,128}', name, 'webSessionId')
1542
+ this.customAttribute1 = base['customAttribute1']
1543
+ SchemaValidation.validate_length(this.customAttribute1,false,1,200,name,"customAttribute1")
1544
+ this.customAttribute2 = base['customAttribute2']
1545
+ SchemaValidation.validate_length(this.customAttribute2,false,1,200,name,"customAttribute2")
1546
+ this.customAttribute3 = base['customAttribute3']
1547
+ SchemaValidation.validate_length(this.customAttribute3,false,1,200,name,"customAttribute3")
1548
+ this.customAttribute4 = base['customAttribute4']
1549
+ SchemaValidation.validate_length(this.customAttribute4,false,1,200,name,"customAttribute4")
1550
+ this.customAttribute5 = base['customAttribute5']
1551
+ SchemaValidation.validate_length(this.customAttribute5,false,1,200,name,"customAttribute5")
1552
+ this
1553
+ end
1554
+ end
1555
+ end
1556
+
1557
+ class FraudCheckRequest
1558
+ include XML::Mapping
1559
+ root_element_name "fraudCheck"
1560
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1561
+ text_node :transactionId, "@id", :default_value=>nil
1562
+ text_node :customerId, "@customerId", :default_value=>nil
1563
+ object_node :advancedFraudChecks, "advancedFraudChecks", :default_value=>nil
1564
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1565
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1566
+ text_node :amount, "amount", :default_value=>nil
1567
+ text_node :eventType, "eventType", :default_value=>nil
1568
+ text_node :accountLogin, "accountLogin", :default_value=>nil
1569
+ text_node :accountPasshash, "accountPasshash", :default_value=>nil
1570
+
1571
+ end
1572
+
1573
+ class Authorization
1574
+ include XML::Mapping
1575
+ root_element_name "authorization"
1576
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1577
+ text_node :transactionId, "@id", :default_value=>nil
1578
+ text_node :customerId, "@customerId", :default_value=>nil
1579
+
1580
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1581
+ text_node :orderId, "orderId", :default_value=>nil
1582
+ text_node :amount, "amount", :default_value=>nil
1583
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
1584
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1585
+ text_node :orderSource, "orderSource", :default_value=>nil
1586
+ object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
1587
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1588
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1589
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1590
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>PayPal),
1591
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1592
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1593
+ :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos),
1594
+ :elsif, 'applepay', :then, (object_node :applepay, "applepay", :class=>Applepay)
1595
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
1596
+ object_node :cardholderAuthentication, "cardholderAuthentication", :class=>FraudCheck, :default_value=>nil
1597
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1598
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
1599
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1600
+ text_node :taxType, "taxType", :default_value=>nil
1601
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1602
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1603
+ text_node :allowPartialAuth, "allowPartialAuth", :default_value=>nil
1604
+ object_node :healthcareIIAS, "healthcareIIAS", :class=>HealthcareIIAS, :default_value=>nil
1605
+ object_node :filtering, "filtering", :class=>Filtering, :default_value=>nil
1606
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1607
+ object_node :recyclingRequest, "recyclingRequest", :class=>RecyclingRequest, :default_value=>nil
1608
+ text_node :fraudFilterOverride, "fraudFilterOverride", :default_value=>nil
1609
+ object_node :recurringRequest,"recurringRequest", :class=>RecurringRequest, :default_value=>nil
1610
+ text_node :debtRepayment,"debtRepayment", :default_value=>nil
1611
+ object_node :advancedFraudChecks, "advancedFraudChecks",:class=>AdvancedFraudChecks, :default_value=>nil
1612
+ #SDK XML 10
1613
+ object_node :wallet, "wallet", :class=>Wallet, :default_value=>nil
1614
+ #SDK XML 11
1615
+ text_node :processingType,"processingType", :default_value=>nil
1616
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1617
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1618
+ #SDK XML 12
1619
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1620
+ end
1621
+
1622
+ class Sale
1623
+ include XML::Mapping
1624
+ root_element_name "sale"
1625
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1626
+ text_node :transactionId, "@id", :default_value=>nil
1627
+ text_node :customerId, "@customerId", :default_value=>nil
1628
+
1629
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1630
+ text_node :orderId, "orderId", :default_value=>nil
1631
+ text_node :amount, "amount", :default_value=>nil
1632
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
1633
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1634
+ text_node :orderSource, "orderSource", :default_value=>nil
1635
+ object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
1636
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1637
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1638
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1639
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>PayPal),
1640
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1641
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1642
+ :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos),
1643
+ :elsif, 'applepay', :then, (object_node :applepay, "applepay", :class=>Applepay),
1644
+ :elsif, 'sepaDirectDebit', :then, (object_node :sepaDirectDebit, "sepaDirectDebit", :class=>SepaDirectDebit)
1645
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
1646
+ optional_choice_node :if, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck, :default_value=>nil),
1647
+ :elsif, 'cardholderAuthentication', :then, (object_node :cardholderAuthentication, "cardholderAuthentication", :class=>FraudCheck, :default_value=>nil)
1648
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1649
+ text_node :taxType, "taxType", :default_value=>nil
1650
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1651
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1652
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
1653
+ text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
1654
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
1655
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1656
+ text_node :allowPartialAuth, "allowPartialAuth", :default_value=>nil
1657
+ object_node :healthcareIIAS, "healthcareIIAS", :class=>HealthcareIIAS, :default_value=>nil
1658
+ object_node :filtering, "filtering", :class=>Filtering, :default_value=>nil
1659
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1660
+ object_node :recyclingRequest, "recyclingRequest", :class=>RecyclingRequest, :default_value=>nil
1661
+ text_node :fraudFilterOverride, "fraudFilterOverride", :default_value=>nil
1662
+ object_node :recurringRequest, "recurringRequest", :class=>RecurringRequest, :default_value=>nil
1663
+ object_node :cnpInternalRecurringRequest, "cnpInternalRecurringRequest", :class=>CnpInternalRecurringRequest, :default_value=>nil
1664
+ text_node :debtRepayment,"debtRepayment", :default_value=>nil
1665
+ object_node :advancedFraudChecks, "advancedFraudChecks",:class=>AdvancedFraudChecks, :default_value=>nil
1666
+ #SDK XML 10
1667
+ object_node :wallet, "wallet", :class=>Wallet, :default_value=>nil
1668
+ #SDK XML 11
1669
+ text_node :processingType,"processingType", :default_value=>nil
1670
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1671
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1672
+ #SDK XML 12
1673
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1674
+ object_node :pinlessDebitRequest, "pinlessDebitRequest", :class=>PinlessDebitRequestType, :default_value=>nil
1675
+
1676
+ end
1677
+
1678
+ class Credit
1679
+ include XML::Mapping
1680
+ root_element_name "credit"
1681
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1682
+ text_node :transactionId, "@id", :default_value=>nil
1683
+ text_node :customerId, "@customerId", :default_value=>nil
1684
+
1685
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1686
+ text_node :orderId, "orderId", :default_value=>nil
1687
+ text_node :amount, "amount", :default_value=>nil
1688
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
1689
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1690
+ text_node :orderSource, "orderSource", :default_value=>nil
1691
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1692
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1693
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>CreditPayPal),
1694
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1695
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1696
+ :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos)
1697
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1698
+ text_node :taxType, "taxType", :default_value=>nil
1699
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
1700
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1701
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1702
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
1703
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1704
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1705
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
1706
+ text_node :actionReason, "actionReason", :default_value=>nil
1707
+ #SDK XML 11
1708
+ text_node :pin, "pin", :default_value=>nil
1709
+ #SDK XML 12
1710
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1711
+
1712
+ end
1713
+
1714
+ class RegisterTokenRequest
1715
+ include XML::Mapping
1716
+ root_element_name "registerTokenRequest"
1717
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1718
+ text_node :transactionId, "@id", :default_value=>nil
1719
+ text_node :customerId, "@customerId", :default_value=>nil
1720
+
1721
+ text_node :encryptionKeyId, "encryptionKeyId", :default_value => nil
1722
+ text_node :orderId, "orderId", :default_value=>nil
1723
+ optional_choice_node :if, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos),
1724
+ :elsif, 'accountNumber', :then, (text_node :accountNumber, "accountNumber", :default_value=>nil),
1725
+ :elsif, 'echeckForToken', :then, (object_node :echeckForToken, "echeckForToken", :class=>EcheckForToken),
1726
+ :elsif, 'paypageRegistrationId', :then, (text_node :paypageRegistrationId, "paypageRegistrationId", :default_value=>nil),
1727
+ :elsif, 'applepay', :then, (object_node :applepay, "applepay", :class=>Applepay),
1728
+ :elsif, 'encryptedAccountNumber', :then, (text_node :encryptedAccountNumber, "encryptedAccountNumber", :default_value=>nil)
1729
+
1730
+ optional_choice_node :if, 'cardValidationNum', :then, (text_node :cardValidationNum, "cardValidationNum", :default_value => nil),
1731
+ :elsif, 'encryptedCardValidationNum', :then, (text_node :encryptedCardValidationNum, "encryptedCardValidationNum", :default_value => nil)
1732
+
1733
+
1734
+ end
1735
+
1736
+ class CaptureGivenAuth
1737
+ include XML::Mapping
1738
+ root_element_name "captureGivenAuth"
1739
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1740
+ text_node :transactionId, "@id", :default_value=>nil
1741
+ text_node :customerId, "@customerId", :default_value=>nil
1742
+
1743
+ text_node :orderId, "orderId", :default_value=>nil
1744
+ object_node :authInformation, "authInformation", :class=>AuthInformation, :default_value=>nil
1745
+ text_node :amount, "amount", :default_value=>nil
1746
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
1747
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1748
+ text_node :orderSource, "orderSource", :default_value=>nil
1749
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1750
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1751
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1752
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1753
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1754
+ :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos)
1755
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1756
+ text_node :taxType, "taxType", :default_value=>nil
1757
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
1758
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1759
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1760
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
1761
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1762
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1763
+ text_node :debtRepayment,"debtRepayment", :default_value=>nil
1764
+ #SDK XML 11
1765
+ text_node :processingType,"processingType", :default_value=>nil
1766
+ text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
1767
+ text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
1768
+ #SDK XML 12
1769
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1770
+ end
1771
+
1772
+ class ForceCapture
1773
+ include XML::Mapping
1774
+ root_element_name "forceCapture"
1775
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1776
+ text_node :transactionId, "@id", :default_value=>nil
1777
+ text_node :customerId, "@customerId", :default_value=>nil
1778
+
1779
+ text_node :orderId, "orderId", :default_value=>nil
1780
+ text_node :amount, "amount", :default_value=>nil
1781
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
1782
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1783
+ text_node :orderSource, "orderSource", :default_value=>nil
1784
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1785
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
1786
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
1787
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage),
1788
+ :elsif, 'mpos', :then, (object_node :mpos, "mpos", :class=>Mpos)
1789
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1790
+ text_node :taxType, "taxType", :default_value=>nil
1791
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1792
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1793
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
1794
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
1795
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
1796
+ text_node :debtRepayment,"debtRepayment", :default_value=>nil
1797
+ #SDK XML 11
1798
+ text_node :processingType,"processingType", :default_value=>nil
1799
+ #SDK XML 12
1800
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1801
+
1802
+ end
1803
+
1804
+ class AuthReversal
1805
+ include XML::Mapping
1806
+ root_element_name "authReversal"
1807
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1808
+ text_node :transactionId, "@id", :default_value=>nil
1809
+ text_node :customerId, "@customerId", :default_value=>nil
1810
+ text_node :partial, "@partial", :default_value=>nil
1811
+
1812
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1813
+ text_node :amount, "amount", :default_value=>nil
1814
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1815
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
1816
+ text_node :actionReason, "actionReason", :default_value=>nil
1817
+ end
1818
+
1819
+ class Capture
1820
+ include XML::Mapping
1821
+ root_element_name "capture"
1822
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1823
+ text_node :transactionId, "@id", :default_value=>nil
1824
+ text_node :customerId, "@customerId", :default_value=>nil
1825
+ text_node :partial, "@partial", :default_value=>nil
1826
+
1827
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1828
+ text_node :amount, "amount", :default_value=>nil
1829
+ text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
1830
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
1831
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1832
+ text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
1833
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
1834
+ #SDK XML 11
1835
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
1836
+ text_node :pin, "pin", :default_value=>nil
1837
+ #SDK XML 12
1838
+ object_node :lodgingInfo, "lodgingInfo", :class=>LodgingInfo, :default_value=>nil
1839
+ end
1840
+
1841
+ class Void
1842
+ include XML::Mapping
1843
+ root_element_name "void"
1844
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1845
+ text_node :transactionId, "@id", :default_value=>nil
1846
+ text_node :customerId, "@customerId", :default_value=>nil
1847
+
1848
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1849
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
1850
+ end
1851
+
1852
+ class EcheckVoid
1853
+ include XML::Mapping
1854
+ root_element_name "echeckVoid"
1855
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1856
+ text_node :transactionId, "@id", :default_value=>nil
1857
+ text_node :customerId, "@customerId", :default_value=>nil
1858
+
1859
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1860
+ end
1861
+
1862
+ class GiftCardCardType
1863
+ def self.from_hash(hash, name='card')
1864
+ base = hash[name]
1865
+ if(base)
1866
+ SchemaValidation.validate_enum(base['type'], true, ['GC'], name, 'type')
1867
+ Card.from_hash(hash)
1868
+ else
1869
+ nil
1870
+ end
1871
+ end
1872
+ end
1873
+
1874
+
1875
+ #XML 12.0
1876
+ class GiftCardAuthReversal
1877
+ include XML::Mapping
1878
+ root_element_name "giftCardAuthReversal"
1879
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1880
+ text_node :transactionId, "@id", :default_value=>nil
1881
+ text_node :customerId, "@customerId", :default_value=>nil
1882
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1883
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1884
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1885
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1886
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1887
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1888
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1889
+ end
1890
+
1891
+ class GiftCardCapture
1892
+ include XML::Mapping
1893
+ root_element_name "giftCardCapture"
1894
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1895
+ text_node :transactionId, "@id", :default_value=>nil
1896
+ text_node :customerId, "@customerId", :default_value=>nil
1897
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1898
+ text_node :captureAmount, "captureAmount", :default_value=>nil
1899
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1900
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1901
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1902
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1903
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1904
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1905
+ end
1906
+
1907
+ class GiftCardCredit
1908
+ include XML::Mapping
1909
+ root_element_name "giftCardCredit"
1910
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1911
+ text_node :transactionId, "@id", :default_value=>nil
1912
+ text_node :customerId, "@customerId", :default_value=>nil
1913
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1914
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1915
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1916
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1917
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1918
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1919
+ text_node :creditAmount, "creditAmount", :default_value=>nil
1920
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1921
+ text_node :orderId, "orderId", :default_value=>nil
1922
+ text_node :creditAmount, "creditAmount", :default_value=>nil
1923
+ text_node :orderSource, "orderSource", :default_value=>nil
1924
+
1925
+ end
1926
+
1927
+
1928
+
1929
+ class DepositReversal
1930
+ include XML::Mapping
1931
+ root_element_name "depositReversal"
1932
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1933
+ text_node :transactionId, "@id", :default_value=>nil
1934
+ text_node :customerId, "@customerId", :default_value=>nil
1935
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1936
+ #12.0
1937
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1938
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1939
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1940
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1941
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1942
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1943
+
1944
+ end
1945
+
1946
+ class RefundReversal
1947
+ include XML::Mapping
1948
+ root_element_name "refundReversal"
1949
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1950
+ text_node :transactionId, "@id", :default_value=>nil
1951
+ text_node :customerId, "@customerId", :default_value=>nil
1952
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1953
+ #12.0
1954
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1955
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1956
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1957
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1958
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1959
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1960
+ end
1961
+
1962
+ class ActivateReversal
1963
+ include XML::Mapping
1964
+ root_element_name "activateReversal"
1965
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1966
+ text_node :transactionId, "@id", :default_value=>nil
1967
+ text_node :customerId, "@customerId", :default_value=>nil
1968
+
1969
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1970
+ #12.0
1971
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1972
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1973
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1974
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1975
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1976
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1977
+ end
1978
+
1979
+ class DeactivateReversal
1980
+ include XML::Mapping
1981
+ root_element_name "deactivateReversal"
1982
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1983
+ text_node :transactionId, "@id", :default_value=>nil
1984
+ text_node :customerId, "@customerId", :default_value=>nil
1985
+
1986
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
1987
+ #12.0
1988
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
1989
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
1990
+ text_node :originalAmount, "originalAmount", :default_value=>nil
1991
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
1992
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
1993
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
1994
+ end
1995
+
1996
+ class LoadReversal
1997
+ include XML::Mapping
1998
+ root_element_name "loadReversal"
1999
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2000
+ text_node :transactionId, "@id", :default_value=>nil
2001
+ text_node :customerId, "@customerId", :default_value=>nil
2002
+
2003
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2004
+ #12.0
2005
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
2006
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
2007
+ text_node :originalAmount, "originalAmount", :default_value=>nil
2008
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
2009
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
2010
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
2011
+ end
2012
+
2013
+ class UnloadReversal
2014
+ include XML::Mapping
2015
+ root_element_name "unloadReversal"
2016
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2017
+ text_node :transactionId, "@id", :default_value=>nil
2018
+ text_node :customerId, "@customerId", :default_value=>nil
2019
+
2020
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2021
+ #12.0
2022
+ object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
2023
+ text_node :originalRefCode, "originalRefCode", :default_value=>nil
2024
+ text_node :originalAmount, "originalAmount", :default_value=>nil
2025
+ text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
2026
+ text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
2027
+ text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
2028
+ end
2029
+
2030
+ class EcheckVerification
2031
+ include XML::Mapping
2032
+ root_element_name "echeckVerification"
2033
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2034
+ text_node :transactionId, "@id", :default_value=>nil
2035
+ text_node :customerId, "@customerId", :default_value=>nil
2036
+ #XML 12.0
2037
+ #text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2038
+ text_node :orderId, "orderId", :default_value=>nil
2039
+ text_node :amount, "amount", :default_value=>nil
2040
+ text_node :orderSource, "orderSource", :default_value=>nil
2041
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
2042
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
2043
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck),
2044
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken)
2045
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2046
+ end
2047
+
2048
+ class EcheckCredit
2049
+ include XML::Mapping
2050
+ root_element_name "echeckCredit"
2051
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2052
+ text_node :transactionId, "@id", :default_value=>nil
2053
+ text_node :customerId, "@customerId", :default_value=>nil
2054
+
2055
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2056
+ text_node :orderId, "orderId", :default_value=>nil
2057
+ text_node :amount, "amount", :default_value=>nil
2058
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
2059
+ text_node :orderSource, "orderSource", :default_value=>nil
2060
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
2061
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
2062
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
2063
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
2064
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2065
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2066
+ end
2067
+
2068
+ class EcheckRedeposit
2069
+ include XML::Mapping
2070
+ root_element_name "echeckRedeposit"
2071
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2072
+ text_node :transactionId, "@id", :default_value=>nil
2073
+ text_node :customerId, "@customerId", :default_value=>nil
2074
+
2075
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2076
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
2077
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
2078
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2079
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2080
+ end
2081
+
2082
+ class EcheckSale
2083
+ include XML::Mapping
2084
+ root_element_name "echeckSale"
2085
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2086
+ text_node :transactionId, "@id", :default_value=>nil
2087
+ text_node :customerId, "@customerId", :default_value=>nil
2088
+
2089
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2090
+ text_node :orderId, "orderId", :default_value=>nil
2091
+ text_node :verify, "verify", :default_value=>nil
2092
+ text_node :amount, "amount", :default_value=>nil
2093
+ text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
2094
+ text_node :orderSource, "orderSource", :default_value=>nil
2095
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
2096
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
2097
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
2098
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
2099
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
2100
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2101
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2102
+ end
2103
+
2104
+ class EcheckPreNoteSale
2105
+ include XML::Mapping
2106
+ root_element_name "echeckPreNoteSale"
2107
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2108
+ text_node :transactionId, "@id", :default_value=>nil
2109
+ text_node :customerId, "@customerId", :default_value=>nil
2110
+
2111
+ text_node :orderId, "orderId", :default_value=>nil
2112
+ text_node :orderSource, "orderSource", :default_value=>nil
2113
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
2114
+ object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil
2115
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2116
+ end
2117
+
2118
+ class EcheckPreNoteCredit
2119
+ include XML::Mapping
2120
+ root_element_name "echeckPreNoteCredit"
2121
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2122
+ text_node :transactionId, "@id", :default_value=>nil
2123
+ text_node :customerId, "@customerId", :default_value=>nil
2124
+
2125
+ text_node :orderId, "orderId", :default_value=>nil
2126
+ text_node :orderSource, "orderSource", :default_value=>nil
2127
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
2128
+ object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil
2129
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
2130
+ end
2131
+
2132
+ class SubmerchantCredit
2133
+ include XML::Mapping
2134
+ root_element_name "submerchantCredit"
2135
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2136
+ text_node :transactionId, "@id", :default_value=>nil
2137
+ text_node :customerId, "@customerId", :default_value=>nil
2138
+
2139
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2140
+ text_node :submerchantName, "submerchantName", :default_value=>nil
2141
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2142
+ text_node :amount, "amount", :default_value=>nil
2143
+ object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil
2144
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2145
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2146
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2147
+
2148
+ end
2149
+
2150
+
2151
+ class PayFacCredit
2152
+ include XML::Mapping
2153
+ root_element_name "payFacCredit"
2154
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2155
+ text_node :transactionId, "@id", :default_value=>nil
2156
+ text_node :customerId, "@customerId", :default_value=>nil
2157
+
2158
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2159
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2160
+ text_node :amount, "amount", :default_value=>nil
2161
+
2162
+ end
2163
+
2164
+ class ReserveCredit
2165
+ include XML::Mapping
2166
+ root_element_name "reserveCredit"
2167
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2168
+ text_node :transactionId, "@id", :default_value=>nil
2169
+ text_node :customerId, "@customerId", :default_value=>nil
2170
+
2171
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2172
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2173
+ text_node :amount, "amount", :default_value=>nil
2174
+
2175
+ end
2176
+
2177
+ class VendorCredit
2178
+ include XML::Mapping
2179
+ root_element_name "vendorCredit"
2180
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2181
+ text_node :transactionId, "@id", :default_value=>nil
2182
+ text_node :customerId, "@customerId", :default_value=>nil
2183
+
2184
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2185
+ text_node :vendorName, "vendorName", :default_value=>nil
2186
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2187
+ text_node :amount, "amount", :default_value=>nil
2188
+ object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil
2189
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2190
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2191
+
2192
+ end
2193
+
2194
+ class VendorCreditCtx
2195
+ include XML::Mapping
2196
+ root_element_name "vendorCredit"
2197
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2198
+ text_node :transactionId, "@id", :default_value=>nil
2199
+ text_node :customerId, "@customerId", :default_value=>nil
2200
+
2201
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2202
+ text_node :vendorName, "vendorName", :default_value=>nil
2203
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2204
+ text_node :amount, "amount", :default_value=>nil
2205
+ object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil
2206
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2207
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2208
+
2209
+ end
2210
+
2211
+ class PhysicalCheckCredit
2212
+ include XML::Mapping
2213
+ root_element_name "physicalCheckCredit"
2214
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2215
+ text_node :transactionId, "@id", :default_value=>nil
2216
+ text_node :customerId, "@customerId", :default_value=>nil
2217
+
2218
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2219
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2220
+ text_node :amount, "amount", :default_value=>nil
2221
+
2222
+ end
2223
+
2224
+ class SubmerchantDebit
2225
+ include XML::Mapping
2226
+ root_element_name "submerchantDebit"
2227
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2228
+ text_node :transactionId, "@id", :default_value=>nil
2229
+ text_node :customerId, "@customerId", :default_value=>nil
2230
+
2231
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2232
+ text_node :submerchantName, "submerchantName", :default_value=>nil
2233
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2234
+ text_node :amount, "amount", :default_value=>nil
2235
+ object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil
2236
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2237
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2238
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2239
+
2240
+ end
2241
+
2242
+ class SubmerchantDebitCtx
2243
+ include XML::Mapping
2244
+ root_element_name "submerchantDebit"
2245
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2246
+ text_node :transactionId, "@id", :default_value=>nil
2247
+ text_node :customerId, "@customerId", :default_value=>nil
2248
+
2249
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2250
+ text_node :submerchantName, "submerchantName", :default_value=>nil
2251
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2252
+ text_node :amount, "amount", :default_value=>nil
2253
+ object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil
2254
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2255
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2256
+ text_node :customIdentifier, "customIdentifier", :default_value=>nil
2257
+
2258
+ end
2259
+
2260
+ class PayFacDebit
2261
+ include XML::Mapping
2262
+ root_element_name "payFacDebit"
2263
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2264
+ text_node :transactionId, "@id", :default_value=>nil
2265
+ text_node :customerId, "@customerId", :default_value=>nil
2266
+
2267
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2268
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2269
+ text_node :amount, "amount", :default_value=>nil
2270
+
2271
+ end
2272
+
2273
+ class ReserveDebit
2274
+ include XML::Mapping
2275
+ root_element_name "reserveDebit"
2276
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2277
+ text_node :transactionId, "@id", :default_value=>nil
2278
+ text_node :customerId, "@customerId", :default_value=>nil
2279
+
2280
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2281
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2282
+ text_node :amount, "amount", :default_value=>nil
2283
+
2284
+ end
2285
+
2286
+ class VendorDebit
2287
+ include XML::Mapping
2288
+ root_element_name "vendorDebit"
2289
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2290
+ text_node :transactionId, "@id", :default_value=>nil
2291
+ text_node :customerId, "@customerId", :default_value=>nil
2292
+
2293
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2294
+ text_node :vendorName, "vendorName", :default_value=>nil
2295
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2296
+
2297
+ text_node :amount, "amount", :default_value=>nil
2298
+
2299
+ object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil
2300
+ # optional_choice_node :if, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>Echeck, :default_value=>nil),
2301
+ # :elsif, 'accountInfo', :then, (object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil)
2302
+ end
2303
+
2304
+ class VendorDebitCtx
2305
+ include XML::Mapping
2306
+ root_element_name "vendorDebit"
2307
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2308
+ text_node :transactionId, "@id", :default_value=>nil
2309
+ text_node :customerId, "@customerId", :default_value=>nil
2310
+
2311
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2312
+ text_node :vendorName, "vendorName", :default_value=>nil
2313
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2314
+
2315
+ text_node :amount, "amount", :default_value=>nil
2316
+
2317
+ object_node :accountInfo, "accountInfo", :class=>EcheckCtx, :default_value=>nil
2318
+ end
2319
+
2320
+ class PhysicalCheckDebit
2321
+ include XML::Mapping
2322
+ root_element_name "physicalCheckDebit"
2323
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2324
+ text_node :transactionId, "@id", :default_value=>nil
2325
+ text_node :customerId, "@customerId", :default_value=>nil
2326
+
2327
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2328
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2329
+ text_node :amount, "amount", :default_value=>nil
2330
+
2331
+ end
2332
+
2333
+ class UpdateCardValidationNumOnToken
2334
+ include XML::Mapping
2335
+ root_element_name "updateCardValidationNumOnToken"
2336
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2337
+ text_node :transactionId, "@id", :default_value=>nil
2338
+ text_node :customerId, "@customerId", :default_value=>nil
2339
+
2340
+ text_node :orderId, "orderId", :default_value=>nil
2341
+ text_node :cnpToken, "cnpToken", :default_value=>nil
2342
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
2343
+ end
2344
+
2345
+ class AccountUpdate
2346
+ include XML::Mapping
2347
+ root_element_name "accountUpdate"
2348
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2349
+ text_node :transactionId, "@id", :default_value=>nil
2350
+ text_node :customerId, "@customerId", :default_value=>nil
2351
+
2352
+ text_node :orderId, "orderId", :default_value=>nil
2353
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
2354
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken)
2355
+ end
2356
+
2357
+ # Adding the Funding Void Instruction Class
2358
+ # Date: 01-25-2016
2359
+ # Change Type: New
2360
+ # Desc: Change proposed as a part of XML 10 to incorporate the feature of voiding transactions
2361
+ # on request.
2362
+ class FundingInstructionVoid
2363
+ include XML::Mapping
2364
+ root_element_name "fundingInstructionVoid"
2365
+ text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
2366
+ end
2367
+
2368
+ class FastAccessFunding
2369
+ include XML::Mapping
2370
+ root_element_name "fastAccessFunding"
2371
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2372
+ text_node :transactionId, "@id", :default_value=>nil
2373
+ text_node :customerId, "@customerId", :default_value=>nil
2374
+
2375
+ text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
2376
+ text_node :submerchantName, "submerchantName", :default_value=>nil
2377
+ text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
2378
+ text_node :amount, "amount", :default_value=>nil
2379
+ text_node :disbursementType, "disbursementType", :default_value=>nil
2380
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
2381
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
2382
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
2383
+ end
2384
+
2385
+ # Adding the queryTransaction Class
2386
+ # Date: 01-27-2016
2387
+ # Change Type: New
2388
+ # Desc: Change proposed as a part of XML 10 to incorporate the feature of querying transactions
2389
+ # on request.
2390
+ class QueryTransaction
2391
+ include XML::Mapping
2392
+ root_element_name "queryTransaction"
2393
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2394
+ text_node :transactionId, "@id", :default_value=>nil
2395
+ text_node :customerId, "@customerId", :default_value=>nil
2396
+ text_node :origId, "origId", :default_value=>nil
2397
+ text_node :origActionType, "origActionType", :default_value=>nil
2398
+ text_node :origCnpTxnId, "origCnpTxnId", :default_value=>nil
2399
+ text_node :showStatusOnly, "showStatusOnly", :default_value=>nil
2400
+ #text_node :origOrderId, "origOrderId", :default_value=>nil
2401
+ #text_node :origAccountNumber, "origAccountNumber", :default_value=>nil
2402
+ def self.from_hash(hash, name='queryTransaction')
2403
+ base = hash[name]
2404
+ if(base)
2405
+ this = QueryTransaction.new
2406
+ this.origId = base['origId']
2407
+ this.origActionType = base['origActionType']
2408
+ this.origCnpTxnId = base['origCnpTxnId']
2409
+ this.origOrderId = base['origOrderId']
2410
+ this.origAccountNumber = base['origAccountNumber']
2411
+ SchemaValidation.validate_enum(this.origActionType, false, ['','A','D','R','AR','G','I','J','L','LR','P','RR','S','T','UR','V','W','X'], name, 'origActionType')
2412
+ SchemaValidation.validate_enum(this.origActionType, false, ['Y','N'], name, 'showStatusOnly')
2413
+ this
2414
+ else
2415
+ nil
2416
+ end
2417
+ end
2418
+ end
2419
+
2420
+
2421
+
2422
+ class TranslateToLowValueTokenRequest
2423
+ include XML::Mapping
2424
+ root_element_name "translateToLowValueTokenRequest"
2425
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
2426
+ text_node :transactionId, "@id", :default_value=>nil
2427
+ text_node :customerId, "@customerId", :default_value=>nil
2428
+
2429
+ text_node :orderId, "orderId", :default_value=>nil
2430
+ text_node :token, "token", :default_value=>nil
2431
+ end
2432
+
2433
+ class OnlineRequest
2434
+ include XML::Mapping
2435
+ root_element_name "cnpOnlineRequest"
2436
+ text_node :merchantId, "@merchantId", :default_value=>nil
2437
+ #SDK XML 10
2438
+ text_node :id, "@id", :default_value=>nil
2439
+ text_node :version, "@version", :default_value=>nil
2440
+ text_node :xmlns, "@xmlns", :default_value=>nil
2441
+ text_node :merchantSdk, "@merchantSdk", :default_value=>nil
2442
+ text_node :loggedInUser, "@loggedInUser", :default_value=>nil
2443
+ object_node :authentication, "authentication", :class=>Authentication
2444
+ optional_choice_node :if, 'authorization', :then, (object_node :authorization, "authorization", :class=>Authorization),
2445
+ :elsif, 'sale', :then, (object_node :sale, "sale", :class=>Sale),
2446
+ :elsif, 'captureTxn', :then, (object_node :captureTxn, "captureTxn", :class=>Capture),
2447
+ :elsif, 'captureGivenAuth', :then, (object_node :captureGivenAuth, "captureGivenAuth", :class=>CaptureGivenAuth),
2448
+ :elsif, 'void', :then, (object_node :void, "void", :class=>Void),
2449
+ :elsif, 'forceCapture', :then, (object_node :forceCapture, "forceCapture", :class=>ForceCapture),
2450
+ :elsif, 'credit', :then, (object_node :credit, "credit", :class=>Credit),
2451
+ :elsif, 'authReversal', :then, (object_node :authReversal, "authReversal", :class=>AuthReversal),
2452
+ :elsif, 'echeckCredit', :then, (object_node :echeckCredit, "echeckCredit", :class=>EcheckCredit),
2453
+ :elsif, 'echeckRedeposit', :then, (object_node :echeckRedeposit, "echeckRedeposit", :class=>EcheckRedeposit),
2454
+ :elsif, 'echeckSale', :then, (object_node :echeckSale, "echeckSale", :class=>EcheckSale),
2455
+ :elsif, 'echeckVoid', :then, (object_node :echeckVoid, "echeckVoid", :class=>EcheckVoid),
2456
+ :elsif, 'echeckVerification', :then, (object_node :echeckVerification, "echeckVerification", :class=>EcheckVerification),
2457
+ :elsif, 'registerTokenRequest', :then, (object_node :registerTokenRequest, "registerTokenRequest", :class=>RegisterTokenRequest),
2458
+ :elsif, 'updateCardValidationNumOnToken', :then, (object_node :updateCardValidationNumOnToken, "updateCardValidationNumOnToken", :class=>UpdateCardValidationNumOnToken),
2459
+ :elsif, 'cancelSubscription', :then, (object_node :cancelSubscription, "cancelSubscription", :class=>CancelSubscription),
2460
+ :elsif, 'updateSubscription', :then, (object_node :updateSubscription, "updateSubscription", :class=>UpdateSubscription),
2461
+ :elsif, 'activate',:then,(object_node :activate,"activate", :class=>Activate),
2462
+ :elsif, 'deactivate',:then,(object_node :deactivate,"deactivate", :class=>Deactivate),
2463
+ :elsif, 'load',:then,(object_node :load,"load", :class=>Load),
2464
+ :elsif, 'unload',:then,(object_node :unload,"unload", :class=>Unload),
2465
+ :elsif, 'balanceInquiry',:then,(object_node :balanceInquiry,"balanceInquiry", :class=>BalanceInquiry),
2466
+ :elsif, 'createPlan',:then,(object_node :createPlan,"createPlan",:class=>CreatePlan),
2467
+ :elsif, 'updatePlan',:then,(object_node :updatePlan,"updatePlan",:class=>UpdatePlan),
2468
+ :elsif, 'virtualGiftCard', :then,(object_node :virtualGiftCard,"virtualGiftCard",:class=>VirtualGiftCard),
2469
+ :elsif, 'activateReversal', :then, (object_node :activateReversal,"activateReversal", :class=>ActivateReversal),
2470
+ :elsif, 'depositReversal', :then, (object_node :depositReversal,"depositReversal", :class=>DepositReversal),
2471
+ :elsif, 'giftCardAuthReversal', :then, (object_node :giftCardAuthReversal,"giftCardAuthReversal", :class=>GiftCardAuthReversal),
2472
+ :elsif, 'giftCardCapture', :then, (object_node :giftCardCapture,"giftCardCapture", :class=>GiftCardCapture),
2473
+ :elsif, 'giftCardCredit', :then, (object_node :giftCardCredit,"giftCardCredit", :class=>GiftCardCredit),
2474
+ :elsif, 'refundReversal', :then, (object_node :refundReversal,"refundReversal", :class=>RefundReversal),
2475
+ :elsif, 'deactivateReversal', :then, (object_node :deactivateReversal,"deactivateReversal", :class=>DeactivateReversal),
2476
+ :elsif, 'loadReversal', :then, (object_node :loadReversal,"loadReversal", :class=>LoadReversal),
2477
+ :elsif, 'unloadReversal', :then, (object_node :unloadReversal,"unloadReversal", :class=>UnloadReversal),
2478
+ :elsif, 'advancedFraudResults', :then, (object_node :advancedFraudResults,"advancedFraudResults", :class=>AdvancedFraudResults),
2479
+ :elsif, 'queryTransaction', :then, (object_node :queryTransaction, "queryTransaction", :class=>QueryTransaction),
2480
+ :elsif, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck),
2481
+ :elsif, 'fastAccessFunding', :then, (object_node :fastAccessFunding, "fastAccessFunding", :class=>FastAccessFunding),
2482
+ :elsif, 'translateToLowValueTokenRequest', :then, (object_node :translateToLowValueTokenRequest, "translateToLowValueTokenRequest", :class=>TranslateToLowValueTokenRequest),
2483
+ :elsif, 'vendorDebit', :then, (object_node :vendorDebit, "vendorDebit", :class=>VendorDebit),
2484
+ :elsif, 'vendorCredit', :then, (object_node :vendorCredit, "vendorCredit", :class=>VendorCredit),
2485
+ :elsif, 'submerchantDebit', :then, (object_node :submerchantDebit, "submerchantDebit", :class=>SubmerchantDebit),
2486
+ :elsif, 'submerchantCredit', :then, (object_node :submerchantCredit, "submerchantCredit", :class=>SubmerchantCredit)
2487
+
2488
+ def post_save(xml, options={:Mapping=>:_default})
2489
+ xml.each_element() {|el|
2490
+ if(el.name == 'captureTxn')
2491
+ el.name = 'capture'
2492
+ end
2493
+ }
2494
+ end
2495
+
2496
+ end
2497
+
2498
+ class BatchRequest
2499
+ include XML::Mapping
2500
+ root_element_name "batchRequest"
2501
+
2502
+ text_node :merchantSdk,"merchantSdk",:default_value=>"0"
2503
+ text_node :id, "@id", :default_value=>nil
2504
+ text_node :numAuths, "@numAuths", :default_value=>"0"
2505
+ text_node :authAmount, "@authAmount", :default_value=>"0"
2506
+ text_node :numAuthReversals, "@numAuthReversals", :default_value=>"0"
2507
+ text_node :authReversalAmount, "@authReversalAmount", :default_value=>"0"
2508
+ #12.0 begin
2509
+ text_node :numGiftCardAuthReversals, "@numGiftCardAuthReversals", :default_value=>"0"
2510
+ text_node :giftCardAuthReversalOriginalAmount, "@giftCardAuthReversalOriginalAmount", :default_value=>"0"
2511
+ #12.0 end
2512
+ text_node :numCaptures, "@numCaptures", :default_value=>"0"
2513
+ text_node :captureAmount, "@captureAmount", :default_value=>"0"
2514
+ #12.0 begin
2515
+ text_node :numGiftCardCaptures, "@numGiftCardCaptures", :default_value=>"0"
2516
+ text_node :giftCardCaptureAmount, "@giftCardCaptureAmount", :default_value=>"0"
2517
+ #12.0 end
2518
+ #<xs:attribute name="numExtCaptures" type="xs:integer" use="optional" />
2519
+ #<xs:attribute name="extCaptureAmount" type="xp:batchTotalAmountType" use="optional" />
2520
+ text_node :numCredits, "@numCredits", :default_value=>"0"
2521
+ text_node :creditAmount, "@creditAmount", :default_value=>"0"
2522
+ #12.0 begin
2523
+ text_node :numGiftCardCredits, "@numGiftCardCredits", :default_value=>"0"
2524
+ text_node :giftCardCreditAmount, "@giftCardCreditAmount", :default_value=>"0"
2525
+ #12.0 end
2526
+ text_node :numForceCaptures, "@numForceCaptures", :default_value=>"0"
2527
+ text_node :forceCaptureAmount, "@forceCaptureAmount", :default_value=>"0"
2528
+ text_node :numSales, "@numSales", :default_value=>"0"
2529
+ text_node :saleAmount, "@saleAmount", :default_value=>"0"
2530
+ text_node :numCaptureGivenAuths, "@numCaptureGivenAuths", :default_value=>"0"
2531
+ text_node :captureGivenAuthAmount, "@captureGivenAuthAmount", :default_value=>"0"
2532
+ text_node :numEcheckSales, "@numEcheckSales", :default_value=>"0"
2533
+ text_node :echeckSalesAmount, "@echeckSalesAmount", :default_value=>"0"
2534
+ text_node :numEcheckCredit, "@numEcheckCredit", :default_value=>"0"
2535
+ text_node :echeckCreditAmount, "@echeckCreditAmount", :default_value=>"0"
2536
+ text_node :numEcheckVerification, "@numEcheckVerification", :default_value=>"0"
2537
+ text_node :echeckVerificationAmount, "@echeckVerificationAmount", :default_value=>"0"
2538
+ text_node :numEcheckRedeposit, "@numEcheckRedeposit", :default_value=>"0"
2539
+ text_node :numEcheckPreNoteSale, "@numEcheckPreNoteSale", :default_value=>"0"
2540
+ text_node :numEcheckPreNoteCredit, "@numEcheckPreNoteCredit", :default_value=>"0"
2541
+ text_node :numAccountUpdates, "@numAccountUpdates", :default_value=>"0"
2542
+ text_node :numTokenRegistrations, "@numTokenRegistrations", :default_value=>"0"
2543
+ text_node :numUpdateCardValidationNumOnTokens, "@numUpdateCardValidationNumOnTokens", :default_value=>"0"
2544
+ text_node :numCancelSubscriptions,"@numCancelSubscriptions", :default_value=>"0"
2545
+ text_node :numUpdateSubscriptions,"@numUpdateSubscriptions", :default_value=>"0"
2546
+ text_node :numCreatePlans,"@numCreatePlans",:default_value=>"0"
2547
+ text_node :numUpdatePlans,"@numUpdatePlans",:default_value=>"0"
2548
+ text_node :numActivates,"@numActivates",:default_value=>"0"
2549
+ text_node :numDeactivates,"@numDeactivates",:default_value=>"0"
2550
+ text_node :activateAmount,"@activateAmount",:default_value=>"0"
2551
+ text_node :numLoads,"@numLoads",:default_value=>"0"
2552
+ text_node :loadAmount,"@loadAmount",:default_value=>"0"
2553
+ text_node :numUnloads,"@numUnloads",:default_value=>"0"
2554
+ text_node :unloadAmount,"@unloadAmount",:default_value=>"0"
2555
+ text_node :numBalanceInquirys,"@numBalanceInquirys",:default_value=>"0"
2556
+ text_node :numPayFacCredit , "@numPayFacCredit", :default_value=>"0"
2557
+ text_node :numPayFacDebit , "@numPayFacDebit", :default_value=>"0"
2558
+ text_node :numSubmerchantCredit , "@numSubmerchantCredit", :default_value=>"0"
2559
+ text_node :numSubmerchantDebit , "@numSubmerchantDebit", :default_value=>"0"
2560
+ text_node :numReserveCredit , "@numReserveCredit", :default_value=>"0"
2561
+ text_node :numReserveDebit , "@numReserveDebit", :default_value=>"0"
2562
+ text_node :numVendorDebit , "@numVendorDebit", :default_value=>"0"
2563
+ text_node :numVendorCredit , "@numVendorCredit", :default_value=>"0"
2564
+ text_node :numPhysicalCheckDebit , "@numPhysicalCheckDebit", :default_value=>"0"
2565
+ text_node :numPhysicalCheckCredit , "@numPhysicalCheckCredit", :default_value=>"0"
2566
+ text_node :numFundingInstructionVoid, "@numFundingInstructionVoid", :default_value=>"0"
2567
+ text_node :numFastAccessFunding, "@numFastAccessFunding", :default_value=>"0"
2568
+ text_node :payFacCreditAmount , "@payFacCreditAmount", :default_value=>"0"
2569
+ text_node :payFacDebitAmount , "@payFacDebitAmount", :default_value=>"0"
2570
+ text_node :submerchantCreditAmount , "@submerchantCreditAmount", :default_value=>"0"
2571
+ text_node :submerchantDebitAmount , "@submerchantDebitAmount", :default_value=>"0"
2572
+ text_node :reserveCreditAmount , "@reserveCreditAmount", :default_value=>"0"
2573
+ text_node :reserveDebitAmount , "@reserveDebitAmount", :default_value=>"0"
2574
+ text_node :vendorDebitAmount , "@vendorDebitAmount", :default_value=>"0"
2575
+ text_node :vendorCreditAmount , "@vendorCreditAmount", :default_value=>"0"
2576
+ text_node :physicalCheckDebitAmount , "@physicalCheckDebitAmount", :default_value=>"0"
2577
+ text_node :physicalCheckCreditAmount , "@physicalCheckCreditAmount", :default_value=>"0"
2578
+ text_node :fastAccessFundingAmount , "@fastAccessFundingAmount", :default_value=>"0"
2579
+ text_node :merchantId, "@merchantId", :default_value=>nil
2580
+ text_node :numTranslateToLowValueTokenRequests, "@numTranslateToLowValueTokenRequests", :default_value=>"0"
2581
+ end
2582
+
2583
+ class CnpRequest
2584
+ include XML::Mapping
2585
+ # version="6.0" xmlns="http://www.vantivcnp.com/schema" numBatchRequests = "1">
2586
+ # <authentication>
2587
+ # <user>XMLTESTV6ORG14</user>
2588
+ # <password>password</password>
2589
+ # </authentication>
2590
+ root_element_name "cnpRequest"
2591
+
2592
+ text_node :version, "@version", :default_value=>"0"
2593
+ text_node :xmlns, "@xmlns", :default_value=>nil
2594
+ #TODO: ask greg about sessionId
2595
+ #text_node :sessionId, "@id", default_vale:nil
2596
+ text_node :numBatchRequests, "@numBatchRequests", :default_value=>"0"
2597
+ object_node :authentication, "authentication", :class=>Authentication
2598
+ end
2599
+
2600
+ class AccountUpdateFileRequestData
2601
+ include XML::Mapping
2602
+ root_element_name "accountUpdateFileRequestData"
2603
+
2604
+ text_node :merchantId, "merchantId", :default_value=>nil
2605
+ text_node :postDay, "postDay", :default_value=>nil
2606
+ end
2607
+
2608
+ class CnpRFRRequest
2609
+ include XML::Mapping
2610
+ root_element_name "RFRRequest"
2611
+ optional_choice_node :if, 'cnpSessionId', :then, (text_node :cnpSessionId, "cnpSessionId"),
2612
+ :elsif, 'accountUpdateFileRequestData', :then, (object_node :accountUpdateFileRequestData, "accountUpdateFileRequestData", :class=>AccountUpdateFileRequestData)
2613
+ end
2614
+
2615
+ class CnpRequestForRFR
2616
+ include XML::Mapping
2617
+ root_element_name "cnpRequest"
2618
+ text_node :version, "@version", :default_value=>"0"
2619
+ text_node :xmlns, "@xmlns", :default_value=>nil
2620
+ text_node :numBatchRequests, "@numBatchRequests", :default_value=>nil
2621
+ object_node :authentication, "authentication", :class=>Authentication
2622
+ object_node :rfrRequest, 'RFRRequest', :class=>CnpRFRRequest
2623
+ end
2624
+
2625
+
2626
+
2627
+
2628
+
2629
+
2630
+ # begin
2631
+ # class CnpOnlineResponse
2632
+ # attr_accessor :message
2633
+ # end
2634
+ #
2635
+ # class XMLFields
2636
+ #
2637
+ # end
2638
+ end