activemerchant 1.38.0 → 1.78.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +1344 -3
  3. data/CONTRIBUTORS +154 -0
  4. data/README.md +157 -144
  5. data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
  6. data/lib/active_merchant/billing/base.rb +21 -17
  7. data/lib/active_merchant/billing/check.rb +32 -22
  8. data/lib/active_merchant/billing/compatibility.rb +120 -0
  9. data/lib/active_merchant/billing/credit_card.rb +215 -67
  10. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
  11. data/lib/active_merchant/billing/credit_card_methods.rb +149 -52
  12. data/lib/active_merchant/billing/cvv_result.rb +15 -15
  13. data/lib/active_merchant/billing/gateway.rb +170 -24
  14. data/lib/active_merchant/billing/gateways/adyen.rb +284 -0
  15. data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
  16. data/lib/active_merchant/billing/gateways/authorize_net.rb +899 -606
  17. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
  18. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
  19. data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
  20. data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
  21. data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
  22. data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
  23. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +325 -0
  24. data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
  25. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
  26. data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
  27. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
  28. data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
  29. data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
  30. data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
  31. data/lib/active_merchant/billing/gateways/borgun.rb +222 -0
  32. data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
  33. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +14 -2
  34. data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/braintree_blue.rb +372 -137
  36. data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
  37. data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
  38. data/lib/active_merchant/billing/gateways/cams.rb +230 -0
  39. data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
  40. data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
  41. data/lib/active_merchant/billing/gateways/cardknox.rb +328 -0
  42. data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
  43. data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
  44. data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
  45. data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
  46. data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
  47. data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
  48. data/lib/active_merchant/billing/gateways/checkout_v2.rb +226 -0
  49. data/lib/active_merchant/billing/gateways/citrus_pay.rb +23 -0
  50. data/lib/active_merchant/billing/gateways/clearhaus.rb +222 -0
  51. data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
  52. data/lib/active_merchant/billing/gateways/conekta.rb +224 -0
  53. data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
  54. data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
  55. data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
  56. data/lib/active_merchant/billing/gateways/cyber_source.rb +228 -98
  57. data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
  58. data/lib/active_merchant/billing/gateways/dibs.rb +205 -0
  59. data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
  60. data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
  61. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
  62. data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
  63. data/lib/active_merchant/billing/gateways/element.rb +356 -0
  64. data/lib/active_merchant/billing/gateways/epay.rb +23 -12
  65. data/lib/active_merchant/billing/gateways/eway.rb +12 -12
  66. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
  68. data/lib/active_merchant/billing/gateways/exact.rb +10 -1
  69. data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
  70. data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
  71. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
  72. data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
  73. data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
  74. data/lib/active_merchant/billing/gateways/first_pay.rb +109 -124
  75. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
  76. data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
  77. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
  78. data/lib/active_merchant/billing/gateways/forte.rb +256 -0
  79. data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
  80. data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
  81. data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
  82. data/lib/active_merchant/billing/gateways/hps.rb +305 -0
  83. data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
  84. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +2 -5
  85. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
  86. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
  87. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
  88. data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
  89. data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
  90. data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
  91. data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
  92. data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
  93. data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
  94. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
  95. data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
  96. data/lib/active_merchant/billing/gateways/kushki.rb +227 -0
  97. data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
  98. data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
  99. data/lib/active_merchant/billing/gateways/litle.rb +329 -439
  100. data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
  101. data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
  102. data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
  103. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +15 -7
  104. data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
  105. data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
  106. data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
  107. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
  108. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -14
  109. data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
  110. data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
  111. data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
  112. data/lib/active_merchant/billing/gateways/migs.rb +74 -13
  113. data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
  114. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
  115. data/lib/active_merchant/billing/gateways/monei.rb +307 -0
  116. data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
  117. data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
  118. data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
  119. data/lib/active_merchant/billing/gateways/nab_transact.rb +78 -53
  120. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
  121. data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
  122. data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
  123. data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
  124. data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
  125. data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
  126. data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
  127. data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
  128. data/lib/active_merchant/billing/gateways/omise.rb +324 -0
  129. data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
  130. data/lib/active_merchant/billing/gateways/opp.rb +372 -0
  131. data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
  132. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
  133. data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
  134. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
  135. data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
  136. data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
  137. data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
  138. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
  139. data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
  140. data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
  141. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
  142. data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
  143. data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
  144. data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
  145. data/lib/active_merchant/billing/gateways/payex.rb +412 -0
  146. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
  147. data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
  148. data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
  149. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
  150. data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
  151. data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
  152. data/lib/active_merchant/billing/gateways/paymentez.rb +283 -0
  153. data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
  154. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +41 -8
  155. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  156. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
  157. data/lib/active_merchant/billing/gateways/paypal.rb +49 -20
  158. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  159. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
  160. data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
  161. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
  162. data/lib/active_merchant/billing/gateways/payscout.rb +162 -0
  163. data/lib/active_merchant/billing/gateways/paystation.rb +22 -24
  164. data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
  165. data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
  166. data/lib/active_merchant/billing/gateways/pin.rb +68 -13
  167. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
  168. data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
  169. data/lib/active_merchant/billing/gateways/psigate.rb +3 -14
  170. data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
  171. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  172. data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
  173. data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
  174. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
  175. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
  176. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
  177. data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
  178. data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
  179. data/lib/active_merchant/billing/gateways/realex.rb +27 -25
  180. data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
  181. data/lib/active_merchant/billing/gateways/s5.rb +247 -0
  182. data/lib/active_merchant/billing/gateways/safe_charge.rb +258 -0
  183. data/lib/active_merchant/billing/gateways/sage.rb +412 -119
  184. data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
  185. data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
  186. data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
  187. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
  188. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
  189. data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
  190. data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
  191. data/lib/active_merchant/billing/gateways/smart_ps.rb +13 -2
  192. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
  193. data/lib/active_merchant/billing/gateways/spreedly_core.rb +36 -11
  194. data/lib/active_merchant/billing/gateways/stripe.rb +461 -82
  195. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
  196. data/lib/active_merchant/billing/gateways/telr.rb +275 -0
  197. data/lib/active_merchant/billing/gateways/tns.rb +22 -0
  198. data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
  199. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
  200. data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
  201. data/lib/active_merchant/billing/gateways/transnational.rb +2 -231
  202. data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
  203. data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
  204. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
  205. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +150 -63
  206. data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
  207. data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
  208. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
  209. data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
  210. data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
  211. data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
  212. data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
  213. data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
  214. data/lib/active_merchant/billing/gateways/worldpay.rb +131 -36
  215. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -0
  216. data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
  217. data/lib/active_merchant/billing/gateways.rb +8 -11
  218. data/lib/active_merchant/billing/model.rb +30 -0
  219. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
  220. data/lib/active_merchant/billing/payment_token.rb +21 -0
  221. data/lib/active_merchant/billing/rails.rb +3 -0
  222. data/lib/active_merchant/billing/response.rb +24 -17
  223. data/lib/active_merchant/billing.rb +7 -1
  224. data/lib/active_merchant/connection.rb +177 -0
  225. data/lib/active_merchant/country.rb +334 -0
  226. data/lib/active_merchant/empty.rb +20 -0
  227. data/lib/active_merchant/errors.rb +35 -0
  228. data/lib/active_merchant/network_connection_retries.rb +79 -0
  229. data/lib/active_merchant/post_data.rb +24 -0
  230. data/lib/active_merchant/posts_data.rb +84 -0
  231. data/lib/active_merchant/version.rb +1 -1
  232. data/lib/active_merchant.rb +24 -21
  233. data/lib/certs/cacert.pem +3951 -0
  234. data/lib/support/gateway_support.rb +16 -10
  235. data/lib/support/outbound_hosts.rb +13 -10
  236. metadata +161 -306
  237. data/gem-public_cert.pem +0 -20
  238. data/lib/active_merchant/billing/expiry_date.rb +0 -34
  239. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
  240. data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
  241. data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
  242. data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
  243. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
  244. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
  245. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
  246. data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
  247. data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
  248. data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
  249. data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
  250. data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
  251. data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
  252. data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -73
  253. data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
  254. data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
  255. data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
  256. data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
  257. data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
  258. data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
  259. data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
  260. data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
  261. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
  262. data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
  263. data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
  264. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
  265. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
  266. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
  267. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
  268. data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
  269. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
  270. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
  271. data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
  272. data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
  273. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
  274. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
  275. data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
  276. data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
  277. data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
  278. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
  279. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
  280. data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
  281. data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
  282. data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
  283. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
  284. data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
  285. data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
  286. data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
  287. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
  288. data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
  289. data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
  290. data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
  291. data/lib/active_merchant/billing/integrations/epay.rb +0 -21
  292. data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
  293. data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
  294. data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
  295. data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
  296. data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
  297. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
  298. data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
  299. data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
  300. data/lib/active_merchant/billing/integrations/helper.rb +0 -117
  301. data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
  302. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
  303. data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
  304. data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
  305. data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -114
  306. data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
  307. data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
  308. data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
  309. data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
  310. data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
  311. data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
  312. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
  313. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
  314. data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
  315. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
  316. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -129
  317. data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
  318. data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
  319. data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
  320. data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
  321. data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
  322. data/lib/active_merchant/billing/integrations/notification.rb +0 -71
  323. data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
  324. data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
  325. data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
  326. data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
  327. data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
  328. data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
  329. data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
  330. data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
  331. data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
  332. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
  333. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
  334. data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
  335. data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
  336. data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
  337. data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
  338. data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
  339. data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
  340. data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
  341. data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
  342. data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -28
  343. data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
  344. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
  345. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
  346. data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
  347. data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
  348. data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
  349. data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
  350. data/lib/active_merchant/billing/integrations/platron.rb +0 -28
  351. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
  352. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
  353. data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
  354. data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
  355. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -74
  356. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
  357. data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
  358. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
  359. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
  360. data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
  361. data/lib/active_merchant/billing/integrations/return.rb +0 -42
  362. data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
  363. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
  364. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
  365. data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
  366. data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
  367. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
  368. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
  369. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
  370. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
  371. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
  372. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -91
  373. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
  374. data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
  375. data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
  376. data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
  377. data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
  378. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
  379. data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
  380. data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
  381. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
  382. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
  383. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
  384. data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
  385. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
  386. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
  387. data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
  388. data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
  389. data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
  390. data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
  391. data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
  392. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
  393. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
  394. data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
  395. data/lib/active_merchant/billing/integrations.rb +0 -17
  396. data.tar.gz.sig +0 -0
  397. metadata.gz.sig +0 -0
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  module Billing #:nodoc:
6
6
  # ==== USA ePay Advanced SOAP Interface
7
7
  #
8
- # This class encapuslates USA ePay's Advanced SOAP Interface. The Advanced Soap Interface allows
8
+ # This class encapsulates USA ePay's Advanced SOAP Interface. The Advanced Soap Interface allows
9
9
  # standard transactions, storing customer information, and recurring billing. Storing sensitive
10
10
  # information on USA ePay's servers can help with PCI DSS compliance, since customer and card data
11
11
  # do not need to be stored locally.
@@ -77,12 +77,14 @@ module ActiveMerchant #:nodoc:
77
77
  self.homepage_url = 'http://www.usaepay.com/'
78
78
  self.display_name = 'USA ePay Advanced SOAP Interface'
79
79
 
80
- CUSTOMER_OPTIONS = {
80
+ CUSTOMER_PROFILE_OPTIONS = {
81
81
  :id => [:string, 'CustomerID'], # merchant assigned number
82
82
  :notes => [:string, 'Notes'],
83
83
  :data => [:string, 'CustomData'],
84
- :url => [:string, 'URL'],
85
- # Recurring Billing
84
+ :url => [:string, 'URL']
85
+ } #:nodoc:
86
+
87
+ CUSTOMER_RECURRING_BILLING_OPTIONS = {
86
88
  :enabled => [:boolean, 'Enabled'],
87
89
  :schedule => [:string, 'Schedule'],
88
90
  :number_left => [:integer, 'NumLeft'],
@@ -92,18 +94,24 @@ module ActiveMerchant #:nodoc:
92
94
  :user => [:string, 'User'],
93
95
  :source => [:string, 'Source'],
94
96
  :send_receipt => [:boolean, 'SendReceipt'],
95
- :receipt_note => [:string, 'ReceiptNote'],
96
- # Point of Sale
97
+ :receipt_note => [:string, 'ReceiptNote']
98
+ } #:nodoc:
99
+
100
+ CUSTOMER_POINT_OF_SALE_OPTIONS = {
97
101
  :price_tier => [:string, 'PriceTier'],
98
102
  :tax_class => [:string, 'TaxClass'],
99
103
  :lookup_code => [:string, 'LookupCode']
100
104
  } #:nodoc:
101
105
 
102
- ADDRESS_OPTIONS = {
106
+ CUSTOMER_OPTIONS = [
107
+ CUSTOMER_PROFILE_OPTIONS,
108
+ CUSTOMER_RECURRING_BILLING_OPTIONS,
109
+ CUSTOMER_POINT_OF_SALE_OPTIONS
110
+ ].inject(:merge) #:nodoc:
111
+
112
+ COMMON_ADDRESS_OPTIONS = {
103
113
  :first_name => [:string, 'FirstName'],
104
114
  :last_name => [:string, 'LastName'],
105
- :address1 => [:string, 'Street'],
106
- :address2 => [:string, 'Street2'],
107
115
  :city => [:string, 'City'],
108
116
  :state => [:string, 'State'],
109
117
  :zip => [:string, 'Zip'],
@@ -114,6 +122,32 @@ module ActiveMerchant #:nodoc:
114
122
  :company => [:string, 'Company']
115
123
  } #:nodoc:
116
124
 
125
+ ADDRESS_OPTIONS = [
126
+ COMMON_ADDRESS_OPTIONS,
127
+ {
128
+ :address1 => [:string, 'Street'],
129
+ :address2 => [:string, 'Street2'],
130
+ }
131
+ ].inject(:merge) #:nodoc
132
+
133
+ CUSTOMER_UPDATE_DATA_FIELDS = [
134
+ CUSTOMER_PROFILE_OPTIONS,
135
+ CUSTOMER_RECURRING_BILLING_OPTIONS,
136
+ COMMON_ADDRESS_OPTIONS,
137
+ {
138
+ :address1 => [:string, 'Address'],
139
+ :address2 => [:string, 'Address2'],
140
+ },
141
+ {
142
+ :card_number => [:string, 'CardNumber'],
143
+ :card_exp => [:string, 'CardExp'],
144
+ :account => [:string, 'Account'],
145
+ :routing => [:string, 'Routing'],
146
+ :check_format => [:string, 'CheckFormat'],
147
+ :record_type => [:string, 'RecordType'],
148
+ }
149
+ ].inject(:merge) #:nodoc
150
+
117
151
  CUSTOMER_TRANSACTION_REQUEST_OPTIONS = {
118
152
  :command => [:string, 'Command'],
119
153
  :ignore_duplicate => [:boolean, 'IgnoreDuplicate'],
@@ -124,7 +158,8 @@ module ActiveMerchant #:nodoc:
124
158
  :merchant_receipt => [:boolean, 'MerchReceipt'],
125
159
  :merchant_email => [:boolean, 'MerchReceiptEmail'],
126
160
  :merchant_template => [:boolean, 'MerchReceiptName'],
127
- :verification_value => [:boolean, 'isRecurring'],
161
+ :recurring => [:boolean, 'isRecurring'],
162
+ :verification_value => [:string, 'CardCode'],
128
163
  :software => [:string, 'Software']
129
164
  } #:nodoc:
130
165
 
@@ -179,7 +214,6 @@ module ActiveMerchant #:nodoc:
179
214
  } #:nodoc:
180
215
 
181
216
  CHECK_DATA_OPTIONS = {
182
- :check_number => [:integer, 'CheckNumber'],
183
217
  :drivers_license => [:string, 'DriversLicense'],
184
218
  :drivers_license_state => [:string, 'DriversLicenseState'],
185
219
  :record_type => [:string, 'RecordType'],
@@ -292,7 +326,7 @@ module ActiveMerchant #:nodoc:
292
326
  end
293
327
 
294
328
  def credit(money, identification, options={})
295
- deprecated CREDIT_DEPRECATION_MESSAGE
329
+ ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
296
330
  refund(money, identification, options)
297
331
  end
298
332
 
@@ -339,9 +373,10 @@ module ActiveMerchant #:nodoc:
339
373
  commit(__method__, request)
340
374
  end
341
375
 
342
- # Update a customer by replacing all of the customer details..
376
+ # Update a customer by replacing all of the customer details.
343
377
  #
344
- # Use quickUpdateCustomer to just update a few attributes.
378
+ # ==== Required
379
+ # * <tt>:customer_number</tt> -- customer to update
345
380
  #
346
381
  # ==== Options
347
382
  # * Same as add_customer
@@ -353,9 +388,58 @@ module ActiveMerchant #:nodoc:
353
388
  commit(__method__, request)
354
389
  end
355
390
 
391
+ # Update a customer by replacing only the provided fields.
392
+ #
393
+ # ==== Required
394
+ # * <tt>:customer_number</tt> -- customer to update
395
+ # * <tt>:update_data</tt> -- FieldValue array of fields to retrieve
396
+ # * <tt>:first_name</tt>
397
+ # * <tt>:last_name</tt>
398
+ # * <tt>:id</tt>
399
+ # * <tt>:company</tt>
400
+ # * <tt>:address</tt>
401
+ # * <tt>:address2</tt>
402
+ # * <tt>:city</tt>
403
+ # * <tt>:state</tt>
404
+ # * <tt>:zip</tt>
405
+ # * <tt>:country</tt>
406
+ # * <tt>:phone</tt>
407
+ # * <tt>:fax</tt>
408
+ # * <tt>:email</tt>
409
+ # * <tt>:url</tt>
410
+ # * <tt>:receipt_note</tt>
411
+ # * <tt>:send_receipt</tt>
412
+ # * <tt>:notes</tt>
413
+ # * <tt>:description</tt>
414
+ # * <tt>:order_id</tt>
415
+ # * <tt>:enabled</tt>
416
+ # * <tt>:schedule</tt>
417
+ # * <tt>:next</tt>
418
+ # * <tt>:num_left</tt>
419
+ # * <tt>:amount</tt>
420
+ # * <tt>:custom_data</tt>
421
+ # * <tt>:source</tt>
422
+ # * <tt>:user</tt>
423
+ # * <tt>:card_number</tt>
424
+ # * <tt>:card_exp</tt>
425
+ # * <tt>:account</tt>
426
+ # * <tt>:routing</tt>
427
+ # * <tt>:check_format</tt> or <tt>:record_type</tt>
428
+ #
429
+ # ==== Response
430
+ # * <tt>#message</tt> -- boolean; Returns true if successful. Exception thrown all failures.
431
+ #
432
+ def quick_update_customer(options={})
433
+ requires! options, :customer_number
434
+ requires! options, :update_data
435
+
436
+ request = build_request(__method__, options)
437
+ commit(__method__, request)
438
+ end
439
+
356
440
  # Enable a customer for recurring billing.
357
441
  #
358
- # Note: Customer does not need to have all recurring paramerters to succeed.
442
+ # Note: Customer does not need to have all recurring parameters to succeed.
359
443
  #
360
444
  # ==== Required
361
445
  # * <tt>:customer_number</tt>
@@ -402,7 +486,7 @@ module ActiveMerchant #:nodoc:
402
486
  commit(__method__, request)
403
487
  end
404
488
 
405
- # Retrive all of the payment methods belonging to a customer
489
+ # Retrieve all of the payment methods belonging to a customer
406
490
  #
407
491
  # ==== Required
408
492
  # * <tt>:customer_number</tt>
@@ -417,7 +501,7 @@ module ActiveMerchant #:nodoc:
417
501
  commit(__method__, request)
418
502
  end
419
503
 
420
- # Retrive one of the payment methods belonging to a customer
504
+ # Retrieve one of the payment methods belonging to a customer
421
505
  #
422
506
  # ==== Required
423
507
  # * <tt>:customer_number</tt>
@@ -454,7 +538,7 @@ module ActiveMerchant #:nodoc:
454
538
  commit(__method__, request)
455
539
  end
456
540
 
457
- # Delete one the payment methods beloning to a customer
541
+ # Delete one the payment methods belonging to a customer
458
542
  #
459
543
  # ==== Required
460
544
  # * <tt>:customer_number</tt>
@@ -543,11 +627,11 @@ module ActiveMerchant #:nodoc:
543
627
  # will be returned in the response.
544
628
  #
545
629
  # ==== Options
546
- # * <tt>:method</tt> -- credit_card or check
630
+ # * <tt>:payment_method</tt> -- credit_card or check
547
631
  # * <tt>:command</tt> -- sale, credit, void, creditvoid, authonly, capture, postauth, check, checkcredit; defaults to sale; only required for run_transaction when other than sale
548
632
  # * <tt>:reference_number</tt> -- for the original transaction; obtained by sale or authonly
549
633
  # * <tt>:authorization_code</tt> -- required for postauth; obtained offline
550
- # * <tt>:ignore_duplicate</tt> -- set +true+ if you want to override the duplicate tranaction handling
634
+ # * <tt>:ignore_duplicate</tt> -- set +true+ if you want to override the duplicate transaction handling
551
635
  # * <tt>:account_holder</tt> -- name of account holder
552
636
  # * <tt>:customer_id</tt> -- merchant assigned id
553
637
  # * <tt>:customer_receipt</tt> -- set +true+ to email receipt to billing email address
@@ -680,7 +764,7 @@ module ActiveMerchant #:nodoc:
680
764
  commit(__method__, request)
681
765
  end
682
766
 
683
- # Override transaction flagged for mananager approval.
767
+ # Override transaction flagged for manager approval.
684
768
  #
685
769
  # Note: Checks only!
686
770
  #
@@ -954,8 +1038,8 @@ module ActiveMerchant #:nodoc:
954
1038
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
955
1039
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
956
1040
  'xmlns:SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/',
957
- 'SOAP-ENV:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' do |soap|
958
- soap.tag! "SOAP-ENV:Body" do |soap|
1041
+ 'SOAP-ENV:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' do
1042
+ soap.tag! "SOAP-ENV:Body" do
959
1043
  send("build_#{action}", soap, options)
960
1044
  end
961
1045
  end
@@ -971,9 +1055,9 @@ module ActiveMerchant #:nodoc:
971
1055
  def build_token(soap, options)
972
1056
  seed = SecureRandom.base64(32)
973
1057
  hash = Digest::SHA1.hexdigest("#{@options[:login]}#{seed}#{@options[:password].to_s.strip}")
974
- soap.Token 'xsi:type' => 'ns1:ueSecurityToken' do |soap|
1058
+ soap.Token 'xsi:type' => 'ns1:ueSecurityToken' do
975
1059
  build_tag soap, :string, 'ClientIP', options[:client_ip]
976
- soap.PinHash 'xsi:type' => 'ns1:ueHash' do |soap|
1060
+ soap.PinHash 'xsi:type' => 'ns1:ueHash' do
977
1061
  build_tag soap, :string, "HashValue", hash
978
1062
  build_tag soap, :string, "Seed", seed
979
1063
  build_tag soap, :string, "Type", 'sha1'
@@ -985,7 +1069,7 @@ module ActiveMerchant #:nodoc:
985
1069
  # Customer ======================================================
986
1070
 
987
1071
  def build_add_customer(soap, options)
988
- soap.tag! "ns1:addCustomer" do |soap|
1072
+ soap.tag! "ns1:addCustomer" do
989
1073
  build_token soap, options
990
1074
  build_customer_data soap, options
991
1075
  build_tag soap, :double, 'Amount', amount(options[:amount])
@@ -995,7 +1079,7 @@ module ActiveMerchant #:nodoc:
995
1079
  end
996
1080
 
997
1081
  def build_customer(soap, options, type, add_customer_data=false)
998
- soap.tag! "ns1:#{type}" do |soap|
1082
+ soap.tag! "ns1:#{type}" do
999
1083
  build_token soap, options
1000
1084
  build_tag soap, :integer, 'CustNum', options[:customer_number]
1001
1085
  build_customer_data soap, options if add_customer_data
@@ -1018,8 +1102,16 @@ module ActiveMerchant #:nodoc:
1018
1102
  build_customer(soap, options, 'deleteCustomer')
1019
1103
  end
1020
1104
 
1105
+ def build_quick_update_customer(soap, options)
1106
+ soap.tag! "ns1:quickUpdateCustomer" do
1107
+ build_token soap, options
1108
+ build_tag soap, :integer, 'CustNum', options[:customer_number]
1109
+ build_field_value_array soap, "UpdateData", "FieldValue", options[:update_data], CUSTOMER_UPDATE_DATA_FIELDS
1110
+ end
1111
+ end
1112
+
1021
1113
  def build_add_customer_payment_method(soap, options)
1022
- soap.tag! "ns1:addCustomerPaymentMethod" do |soap|
1114
+ soap.tag! "ns1:addCustomerPaymentMethod" do
1023
1115
  build_token soap, options
1024
1116
  build_tag soap, :integer, 'CustNum', options[:customer_number]
1025
1117
  build_customer_payment_methods soap, options
@@ -1029,7 +1121,7 @@ module ActiveMerchant #:nodoc:
1029
1121
  end
1030
1122
 
1031
1123
  def build_get_customer_payment_method(soap, options)
1032
- soap.tag! 'ns1:getCustomerPaymentMethod' do |soap|
1124
+ soap.tag! 'ns1:getCustomerPaymentMethod' do
1033
1125
  build_token soap, options
1034
1126
  build_tag soap, :integer, 'CustNum', options[:customer_number]
1035
1127
  build_tag soap, :integer, 'MethodID', options[:method_id]
@@ -1041,7 +1133,7 @@ module ActiveMerchant #:nodoc:
1041
1133
  end
1042
1134
 
1043
1135
  def build_update_customer_payment_method(soap, options)
1044
- soap.tag! 'ns1:updateCustomerPaymentMethod' do |soap|
1136
+ soap.tag! 'ns1:updateCustomerPaymentMethod' do
1045
1137
  build_token soap, options
1046
1138
  build_customer_payment_methods soap, options
1047
1139
  build_tag soap, :boolean, 'Verify', options[:verify]
@@ -1049,7 +1141,7 @@ module ActiveMerchant #:nodoc:
1049
1141
  end
1050
1142
 
1051
1143
  def build_delete_customer_payment_method(soap, options)
1052
- soap.tag! "ns1:deleteCustomerPaymentMethod" do |soap|
1144
+ soap.tag! "ns1:deleteCustomerPaymentMethod" do
1053
1145
  build_token soap, options
1054
1146
  build_tag soap, :integer, 'Custnum', options[:customer_number]
1055
1147
  build_tag soap, :integer, 'PaymentMethodID', options[:method_id]
@@ -1057,7 +1149,7 @@ module ActiveMerchant #:nodoc:
1057
1149
  end
1058
1150
 
1059
1151
  def build_run_customer_transaction(soap, options)
1060
- soap.tag! "ns1:runCustomerTransaction" do |soap|
1152
+ soap.tag! "ns1:runCustomerTransaction" do
1061
1153
  build_token soap, options
1062
1154
  build_tag soap, :integer, 'CustNum', options[:customer_number]
1063
1155
  build_tag soap, :integer, 'PaymentMethodID', options[:method_id] || 0
@@ -1068,56 +1160,56 @@ module ActiveMerchant #:nodoc:
1068
1160
  # Transactions ==================================================
1069
1161
 
1070
1162
  def build_run_transaction(soap, options)
1071
- soap.tag! 'ns1:runTransaction' do |soap|
1163
+ soap.tag! 'ns1:runTransaction' do
1072
1164
  build_token soap, options
1073
1165
  build_transaction_request_object soap, options, 'Parameters'
1074
1166
  end
1075
1167
  end
1076
1168
 
1077
1169
  def build_run_sale(soap, options)
1078
- soap.tag! 'ns1:runSale' do |soap|
1170
+ soap.tag! 'ns1:runSale' do
1079
1171
  build_token soap, options
1080
1172
  build_transaction_request_object soap, options
1081
1173
  end
1082
1174
  end
1083
1175
 
1084
1176
  def build_run_auth_only(soap, options)
1085
- soap.tag! 'ns1:runAuthOnly' do |soap|
1177
+ soap.tag! 'ns1:runAuthOnly' do
1086
1178
  build_token soap, options
1087
1179
  build_transaction_request_object soap, options
1088
1180
  end
1089
1181
  end
1090
1182
 
1091
1183
  def build_run_credit(soap, options)
1092
- soap.tag! 'ns1:runCredit' do |soap|
1184
+ soap.tag! 'ns1:runCredit' do
1093
1185
  build_token soap, options
1094
1186
  build_transaction_request_object soap, options
1095
1187
  end
1096
1188
  end
1097
1189
 
1098
1190
  def build_run_check_sale(soap, options)
1099
- soap.tag! 'ns1:runCheckSale' do |soap|
1191
+ soap.tag! 'ns1:runCheckSale' do
1100
1192
  build_token soap, options
1101
1193
  build_transaction_request_object soap, options
1102
1194
  end
1103
1195
  end
1104
1196
 
1105
1197
  def build_run_check_credit(soap, options)
1106
- soap.tag! 'ns1:runCheckCredit' do |soap|
1198
+ soap.tag! 'ns1:runCheckCredit' do
1107
1199
  build_token soap, options
1108
1200
  build_transaction_request_object soap, options
1109
1201
  end
1110
1202
  end
1111
1203
 
1112
1204
  def build_post_auth(soap, options)
1113
- soap.tag! 'ns1:postAuth' do |soap|
1205
+ soap.tag! 'ns1:postAuth' do
1114
1206
  build_token soap, options
1115
1207
  build_transaction_request_object soap, options
1116
1208
  end
1117
1209
  end
1118
1210
 
1119
1211
  def build_run_quick_sale(soap, options)
1120
- soap.tag! 'ns1:runQuickSale' do |soap|
1212
+ soap.tag! 'ns1:runQuickSale' do
1121
1213
  build_token soap, options
1122
1214
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1123
1215
  build_transaction_detail soap, options
@@ -1126,7 +1218,7 @@ module ActiveMerchant #:nodoc:
1126
1218
  end
1127
1219
 
1128
1220
  def build_run_quick_credit(soap, options)
1129
- soap.tag! 'ns1:runQuickCredit' do |soap|
1221
+ soap.tag! 'ns1:runQuickCredit' do
1130
1222
  build_token soap, options
1131
1223
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1132
1224
  build_transaction_detail soap, options
@@ -1134,21 +1226,21 @@ module ActiveMerchant #:nodoc:
1134
1226
  end
1135
1227
 
1136
1228
  def build_get_transaction(soap, options)
1137
- soap.tag! "ns1:getTransaction" do |soap|
1229
+ soap.tag! "ns1:getTransaction" do
1138
1230
  build_token soap, options
1139
1231
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1140
1232
  end
1141
1233
  end
1142
1234
 
1143
1235
  def build_get_transaction_status(soap, options)
1144
- soap.tag! "ns1:getTransactionStatus" do |soap|
1236
+ soap.tag! "ns1:getTransactionStatus" do
1145
1237
  build_token soap, options
1146
1238
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1147
1239
  end
1148
1240
  end
1149
1241
 
1150
1242
  def build_get_transaction_custom(soap, options)
1151
- soap.tag! "ns1:getTransactionCustom" do |soap|
1243
+ soap.tag! "ns1:getTransactionCustom" do
1152
1244
  build_token soap, options
1153
1245
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1154
1246
  build_transaction_field_array soap, options
@@ -1156,29 +1248,29 @@ module ActiveMerchant #:nodoc:
1156
1248
  end
1157
1249
 
1158
1250
  def build_get_check_trace(soap, options)
1159
- soap.tag! "ns1:getCheckTrace" do |soap|
1251
+ soap.tag! "ns1:getCheckTrace" do
1160
1252
  build_token soap, options
1161
1253
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1162
1254
  end
1163
1255
  end
1164
1256
 
1165
1257
  def build_capture_transaction(soap, options)
1166
- soap.tag! "ns1:captureTransaction" do |soap|
1258
+ soap.tag! "ns1:captureTransaction" do
1167
1259
  build_token soap, options
1168
1260
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1169
- build_tag soap, :double, 'RefNum', amount(options[:amount])
1261
+ build_tag soap, :double, 'Amount', amount(options[:amount])
1170
1262
  end
1171
1263
  end
1172
1264
 
1173
1265
  def build_void_transaction(soap, options)
1174
- soap.tag! "ns1:voidTransaction" do |soap|
1266
+ soap.tag! "ns1:voidTransaction" do
1175
1267
  build_token soap, options
1176
1268
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1177
1269
  end
1178
1270
  end
1179
1271
 
1180
1272
  def build_refund_transaction(soap, options)
1181
- soap.tag! "ns1:refundTransaction" do |soap|
1273
+ soap.tag! "ns1:refundTransaction" do
1182
1274
  build_token soap, options
1183
1275
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1184
1276
  build_tag soap, :integer, 'Amount', amount(options[:amount])
@@ -1186,7 +1278,7 @@ module ActiveMerchant #:nodoc:
1186
1278
  end
1187
1279
 
1188
1280
  def build_override_transaction(soap, options)
1189
- soap.tag! "ns1:overrideTransaction" do |soap|
1281
+ soap.tag! "ns1:overrideTransaction" do
1190
1282
  build_token soap, options
1191
1283
  build_tag soap, :integer, 'RefNum', options[:reference_number]
1192
1284
  build_tag soap, :string, 'Reason', options[:reason]
@@ -1196,7 +1288,7 @@ module ActiveMerchant #:nodoc:
1196
1288
  # Account =======================================================
1197
1289
 
1198
1290
  def build_get_account_details(soap, options)
1199
- soap.tag! "ns1:getAccountDetails" do |soap|
1291
+ soap.tag! "ns1:getAccountDetails" do
1200
1292
  build_token soap, options
1201
1293
  end
1202
1294
  end
@@ -1218,7 +1310,7 @@ module ActiveMerchant #:nodoc:
1218
1310
  if options[:payment_methods]
1219
1311
  length = options[:payment_methods].length
1220
1312
  soap.PaymentMethods 'SOAP-ENC:arrayType' => "ns1:PaymentMethod[#{length}]",
1221
- 'xsi:type' =>"ns1:PaymentMethodArray" do |soap|
1313
+ 'xsi:type' =>"ns1:PaymentMethodArray" do
1222
1314
  build_customer_payment_methods soap, options
1223
1315
  end
1224
1316
  end
@@ -1244,16 +1336,18 @@ module ActiveMerchant #:nodoc:
1244
1336
  when payment_method[:method].kind_of?(ActiveMerchant::Billing::CreditCard)
1245
1337
  build_tag soap, :string, 'CardNumber', payment_method[:method].number
1246
1338
  build_tag soap, :string, 'CardExpiration',
1247
- "#{"%02d" % payment_method[:method].month}#{payment_method[:method].year}"
1339
+ "#{"%02d" % payment_method[:method].month}#{payment_method[:method].year.to_s[-2..-1]}"
1248
1340
  if options[:billing_address]
1249
1341
  build_tag soap, :string, 'AvsStreet', options[:billing_address][:address1]
1250
1342
  build_tag soap, :string, 'AvsZip', options[:billing_address][:zip]
1251
1343
  end
1252
1344
  build_tag soap, :string, 'CardCode', payment_method[:method].verification_value
1253
1345
  when payment_method[:method].kind_of?(ActiveMerchant::Billing::Check)
1254
- build_tag soap, :string, 'Account', payment_method[:method].number
1346
+ build_tag soap, :string, 'Account', payment_method[:method].account_number
1255
1347
  build_tag soap, :string, 'Routing', payment_method[:method].routing_number
1256
- build_tag soap, :string, 'AccountType', payment_method[:method].account_type.capitalize
1348
+ unless payment_method[:method].account_type.nil?
1349
+ build_tag soap, :string, 'AccountType', payment_method[:method].account_type.capitalize
1350
+ end
1257
1351
  build_tag soap, :string, 'DriversLicense', options[:drivers_license]
1258
1352
  build_tag soap, :string, 'DriversLicenseState', options[:drivers_license_state]
1259
1353
  build_tag soap, :string, 'RecordType', options[:record_type]
@@ -1263,7 +1357,7 @@ module ActiveMerchant #:nodoc:
1263
1357
  def build_customer_payment_methods(soap, options)
1264
1358
  payment_methods, tag_name = extract_methods_and_tag(options)
1265
1359
  payment_methods.each do |payment_method|
1266
- soap.tag! tag_name, 'xsi:type' => "ns1:PaymentMethod" do |soap|
1360
+ soap.tag! tag_name, 'xsi:type' => "ns1:PaymentMethod" do
1267
1361
  build_tag soap, :integer, 'MethodID', payment_method[:method_id]
1268
1362
  build_tag soap, :string, 'MethodType', payment_method[:type]
1269
1363
  build_tag soap, :string, 'MethodName', payment_method[:name]
@@ -1274,7 +1368,7 @@ module ActiveMerchant #:nodoc:
1274
1368
  end
1275
1369
 
1276
1370
  def build_customer_transaction(soap, options)
1277
- soap.Parameters 'xsi:type' => "ns1:CustomerTransactionRequest" do |soap|
1371
+ soap.Parameters 'xsi:type' => "ns1:CustomerTransactionRequest" do
1278
1372
  build_transaction_detail soap, options
1279
1373
  CUSTOMER_TRANSACTION_REQUEST_OPTIONS.each do |k,v|
1280
1374
  build_tag soap, v[0], v[1], options[k]
@@ -1287,7 +1381,7 @@ module ActiveMerchant #:nodoc:
1287
1381
  # Transaction Helpers ===========================================
1288
1382
 
1289
1383
  def build_transaction_request_object(soap, options, name='Params')
1290
- soap.tag! name, 'xsi:type' => "ns1:TransactionRequestObject" do |soap|
1384
+ soap.tag! name, 'xsi:type' => "ns1:TransactionRequestObject" do
1291
1385
  TRANSACTION_REQUEST_OBJECT_OPTIONS.each do |k,v|
1292
1386
  build_tag soap, v[0], v[1], options[k]
1293
1387
  end
@@ -1310,7 +1404,7 @@ module ActiveMerchant #:nodoc:
1310
1404
  end
1311
1405
 
1312
1406
  def build_transaction_detail(soap, options)
1313
- soap.Details 'xsi:type' => "ns1:TransactionDetail" do |soap|
1407
+ soap.Details 'xsi:type' => "ns1:TransactionDetail" do
1314
1408
  TRANSACTION_DETAIL_OPTIONS.each do |k,v|
1315
1409
  build_tag soap, v[0], v[1], options[k]
1316
1410
  end
@@ -1321,10 +1415,9 @@ module ActiveMerchant #:nodoc:
1321
1415
  end
1322
1416
 
1323
1417
  def build_credit_card_data(soap, options)
1324
- soap.CreditCardData 'xsi:type' => "ns1:CreditCardData" do |soap|
1418
+ soap.CreditCardData 'xsi:type' => "ns1:CreditCardData" do
1325
1419
  build_tag soap, :string, 'CardNumber', options[:payment_method].number
1326
- build_tag soap, :string, 'CardExpiration',
1327
- "#{"%02d" % options[:payment_method].month}#{options[:payment_method].year}"
1420
+ build_tag soap, :string, 'CardExpiration', build_card_expiration(options)
1328
1421
  if options[:billing_address]
1329
1422
  build_tag soap, :string, 'AvsStreet', options[:billing_address][:address1]
1330
1423
  build_tag soap, :string, 'AvsZip', options[:billing_address][:zip]
@@ -1337,8 +1430,17 @@ module ActiveMerchant #:nodoc:
1337
1430
  end
1338
1431
  end
1339
1432
 
1433
+ def build_card_expiration(options)
1434
+ month = options[:payment_method].month
1435
+ year = options[:payment_method].year
1436
+ unless month.nil? || year.nil?
1437
+ "#{"%02d" % month}#{year.to_s[-2..-1]}"
1438
+ end
1439
+ end
1440
+
1340
1441
  def build_check_data(soap, options)
1341
- soap.CheckData 'xsi:type' => "ns1:CheckData" do |soap|
1442
+ soap.CheckData 'xsi:type' => "ns1:CheckData" do
1443
+ build_tag soap, :integer, 'CheckNumber', options[:payment_method].number
1342
1444
  build_tag soap, :string, 'Account', options[:payment_method].account_number
1343
1445
  build_tag soap, :string, 'Routing', options[:payment_method].routing_number
1344
1446
  build_tag soap, :string, 'AccountType', options[:payment_method].account_type.capitalize
@@ -1350,7 +1452,7 @@ module ActiveMerchant #:nodoc:
1350
1452
 
1351
1453
  def build_recurring_billing(soap, options)
1352
1454
  if options[:recurring]
1353
- soap.RecurringBilling 'xsi:type' => "ns1:RecurringBilling" do |soap|
1455
+ soap.RecurringBilling 'xsi:type' => "ns1:RecurringBilling" do
1354
1456
  build_tag soap, :double, 'Amount', amount(options[:recurring][:amount])
1355
1457
  build_tag soap, :string, 'Next', options[:recurring][:next].strftime("%Y-%m-%d") if options[:recurring][:next]
1356
1458
  build_tag soap, :string, 'Expire', options[:recurring][:expire].strftime("%Y-%m-%d") if options[:recurring][:expire]
@@ -1362,7 +1464,7 @@ module ActiveMerchant #:nodoc:
1362
1464
  end
1363
1465
 
1364
1466
  def build_transaction_field_array(soap, options)
1365
- soap.Fields 'SOAP-ENC:arryType' => "xsd:string[#{options[:fields].length}]", 'xsi:type' => 'ns1:stringArray' do |soap|
1467
+ soap.Fields 'SOAP-ENC:arryType' => "xsd:string[#{options[:fields].length}]", 'xsi:type' => 'ns1:stringArray' do
1366
1468
  options[:fields].each do |field|
1367
1469
  build_tag soap, :string, 'item', field
1368
1470
  end
@@ -1374,8 +1476,7 @@ module ActiveMerchant #:nodoc:
1374
1476
  def build_billing_address(soap, options)
1375
1477
  if options[:billing_address]
1376
1478
  if options[:billing_address][:name]
1377
- name = options[:billing_address][:name].split(nil,2) # divide name
1378
- options[:billing_address][:first_name], options[:billing_address][:last_name] = name[0], name[1]
1479
+ options[:billing_address][:first_name], options[:billing_address][:last_name] = split_names(options[:billing_address][:name])
1379
1480
  end
1380
1481
  soap.BillingAddress 'xsi:type' => "ns1:Address" do
1381
1482
  ADDRESS_OPTIONS.each do |k,v|
@@ -1388,8 +1489,7 @@ module ActiveMerchant #:nodoc:
1388
1489
  def build_shipping_address(soap, options)
1389
1490
  if options[:shipping_address]
1390
1491
  if options[:shipping_address][:name]
1391
- name = options[:shipping_address][:name].split(nil,2) # divide name
1392
- options[:shipping_address][:first_name], options[:shipping_address][:last_name] = name[0], name[1]
1492
+ options[:shipping_address][:first_name], options[:shipping_address][:last_name] = split_names(options[:shipping_address][:name])
1393
1493
  end
1394
1494
  soap.ShippingAddress 'xsi:type' => "ns1:Address" do
1395
1495
  ADDRESS_OPTIONS.each do |k,v|
@@ -1399,6 +1499,21 @@ module ActiveMerchant #:nodoc:
1399
1499
  end
1400
1500
  end
1401
1501
 
1502
+ def build_field_value_array(soap, tag_name, type, custom_data, fields)
1503
+ soap.tag! tag_name, 'SOAP-ENC:arryType' => "xsd:#{type}[#{options.length}]", 'xsi:type' => "ns1:#{type}Array" do
1504
+ custom_data.each do |k, v|
1505
+ build_field_value soap, fields[k][1], v, fields[k][0] if fields.keys.include? k
1506
+ end
1507
+ end
1508
+ end
1509
+
1510
+ def build_field_value(soap, field, value, value_type)
1511
+ soap.FieldValue 'xsi:type' => 'ns1:FieldValue' do
1512
+ build_tag soap, :string, 'Field', field
1513
+ build_tag soap, value_type, 'Value', value
1514
+ end
1515
+ end
1516
+
1402
1517
  def build_line_items(soap, options) # TODO
1403
1518
  end
1404
1519
 
@@ -1416,7 +1531,7 @@ module ActiveMerchant #:nodoc:
1416
1531
  soap = error.response.body
1417
1532
  end
1418
1533
 
1419
- response = build_response(action, soap)
1534
+ build_response(action, soap)
1420
1535
  end
1421
1536
 
1422
1537
  def build_response(action, soap)
@@ -1424,9 +1539,12 @@ module ActiveMerchant #:nodoc:
1424
1539
 
1425
1540
  response_params.merge!('soap_response' => soap) if @options[:soap_response]
1426
1541
 
1427
- response = Response.new(
1428
- success, message, response_params,
1429
- :test => test?, :authorization => authorization,
1542
+ Response.new(
1543
+ success,
1544
+ message,
1545
+ response_params,
1546
+ :test => test?,
1547
+ :authorization => authorization,
1430
1548
  :avs_result => avs_from(avs),
1431
1549
  :cvv_result => cvv
1432
1550
  )
@@ -1461,7 +1579,8 @@ module ActiveMerchant #:nodoc:
1461
1579
  when :get_customer_payment_methods
1462
1580
  p['item']
1463
1581
  when :get_transaction_custom
1464
- p['item'].inject({}) { |map, field| map[field['field']] = field['value']; map }
1582
+ items = p['item'].kind_of?(Array) ? p['item'] : [p['item']]
1583
+ items.inject({}) { |hash, item| hash[item['field']] = item['value']; hash }
1465
1584
  else
1466
1585
  p
1467
1586
  end
@@ -1498,4 +1617,3 @@ module ActiveMerchant #:nodoc:
1498
1617
  end
1499
1618
  end
1500
1619
  end
1501
-