activemerchant 1.43.3 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/CHANGELOG +133 -3
  5. data/CONTRIBUTORS +25 -0
  6. data/README.md +14 -39
  7. data/lib/active_merchant.rb +43 -2
  8. data/lib/active_merchant/billing.rb +3 -1
  9. data/lib/active_merchant/billing/base.rb +10 -2
  10. data/lib/active_merchant/billing/check.rb +29 -22
  11. data/lib/active_merchant/billing/compatibility.rb +120 -0
  12. data/lib/active_merchant/billing/credit_card.rb +129 -60
  13. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
  14. data/lib/active_merchant/billing/credit_card_methods.rb +60 -43
  15. data/lib/active_merchant/billing/cvv_result.rb +15 -15
  16. data/lib/active_merchant/billing/gateway.rb +46 -11
  17. data/lib/active_merchant/billing/gateways/adyen.rb +205 -0
  18. data/lib/active_merchant/billing/gateways/app55.rb +1 -9
  19. data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -391
  20. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
  21. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +20 -4
  22. data/lib/active_merchant/billing/gateways/balanced.rb +127 -367
  23. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/beanstream.rb +25 -6
  25. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -3
  26. data/lib/active_merchant/billing/gateways/blue_pay.rb +11 -3
  27. data/lib/active_merchant/billing/gateways/bogus.rb +1 -13
  28. data/lib/active_merchant/billing/gateways/borgun.rb +211 -0
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +31 -13
  30. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -0
  31. data/lib/active_merchant/billing/gateways/cashnet.rb +184 -0
  32. data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
  33. data/lib/active_merchant/billing/gateways/certo_direct.rb +3 -2
  34. data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
  35. data/lib/active_merchant/billing/gateways/conekta.rb +56 -81
  36. data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -0
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +3 -1
  38. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
  39. data/lib/active_merchant/billing/gateways/elavon.rb +45 -9
  40. data/lib/active_merchant/billing/gateways/epay.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/eway.rb +1 -12
  42. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/eway_rapid.rb +233 -202
  44. data/lib/active_merchant/billing/gateways/exact.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/fat_zebra.rb +1 -1
  46. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
  47. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -1
  48. data/lib/active_merchant/billing/gateways/first_pay.rb +108 -124
  49. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +43 -13
  50. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  51. data/lib/active_merchant/billing/gateways/hps.rb +281 -0
  52. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  53. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +1 -4
  54. data/lib/active_merchant/billing/gateways/inspire.rb +0 -8
  55. data/lib/active_merchant/billing/gateways/iridium.rb +25 -3
  56. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -1
  57. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -13
  58. data/lib/active_merchant/billing/gateways/litle.rb +10 -4
  59. data/lib/active_merchant/billing/gateways/maxipago.rb +7 -0
  60. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -6
  61. data/lib/active_merchant/billing/gateways/merchant_ware.rb +4 -11
  62. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -10
  63. data/lib/active_merchant/billing/gateways/mercury.rb +0 -7
  64. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -20
  65. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/moneris.rb +29 -21
  67. data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -11
  68. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -8
  69. data/lib/active_merchant/billing/gateways/nab_transact.rb +16 -15
  70. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/netbilling.rb +0 -7
  72. data/lib/active_merchant/billing/gateways/network_merchants.rb +21 -18
  73. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  74. data/lib/active_merchant/billing/gateways/openpay.rb +1 -8
  75. data/lib/active_merchant/billing/gateways/optimal_payment.rb +34 -23
  76. data/lib/active_merchant/billing/gateways/orbital.rb +121 -4
  77. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
  78. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +2 -9
  79. data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
  80. data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -13
  81. data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
  82. data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -9
  83. data/lib/active_merchant/billing/gateways/payex.rb +1 -1
  84. data/lib/active_merchant/billing/gateways/payflow.rb +7 -1
  85. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +15 -15
  86. data/lib/active_merchant/billing/gateways/payflow_express.rb +19 -19
  87. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  88. data/lib/active_merchant/billing/gateways/paymill.rb +7 -2
  89. data/lib/active_merchant/billing/gateways/paypal.rb +25 -14
  90. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -1
  91. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +16 -2
  92. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +3 -2
  93. data/lib/active_merchant/billing/gateways/paypal_express.rb +25 -0
  94. data/lib/active_merchant/billing/gateways/payscout.rb +1 -8
  95. data/lib/active_merchant/billing/gateways/pin.rb +39 -7
  96. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
  97. data/lib/active_merchant/billing/gateways/psigate.rb +1 -12
  98. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/quickpay.rb +17 -15
  101. data/lib/active_merchant/billing/gateways/realex.rb +3 -12
  102. data/lib/active_merchant/billing/gateways/sage.rb +1 -1
  103. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +2 -8
  104. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
  105. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +1 -1
  106. data/lib/active_merchant/billing/gateways/sage_pay.rb +93 -28
  107. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -8
  108. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +3 -3
  109. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
  110. data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -2
  111. data/lib/active_merchant/billing/gateways/smart_ps.rb +8 -2
  112. data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -1
  113. data/lib/active_merchant/billing/gateways/stripe.rb +14 -15
  114. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +0 -1
  115. data/lib/active_merchant/billing/gateways/trust_commerce.rb +4 -9
  116. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +46 -43
  117. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +7 -0
  118. data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
  119. data/lib/active_merchant/billing/gateways/viaklix.rb +0 -6
  120. data/lib/active_merchant/billing/gateways/vindicia.rb +68 -44
  121. data/lib/active_merchant/billing/gateways/webpay.rb +1 -9
  122. data/lib/active_merchant/billing/gateways/wirecard.rb +117 -11
  123. data/lib/active_merchant/billing/gateways/worldpay.rb +50 -22
  124. data/lib/active_merchant/billing/gateways/worldpay_us.rb +181 -0
  125. data/lib/active_merchant/billing/model.rb +30 -0
  126. data/lib/active_merchant/billing/rails.rb +3 -0
  127. data/lib/active_merchant/billing/response.rb +20 -15
  128. data/lib/active_merchant/country.rb +327 -0
  129. data/lib/active_merchant/empty.rb +20 -0
  130. data/lib/active_merchant/errors.rb +29 -0
  131. data/lib/active_merchant/offsite_payments_shim.rb +19 -0
  132. data/lib/active_merchant/version.rb +1 -1
  133. metadata +60 -243
  134. metadata.gz.sig +0 -0
  135. data/gem-public_cert.pem +0 -21
  136. data/lib/active_merchant/billing/expiry_date.rb +0 -34
  137. data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
  138. data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
  139. data/lib/active_merchant/billing/integrations.rb +0 -17
  140. data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
  141. data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
  142. data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
  143. data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
  144. data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -78
  145. data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
  146. data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
  147. data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
  148. data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
  149. data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -66
  150. data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
  151. data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
  152. data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
  153. data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
  154. data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
  155. data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
  156. data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
  157. data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
  158. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
  159. data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
  160. data/lib/active_merchant/billing/integrations/citrus.rb +0 -28
  161. data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -57
  162. data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
  163. data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
  164. data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
  165. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
  166. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
  167. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
  168. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
  169. data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
  170. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
  171. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
  172. data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
  173. data/lib/active_merchant/billing/integrations/doku.rb +0 -24
  174. data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
  175. data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
  176. data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
  177. data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
  178. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
  179. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
  180. data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
  181. data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
  182. data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
  183. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
  184. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
  185. data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
  186. data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
  187. data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
  188. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
  189. data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
  190. data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
  191. data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
  192. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
  193. data/lib/active_merchant/billing/integrations/epay.rb +0 -21
  194. data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
  195. data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
  196. data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
  197. data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
  198. data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
  199. data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
  200. data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
  201. data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
  202. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
  203. data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
  204. data/lib/active_merchant/billing/integrations/helper.rb +0 -123
  205. data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
  206. data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
  207. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
  208. data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
  209. data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
  210. data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
  211. data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
  212. data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
  213. data/lib/active_merchant/billing/integrations/klarna.rb +0 -71
  214. data/lib/active_merchant/billing/integrations/klarna/helper.rb +0 -123
  215. data/lib/active_merchant/billing/integrations/klarna/notification.rb +0 -103
  216. data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
  217. data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
  218. data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
  219. data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
  220. data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
  221. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
  222. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
  223. data/lib/active_merchant/billing/integrations/mollie_ideal.rb +0 -98
  224. data/lib/active_merchant/billing/integrations/mollie_ideal/helper.rb +0 -67
  225. data/lib/active_merchant/billing/integrations/mollie_ideal/notification.rb +0 -69
  226. data/lib/active_merchant/billing/integrations/mollie_ideal/return.rb +0 -10
  227. data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
  228. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
  229. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
  230. data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
  231. data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
  232. data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
  233. data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
  234. data/lib/active_merchant/billing/integrations/notification.rb +0 -71
  235. data/lib/active_merchant/billing/integrations/pag_seguro.rb +0 -53
  236. data/lib/active_merchant/billing/integrations/pag_seguro/helper.rb +0 -121
  237. data/lib/active_merchant/billing/integrations/pag_seguro/notification.rb +0 -104
  238. data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
  239. data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
  240. data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
  241. data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
  242. data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
  243. data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
  244. data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
  245. data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
  246. data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
  247. data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
  248. data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
  249. data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -64
  250. data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
  251. data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
  252. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
  253. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
  254. data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
  255. data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
  256. data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
  257. data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
  258. data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
  259. data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
  260. data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
  261. data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
  262. data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
  263. data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
  264. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
  265. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
  266. data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
  267. data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
  268. data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
  269. data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
  270. data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
  271. data/lib/active_merchant/billing/integrations/platron.rb +0 -28
  272. data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
  273. data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
  274. data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
  275. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -113
  276. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
  277. data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
  278. data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
  279. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
  280. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
  281. data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
  282. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
  283. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
  284. data/lib/active_merchant/billing/integrations/return.rb +0 -42
  285. data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
  286. data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
  287. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
  288. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
  289. data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
  290. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
  291. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
  292. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
  293. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
  294. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
  295. data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
  296. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
  297. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
  298. data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
  299. data/lib/active_merchant/billing/integrations/universal.rb +0 -23
  300. data/lib/active_merchant/billing/integrations/universal/helper.rb +0 -76
  301. data/lib/active_merchant/billing/integrations/universal/notification.rb +0 -52
  302. data/lib/active_merchant/billing/integrations/universal/return.rb +0 -18
  303. data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
  304. data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
  305. data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
  306. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
  307. data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
  308. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
  309. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
  310. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
  311. data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
  312. data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
  313. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
  314. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
  315. data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
  316. data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
  317. data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
  318. data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
  319. data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
  320. data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
  321. data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
  322. data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
  323. data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
  324. data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
  325. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
  326. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  # code returned by ePDQ
64
64
  def credit(money, creditcard_or_authorization, options = {})
65
65
  if creditcard_or_authorization.is_a?(String)
66
- deprecated CREDIT_DEPRECATION_MESSAGE
66
+ ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
67
67
  refund(money, creditcard_or_authorization, options)
68
68
  else
69
69
  credit_new_order(money, creditcard_or_authorization, options)
@@ -16,7 +16,10 @@ module ActiveMerchant #:nodoc:
16
16
  # BeanStream supports payment profiles (vaults). This allows you to store cc information with BeanStream and process subsequent transactions with a customer id.
17
17
  # Secure Payment Profiles must be enabled on your account (must be done over the phone).
18
18
  # Your API Access Passcode must be set in Administration => account settings => order settings.
19
- # To learn more about storing credit cards with the Beanstream gateway, please read the BEAN_Payment_Profiles.pdf (I had to phone BeanStream to request it.)
19
+ # To learn more about storing credit cards with the Beanstream gateway, documentation can be found at http://developer.beanstream.com/documentation/classic-apis
20
+ #
21
+ # To store a credit card using Beanstream's Legato Javascript Library (http://developer.beanstream.com/documentation/legato) you must pass the singleUseToken in
22
+ # the store method's option parameter. Example: @gateway.store("gt6-0c78c25b-3637-4ba0-90e2-26105287f198")
20
23
  #
21
24
  # == Notes
22
25
  # * Adding of order products information is not implemented.
@@ -97,6 +100,8 @@ module ActiveMerchant #:nodoc:
97
100
  end
98
101
 
99
102
  def recurring(money, source, options = {})
103
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
104
+
100
105
  post = {}
101
106
  add_amount(post, money)
102
107
  add_invoice(post, options)
@@ -108,6 +113,8 @@ module ActiveMerchant #:nodoc:
108
113
  end
109
114
 
110
115
  def update_recurring(amount, source, options = {})
116
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
117
+
111
118
  post = {}
112
119
  add_recurring_amount(post, amount)
113
120
  add_recurring_invoice(post, options)
@@ -119,6 +126,8 @@ module ActiveMerchant #:nodoc:
119
126
  end
120
127
 
121
128
  def cancel_recurring(options = {})
129
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
130
+
122
131
  post = {}
123
132
  add_recurring_operation_type(post, :cancel)
124
133
  add_recurring_service(post, options)
@@ -131,11 +140,17 @@ module ActiveMerchant #:nodoc:
131
140
 
132
141
  # To match the other stored-value gateways, like TrustCommerce,
133
142
  # store and unstore need to be defined
134
- def store(credit_card, options = {})
143
+ def store(payment_method, options = {})
135
144
  post = {}
136
145
  add_address(post, options)
137
- add_credit_card(post, credit_card)
138
- add_secure_profile_variables(post,options)
146
+
147
+ if payment_method.respond_to?(:number)
148
+ add_credit_card(post, payment_method)
149
+ else
150
+ post[:singleUseToken] = payment_method
151
+ end
152
+ add_secure_profile_variables(post, options)
153
+
139
154
  commit(post, true)
140
155
  end
141
156
 
@@ -150,10 +165,14 @@ module ActiveMerchant #:nodoc:
150
165
  # Update the values (such as CC expiration) stored at
151
166
  # the gateway. The CC number must be supplied in the
152
167
  # CreditCard object.
153
- def update(vault_id, credit_card, options = {})
168
+ def update(vault_id, payment_method, options = {})
154
169
  post = {}
155
170
  add_address(post, options)
156
- add_credit_card(post, credit_card)
171
+ if payment_method.respond_to?(:number)
172
+ add_credit_card(post, payment_method)
173
+ else
174
+ post[:singleUseToken] = payment_method
175
+ end
157
176
  options.merge!({:vault_id => vault_id, :operation => secure_profile_action(:modify)})
158
177
  add_secure_profile_variables(post,options)
159
178
  commit(post, true)
@@ -87,7 +87,7 @@ module ActiveMerchant #:nodoc:
87
87
  end
88
88
 
89
89
  def capture(money, authorization, options = {})
90
- reference, amount, type = split_auth(authorization)
90
+ reference, _, _ = split_auth(authorization)
91
91
 
92
92
  post = {}
93
93
  add_amount(post, money)
@@ -98,7 +98,7 @@ module ActiveMerchant #:nodoc:
98
98
 
99
99
  def refund(money, source, options = {})
100
100
  post = {}
101
- reference, amount, type = split_auth(source)
101
+ reference, _, type = split_auth(source)
102
102
  add_reference(post, reference)
103
103
  add_transaction_type(post, refund_action(type))
104
104
  add_amount(post, money)
@@ -106,7 +106,7 @@ module ActiveMerchant #:nodoc:
106
106
  end
107
107
 
108
108
  def credit(money, source, options = {})
109
- deprecated Gateway::CREDIT_DEPRECATION_MESSAGE
109
+ ActiveMerchant.deprecated Gateway::CREDIT_DEPRECATION_MESSAGE
110
110
  refund(money, source, options)
111
111
  end
112
112
 
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
155
155
  # * <tt>options</tt> -- A hash of parameters.
156
156
  def refund(money, identification, options = {})
157
157
  if(identification && !identification.kind_of?(String))
158
- deprecated "refund should only be used to refund a referenced transaction"
158
+ ActiveMerchant.deprecated "refund should only be used to refund a referenced transaction"
159
159
  return credit(money, identification, options)
160
160
  end
161
161
 
@@ -174,7 +174,7 @@ module ActiveMerchant #:nodoc:
174
174
 
175
175
  def credit(money, payment_object, options = {})
176
176
  if(payment_object && payment_object.kind_of?(String))
177
- deprecated "credit should only be used to credit a payment method"
177
+ ActiveMerchant.deprecated "credit should only be used to credit a payment method"
178
178
  return refund(money, payment_object, options)
179
179
  end
180
180
 
@@ -224,6 +224,8 @@ module ActiveMerchant #:nodoc:
224
224
  # :rebill_amount => '39.95'
225
225
  # A money object of 1995 cents would be passed into the 'money' parameter.
226
226
  def recurring(money, payment_object, options = {})
227
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
228
+
227
229
  requires!(options, :rebill_start_date, :rebill_expression)
228
230
  options[:rebill] = true
229
231
  if money
@@ -241,6 +243,8 @@ module ActiveMerchant #:nodoc:
241
243
  #
242
244
  # * <tt>rebill_id</tt> -- A string containing the rebill_id of the recurring billing that is already active (REQUIRED)
243
245
  def status_recurring(rebill_id)
246
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
247
+
244
248
  post = {}
245
249
  requires!(rebill_id)
246
250
  post[:REBILL_ID] = rebill_id
@@ -262,6 +266,8 @@ module ActiveMerchant #:nodoc:
262
266
  # * <tt>:rebill_next_amount</tt> -- A string containing the next rebilling amount to charge the customer. This ONLY affects the next scheduled charge; all other rebillings will continue at the regular (rebill_amount) amount.
263
267
  # Take a look above at the recurring_payment method for similar examples on how to use.
264
268
  def update_recurring(options = {})
269
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
270
+
265
271
  post = {}
266
272
  requires!(options, :rebill_id)
267
273
  post[:REBILL_ID] = options[:rebill_id]
@@ -282,6 +288,8 @@ module ActiveMerchant #:nodoc:
282
288
  #
283
289
  # * <tt>rebill_id</tt> -- A string containing the rebill_id of the recurring billing that you wish to cancel/stop (REQUIRED)
284
290
  def cancel_recurring(rebill_id)
291
+ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
292
+
285
293
  post = {}
286
294
  requires!(rebill_id)
287
295
  post[:REBILL_ID] = rebill_id
@@ -357,7 +365,7 @@ module ActiveMerchant #:nodoc:
357
365
  else
358
366
  message = message.chomp('.')
359
367
  end
360
- elsif message == "Missing ACCOUNT_ID"
368
+ elsif message == "Missing ACCOUNT_ID"
361
369
  message = "The merchant login ID or password is invalid"
362
370
  elsif message =~ /Approved/
363
371
  message = "This transaction has been approved"
@@ -42,21 +42,9 @@ module ActiveMerchant #:nodoc:
42
42
  end
43
43
  end
44
44
 
45
- def recurring(money, paysource, options = {})
46
- money = amount(money)
47
- case normalize(paysource)
48
- when /1$/
49
- Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
50
- when /2$/
51
- Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
52
- else
53
- raise Error, error_message(paysource)
54
- end
55
- end
56
-
57
45
  def credit(money, paysource, options = {})
58
46
  if paysource.is_a?(String)
59
- deprecated CREDIT_DEPRECATION_MESSAGE
47
+ ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
60
48
  return refund(money, paysource, options)
61
49
  end
62
50
 
@@ -0,0 +1,211 @@
1
+ require "nokogiri"
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class BorgunGateway < Gateway
6
+ self.display_name = "Borgun"
7
+
8
+ self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
9
+ self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization'
10
+ self.ssl_version = :SSLv3
11
+
12
+ self.supported_countries = ['IS']
13
+ self.default_currency = 'ISK'
14
+ self.money_format = :cents
15
+ self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb]
16
+
17
+ self.homepage_url = 'https://www.borgun.is/'
18
+
19
+ def initialize(options={})
20
+ requires!(options, :processor, :merchant_id, :username, :password)
21
+ super
22
+ end
23
+
24
+ def purchase(money, payment, options={})
25
+ post = {}
26
+ post[:TransType] = '1'
27
+ add_invoice(post, money, options)
28
+ add_payment_method(post, payment)
29
+
30
+ commit('sale', post)
31
+ end
32
+
33
+ def authorize(money, payment, options={})
34
+ post = {}
35
+ post[:TransType] = '5'
36
+ add_invoice(post, money, options)
37
+ add_payment_method(post, payment)
38
+
39
+ commit('authonly', post)
40
+ end
41
+
42
+ def capture(money, authorization, options={})
43
+ post = {}
44
+ post[:TransType] = '1'
45
+ add_invoice(post, money, options)
46
+ add_reference(post, authorization)
47
+ commit('capture', post)
48
+ end
49
+
50
+ def refund(money, authorization, options={})
51
+ post = {}
52
+ post[:TransType] = '3'
53
+ add_invoice(post, money, options)
54
+ add_reference(post, authorization)
55
+ commit('refund', post)
56
+ end
57
+
58
+ def void(authorization, options={})
59
+ post = {}
60
+ # TransType and TrAmount must match original values from auth or purchase.
61
+ _, _, _, _, _, transtype, tramount = split_authorization(authorization)
62
+ post[:TransType] = transtype
63
+ add_invoice(post, tramount.to_i, options)
64
+ add_reference(post, authorization)
65
+ commit('void', post)
66
+ end
67
+
68
+ private
69
+
70
+ CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")}
71
+ CURRENCY_CODES["ISK"] = "352"
72
+ CURRENCY_CODES["EUR"] = "978"
73
+
74
+ def add_invoice(post, money, options)
75
+ post[:TrAmount] = amount(money)
76
+ post[:TrCurrency] = CURRENCY_CODES[options[:currency] || currency(money)]
77
+ end
78
+
79
+ def add_payment_method(post, payment_method)
80
+ post[:PAN] = payment_method.number
81
+ post[:ExpDate] = format(payment_method.year, :two_digits) + format(payment_method.month, :two_digits)
82
+ post[:CVC2] = payment_method.verification_value
83
+ post[:DateAndTime] = Time.now.strftime("%y%m%d%H%M%S")
84
+ post[:RRN] = 'AMRCNT' + six_random_digits
85
+ end
86
+
87
+ def add_reference(post, authorization)
88
+ dateandtime, batch, transaction, rrn, authcode, _, _ = split_authorization(authorization)
89
+ post[:DateAndTime] = dateandtime
90
+ post[:Batch] = batch
91
+ post[:Transaction] = transaction
92
+ post[:RRN] = rrn
93
+ post[:AuthCode] = authcode
94
+ end
95
+
96
+ def parse(xml)
97
+ response = {}
98
+
99
+ doc = Nokogiri::XML(CGI.unescapeHTML(xml))
100
+ body = doc.xpath('//getAuthorizationReply')
101
+ body = doc.xpath('//cancelAuthorizationReply') if body.length == 0
102
+ body.children.each do |node|
103
+ if node.text?
104
+ next
105
+ elsif (node.elements.size == 0)
106
+ response[node.name.downcase.to_sym] = node.text
107
+ else
108
+ node.elements.each do |childnode|
109
+ name = "#{node.name.downcase}_#{childnode.name.downcase}"
110
+ response[name.to_sym] = childnode.text
111
+ end
112
+ end
113
+ end
114
+
115
+ response
116
+ end
117
+
118
+ def commit(action, post)
119
+ post[:Version] = '1000'
120
+ post[:Processor] = @options[:processor]
121
+ post[:MerchantID] = @options[:merchant_id]
122
+ post[:TerminalID] = 1
123
+
124
+ url = (test? ? test_url : live_url)
125
+ request = build_request(action, post)
126
+ raw = ssl_post(url(action), request, headers)
127
+ pairs = parse(raw)
128
+ success = success_from(pairs)
129
+
130
+ Response.new(
131
+ success,
132
+ message_from(success, pairs),
133
+ pairs,
134
+ authorization: authorization_from(pairs),
135
+ test: test?
136
+ )
137
+ end
138
+
139
+ def success_from(response)
140
+ (response[:actioncode] == '000')
141
+ end
142
+
143
+ def message_from(succeeded, response)
144
+ if succeeded
145
+ "Succeeded"
146
+ else
147
+ response[:message] || "Error with ActionCode=#{response[:actioncode]}"
148
+ end
149
+ end
150
+
151
+ def authorization_from(response)
152
+ [
153
+ response[:dateandtime],
154
+ response[:batch],
155
+ response[:transaction],
156
+ response[:rrn],
157
+ response[:authcode],
158
+ response[:transtype],
159
+ response[:tramount]
160
+ ].join("|")
161
+ end
162
+
163
+ def split_authorization(authorization)
164
+ dateandtime, batch, transaction, rrn, authcode, transtype, tramount = authorization.split("|")
165
+ [dateandtime, batch, transaction, rrn, authcode, transtype, tramount]
166
+ end
167
+
168
+ def headers
169
+ {
170
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s),
171
+ }
172
+ end
173
+
174
+ def build_request(action, post)
175
+ mode = (action == 'void') ? 'cancel' : 'get'
176
+ xml = Builder::XmlMarkup.new :indent => 18
177
+ xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
178
+ xml.tag!("#{mode}Authorization") do
179
+ post.each do |field, value|
180
+ xml.tag!(field, value)
181
+ end
182
+ end
183
+ inner = CGI.escapeHTML(xml.target!)
184
+ envelope(mode).sub(/{{ :body }}/,inner)
185
+ end
186
+
187
+ def envelope(mode)
188
+ <<-EOS
189
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://Borgun/Heimir/pub/ws/Authorization">
190
+ <soapenv:Header/>
191
+ <soapenv:Body>
192
+ <aut:#{mode}AuthorizationInput>
193
+ <#{mode}AuthReqXml>
194
+ {{ :body }}
195
+ </#{mode}AuthReqXml>
196
+ </aut:#{mode}AuthorizationInput>
197
+ </soapenv:Body>
198
+ </soapenv:Envelope>
199
+ EOS
200
+ end
201
+
202
+ def url(action)
203
+ (test? ? test_url : live_url)
204
+ end
205
+
206
+ def six_random_digits
207
+ (0...6).map { (48 + rand(10)).chr }.join
208
+ end
209
+ end
210
+ end
211
+ end
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
  def capture(money, authorization, options = {})
74
74
  commit do
75
75
  result = @braintree_gateway.transaction.submit_for_settlement(authorization, amount(money).to_s)
76
- Response.new(result.success?, message_from_result(result))
76
+ response_from_result(result)
77
77
  end
78
78
  end
79
79
 
@@ -92,21 +92,20 @@ module ActiveMerchant #:nodoc:
92
92
  money = amount(money).to_s if money
93
93
 
94
94
  commit do
95
- result = @braintree_gateway.transaction.refund(transaction_id, money)
96
- Response.new(result.success?, message_from_result(result),
97
- {:braintree_transaction => (transaction_hash(result.transaction) if result.success?)},
98
- {:authorization => (result.transaction.id if result.success?)}
99
- )
95
+ response_from_result(@braintree_gateway.transaction.refund(transaction_id, money))
100
96
  end
101
97
  end
102
98
 
103
99
  def void(authorization, options = {})
104
100
  commit do
105
- result = @braintree_gateway.transaction.void(authorization)
106
- Response.new(result.success?, message_from_result(result),
107
- {:braintree_transaction => (transaction_hash(result.transaction) if result.success?)},
108
- {:authorization => (result.transaction.id if result.success?)}
109
- )
101
+ response_from_result(@braintree_gateway.transaction.void(authorization))
102
+ end
103
+ end
104
+
105
+ def verify(credit_card, options = {})
106
+ MultiResponse.run(:use_first_response) do |r|
107
+ r.process { authorize(100, credit_card, options) }
108
+ r.process(:ignore_result) { void(r.authorization, options) }
110
109
  end
111
110
  end
112
111
 
@@ -137,6 +136,7 @@ module ActiveMerchant #:nodoc:
137
136
  options.merge!(:update_existing_token => braintree_credit_card.token)
138
137
  credit_card_params = merge_credit_card_options({
139
138
  :credit_card => {
139
+ :cardholder_name => creditcard.name,
140
140
  :number => creditcard.number,
141
141
  :cvv => creditcard.verification_value,
142
142
  :expiration_month => creditcard.month.to_s.rjust(2, "0"),
@@ -190,6 +190,7 @@ module ActiveMerchant #:nodoc:
190
190
  :email => scrub_email(options[:email]),
191
191
  :id => options[:customer],
192
192
  :credit_card => {
193
+ :cardholder_name => creditcard.name,
193
194
  :number => creditcard.number,
194
195
  :cvv => creditcard.verification_value,
195
196
  :expiration_month => creditcard.month.to_s.rjust(2, "0"),
@@ -214,6 +215,7 @@ module ActiveMerchant #:nodoc:
214
215
  parameters = {
215
216
  customer_id: options[:customer],
216
217
  token: options[:credit_card_token],
218
+ cardholder_name: credit_card.name,
217
219
  number: credit_card.number,
218
220
  cvv: credit_card.verification_value,
219
221
  expiration_month: credit_card.month.to_s.rjust(2, "0"),
@@ -258,6 +260,10 @@ module ActiveMerchant #:nodoc:
258
260
  valid_options[key] = value if [:update_existing_token, :verify_card, :verification_merchant_account_id].include?(key)
259
261
  end
260
262
 
263
+ if valid_options.include?(:verify_card) && @merchant_account_id
264
+ valid_options[:verification_merchant_account_id] ||= @merchant_account_id
265
+ end
266
+
261
267
  parameters[:credit_card] ||= {}
262
268
  parameters[:credit_card].merge!(:options => valid_options)
263
269
  parameters[:credit_card][:billing_address] = map_address(options[:billing_address]) if options[:billing_address]
@@ -302,6 +308,13 @@ module ActiveMerchant #:nodoc:
302
308
  end
303
309
  end
304
310
 
311
+ def response_from_result(result)
312
+ Response.new(result.success?, message_from_result(result),
313
+ { braintree_transaction: (transaction_hash(result.transaction) if result.success?) },
314
+ { authorization: (result.transaction.id if result.success?) }
315
+ )
316
+ end
317
+
305
318
  def response_params(result)
306
319
  params = {}
307
320
  if result.success?
@@ -467,7 +480,11 @@ module ActiveMerchant #:nodoc:
467
480
  end
468
481
 
469
482
  if credit_card_or_vault_id.is_a?(String) || credit_card_or_vault_id.is_a?(Integer)
470
- parameters[:customer_id] = credit_card_or_vault_id
483
+ if options[:payment_method_token]
484
+ parameters[:payment_method_token] = credit_card_or_vault_id
485
+ else
486
+ parameters[:customer_id] = credit_card_or_vault_id
487
+ end
471
488
  else
472
489
  parameters[:customer].merge!(
473
490
  :first_name => credit_card_or_vault_id.first_name,
@@ -480,8 +497,9 @@ module ActiveMerchant #:nodoc:
480
497
  :expiration_year => credit_card_or_vault_id.year.to_s
481
498
  }
482
499
  end
483
- parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address]
500
+ parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address] && !options[:payment_method_token]
484
501
  parameters[:shipping] = map_address(options[:shipping_address]) if options[:shipping_address]
502
+ parameters[:channel] = application_id if application_id.present? && application_id != "ActiveMerchant"
485
503
  parameters
486
504
  end
487
505
  end