activemerchant-nsp 1.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. data/CHANGELOG +952 -0
  2. data/CONTRIBUTORS +347 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +204 -0
  5. data/gem-public_cert.pem +20 -0
  6. data/lib/active_merchant.rb +63 -0
  7. data/lib/active_merchant/billing.rb +9 -0
  8. data/lib/active_merchant/billing/avs_result.rb +98 -0
  9. data/lib/active_merchant/billing/base.rb +56 -0
  10. data/lib/active_merchant/billing/check.rb +68 -0
  11. data/lib/active_merchant/billing/credit_card.rb +274 -0
  12. data/lib/active_merchant/billing/credit_card_formatting.rb +21 -0
  13. data/lib/active_merchant/billing/credit_card_methods.rb +143 -0
  14. data/lib/active_merchant/billing/cvv_result.rb +38 -0
  15. data/lib/active_merchant/billing/expiry_date.rb +34 -0
  16. data/lib/active_merchant/billing/gateway.rb +176 -0
  17. data/lib/active_merchant/billing/gateways.rb +18 -0
  18. data/lib/active_merchant/billing/gateways/authorize_net.rb +695 -0
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +943 -0
  20. data/lib/active_merchant/billing/gateways/balanced.rb +462 -0
  21. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +308 -0
  22. data/lib/active_merchant/billing/gateways/beanstream.rb +167 -0
  23. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +389 -0
  24. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
  25. data/lib/active_merchant/billing/gateways/blue_pay.rb +492 -0
  26. data/lib/active_merchant/billing/gateways/bogus.rb +142 -0
  27. data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
  28. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +389 -0
  30. data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
  31. data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
  32. data/lib/active_merchant/billing/gateways/card_stream.rb +230 -0
  33. data/lib/active_merchant/billing/gateways/certo_direct.rb +278 -0
  34. data/lib/active_merchant/billing/gateways/cyber_source.rb +576 -0
  35. data/lib/active_merchant/billing/gateways/data_cash.rb +597 -0
  36. data/lib/active_merchant/billing/gateways/efsnet.rb +235 -0
  37. data/lib/active_merchant/billing/gateways/elavon.rb +137 -0
  38. data/lib/active_merchant/billing/gateways/epay.rb +276 -0
  39. data/lib/active_merchant/billing/gateways/eway.rb +287 -0
  40. data/lib/active_merchant/billing/gateways/eway_managed.rb +265 -0
  41. data/lib/active_merchant/billing/gateways/exact.rb +227 -0
  42. data/lib/active_merchant/billing/gateways/fat_zebra.rb +152 -0
  43. data/lib/active_merchant/billing/gateways/federated_canada.rb +168 -0
  44. data/lib/active_merchant/billing/gateways/first_pay.rb +177 -0
  45. data/lib/active_merchant/billing/gateways/garanti.rb +262 -0
  46. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +252 -0
  47. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
  48. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
  49. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +55 -0
  50. data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
  51. data/lib/active_merchant/billing/gateways/instapay.rb +164 -0
  52. data/lib/active_merchant/billing/gateways/iridium.rb +257 -0
  53. data/lib/active_merchant/billing/gateways/itransact.rb +450 -0
  54. data/lib/active_merchant/billing/gateways/jetpay.rb +276 -0
  55. data/lib/active_merchant/billing/gateways/linkpoint.rb +451 -0
  56. data/lib/active_merchant/billing/gateways/litle.rb +290 -0
  57. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +157 -0
  58. data/lib/active_merchant/billing/gateways/merchant_ware.rb +289 -0
  59. data/lib/active_merchant/billing/gateways/metrics_global.rb +323 -0
  60. data/lib/active_merchant/billing/gateways/migs.rb +263 -0
  61. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
  62. data/lib/active_merchant/billing/gateways/modern_payments.rb +38 -0
  63. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +220 -0
  64. data/lib/active_merchant/billing/gateways/moneris.rb +250 -0
  65. data/lib/active_merchant/billing/gateways/moneris_us.rb +211 -0
  66. data/lib/active_merchant/billing/gateways/nab_transact.rb +257 -0
  67. data/lib/active_merchant/billing/gateways/net_registry.rb +189 -0
  68. data/lib/active_merchant/billing/gateways/netaxept.rb +239 -0
  69. data/lib/active_merchant/billing/gateways/netbilling.rb +196 -0
  70. data/lib/active_merchant/billing/gateways/nmi.rb +13 -0
  71. data/lib/active_merchant/billing/gateways/ogone.rb +427 -0
  72. data/lib/active_merchant/billing/gateways/optimal_payment.rb +277 -0
  73. data/lib/active_merchant/billing/gateways/orbital.rb +351 -0
  74. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
  75. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +266 -0
  76. data/lib/active_merchant/billing/gateways/pay_junction.rb +397 -0
  77. data/lib/active_merchant/billing/gateways/pay_secure.rb +120 -0
  78. data/lib/active_merchant/billing/gateways/paybox_direct.rb +201 -0
  79. data/lib/active_merchant/billing/gateways/payflow.rb +268 -0
  80. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +212 -0
  81. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +39 -0
  82. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
  83. data/lib/active_merchant/billing/gateways/payflow_express.rb +224 -0
  84. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +15 -0
  85. data/lib/active_merchant/billing/gateways/payflow_uk.rb +21 -0
  86. data/lib/active_merchant/billing/gateways/payment_express.rb +282 -0
  87. data/lib/active_merchant/billing/gateways/paypal.rb +106 -0
  88. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +653 -0
  89. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +49 -0
  90. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +245 -0
  91. data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
  92. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
  93. data/lib/active_merchant/billing/gateways/paypal_express.rb +178 -0
  94. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
  95. data/lib/active_merchant/billing/gateways/paystation.rb +201 -0
  96. data/lib/active_merchant/billing/gateways/payway.rb +214 -0
  97. data/lib/active_merchant/billing/gateways/plugnpay.rb +295 -0
  98. data/lib/active_merchant/billing/gateways/psigate.rb +219 -0
  99. data/lib/active_merchant/billing/gateways/psl_card.rb +304 -0
  100. data/lib/active_merchant/billing/gateways/qbms.rb +297 -0
  101. data/lib/active_merchant/billing/gateways/quantum.rb +282 -0
  102. data/lib/active_merchant/billing/gateways/quickpay.rb +298 -0
  103. data/lib/active_merchant/billing/gateways/realex.rb +313 -0
  104. data/lib/active_merchant/billing/gateways/sage.rb +148 -0
  105. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +88 -0
  106. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +115 -0
  107. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +97 -0
  108. data/lib/active_merchant/billing/gateways/sage_pay.rb +322 -0
  109. data/lib/active_merchant/billing/gateways/sallie_mae.rb +144 -0
  110. data/lib/active_merchant/billing/gateways/samurai.rb +121 -0
  111. data/lib/active_merchant/billing/gateways/secure_net.rb +330 -0
  112. data/lib/active_merchant/billing/gateways/secure_pay.rb +31 -0
  113. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +284 -0
  114. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +113 -0
  115. data/lib/active_merchant/billing/gateways/skip_jack.rb +458 -0
  116. data/lib/active_merchant/billing/gateways/smart_ps.rb +273 -0
  117. data/lib/active_merchant/billing/gateways/stripe.rb +236 -0
  118. data/lib/active_merchant/billing/gateways/trans_first.rb +127 -0
  119. data/lib/active_merchant/billing/gateways/transax.rb +23 -0
  120. data/lib/active_merchant/billing/gateways/trust_commerce.rb +423 -0
  121. data/lib/active_merchant/billing/gateways/usa_epay.rb +25 -0
  122. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1497 -0
  123. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +206 -0
  124. data/lib/active_merchant/billing/gateways/verifi.rb +233 -0
  125. data/lib/active_merchant/billing/gateways/viaklix.rb +194 -0
  126. data/lib/active_merchant/billing/gateways/vindicia.rb +359 -0
  127. data/lib/active_merchant/billing/gateways/wirecard.rb +313 -0
  128. data/lib/active_merchant/billing/gateways/worldpay.rb +271 -0
  129. data/lib/active_merchant/billing/integrations.rb +17 -0
  130. data/lib/active_merchant/billing/integrations/action_view_helper.rb +73 -0
  131. data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +38 -0
  132. data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +228 -0
  133. data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +340 -0
  134. data/lib/active_merchant/billing/integrations/bogus.rb +23 -0
  135. data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
  136. data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
  137. data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
  138. data/lib/active_merchant/billing/integrations/chronopay.rb +23 -0
  139. data/lib/active_merchant/billing/integrations/chronopay/helper.rb +120 -0
  140. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +158 -0
  141. data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
  142. data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
  143. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
  144. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
  145. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
  146. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
  147. data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
  148. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
  149. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
  150. data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
  151. data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
  152. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
  153. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
  154. data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
  155. data/lib/active_merchant/billing/integrations/dwolla.rb +30 -0
  156. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +31 -0
  157. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +55 -0
  158. data/lib/active_merchant/billing/integrations/dwolla/return.rb +38 -0
  159. data/lib/active_merchant/billing/integrations/e_payment_plans.rb +48 -0
  160. data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +34 -0
  161. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +84 -0
  162. data/lib/active_merchant/billing/integrations/easy_pay.rb +30 -0
  163. data/lib/active_merchant/billing/integrations/easy_pay/common.rb +40 -0
  164. data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +40 -0
  165. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +51 -0
  166. data/lib/active_merchant/billing/integrations/epay.rb +21 -0
  167. data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
  168. data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
  169. data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
  170. data/lib/active_merchant/billing/integrations/first_data/helper.rb +63 -0
  171. data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
  172. data/lib/active_merchant/billing/integrations/gestpay.rb +25 -0
  173. data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
  174. data/lib/active_merchant/billing/integrations/gestpay/helper.rb +70 -0
  175. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +85 -0
  176. data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
  177. data/lib/active_merchant/billing/integrations/helper.rb +117 -0
  178. data/lib/active_merchant/billing/integrations/hi_trust.rb +27 -0
  179. data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
  180. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +59 -0
  181. data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
  182. data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
  183. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
  184. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
  185. data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
  186. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +59 -0
  187. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
  188. data/lib/active_merchant/billing/integrations/nelnet.rb +40 -0
  189. data/lib/active_merchant/billing/integrations/nelnet/helper.rb +34 -0
  190. data/lib/active_merchant/billing/integrations/nelnet/notification.rb +100 -0
  191. data/lib/active_merchant/billing/integrations/nochex.rb +88 -0
  192. data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
  193. data/lib/active_merchant/billing/integrations/nochex/notification.rb +94 -0
  194. data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
  195. data/lib/active_merchant/billing/integrations/notification.rb +62 -0
  196. data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
  197. data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
  198. data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
  199. data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
  200. data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
  201. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +100 -0
  202. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
  203. data/lib/active_merchant/billing/integrations/paypal.rb +39 -0
  204. data/lib/active_merchant/billing/integrations/paypal/helper.rb +119 -0
  205. data/lib/active_merchant/billing/integrations/paypal/notification.rb +155 -0
  206. data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
  207. data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +20 -0
  208. data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +15 -0
  209. data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
  210. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +110 -0
  211. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
  212. data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
  213. data/lib/active_merchant/billing/integrations/quickpay.rb +21 -0
  214. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +71 -0
  215. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +74 -0
  216. data/lib/active_merchant/billing/integrations/return.rb +42 -0
  217. data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
  218. data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
  219. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
  220. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
  221. data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
  222. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
  223. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
  224. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +129 -0
  225. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
  226. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
  227. data/lib/active_merchant/billing/integrations/two_checkout.rb +44 -0
  228. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +91 -0
  229. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +139 -0
  230. data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
  231. data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
  232. data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
  233. data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
  234. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +97 -0
  235. data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
  236. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
  237. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +87 -0
  238. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
  239. data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
  240. data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
  241. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
  242. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
  243. data/lib/active_merchant/billing/integrations/world_pay.rb +27 -0
  244. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +100 -0
  245. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
  246. data/lib/active_merchant/billing/response.rb +64 -0
  247. data/lib/active_merchant/version.rb +3 -0
  248. data/lib/activemerchant.rb +1 -0
  249. data/lib/support/gateway_support.rb +65 -0
  250. data/lib/support/outbound_hosts.rb +25 -0
  251. data/lib/support/ssl_verify.rb +93 -0
  252. metadata +482 -0
@@ -0,0 +1,30 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ module PaypalExpressCommon
4
+ def self.included(base)
5
+ if base.respond_to?(:class_attribute)
6
+ base.class_attribute :test_redirect_url
7
+ base.class_attribute :live_redirect_url
8
+ else
9
+ base.class_inheritable_accessor :test_redirect_url
10
+ base.class_inheritable_accessor :live_redirect_url
11
+ end
12
+ base.live_redirect_url = 'https://www.paypal.com/cgibin/webscr'
13
+ end
14
+
15
+ def redirect_url
16
+ test? ? test_redirect_url : live_redirect_url
17
+ end
18
+
19
+ def redirect_url_for(token, options = {})
20
+ options = {:review => true, :mobile => false}.update(options)
21
+
22
+ cmd = options[:mobile] ? '_express-checkout-mobile' : '_express-checkout'
23
+ url = "#{redirect_url}?cmd=#{cmd}&token=#{token}"
24
+ url += '&useraction=commit' unless options[:review]
25
+
26
+ url
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,201 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class PaystationGateway < Gateway
4
+
5
+ self.live_url = self.test_url = "https://www.paystation.co.nz/direct/paystation.dll"
6
+
7
+ # an "error code" of "0" means "No error - transaction successful"
8
+ SUCCESSFUL_RESPONSE_CODE = '0'
9
+
10
+ # an "error code" of "34" means "Future Payment Stored OK"
11
+ SUCCESSFUL_FUTURE_PAYMENT = '34'
12
+
13
+ # TODO: check this with paystation
14
+ self.supported_countries = ['NZ']
15
+
16
+ # TODO: check this with paystation (amex and diners need to be enabled)
17
+ self.supported_cardtypes = [:visa, :master, :american_express, :diners_club ]
18
+
19
+ self.homepage_url = 'http://paystation.co.nz'
20
+ self.display_name = 'Paystation'
21
+
22
+ self.default_currency = 'NZD'
23
+ self.money_format = :cents
24
+
25
+ def initialize(options = {})
26
+ # You need to pass your Paystation ID and Gateway ID
27
+ requires!(options, :paystation_id, :gateway_id)
28
+ @options = options
29
+ super
30
+ end
31
+
32
+ def authorize(money, credit_card, options = {})
33
+ post = new_request
34
+
35
+ add_invoice(post, options)
36
+ add_amount(post, money, options)
37
+
38
+ add_credit_card(post, credit_card)
39
+
40
+ add_authorize_flag(post, options)
41
+
42
+ commit(post)
43
+ end
44
+
45
+ def capture(money, authorization_token, options = {})
46
+ post = new_request
47
+
48
+ add_invoice(post, options)
49
+ add_amount(post, money, options)
50
+
51
+ add_authorization_token(post, authorization_token, options[:credit_card_verification])
52
+
53
+ commit(post)
54
+ end
55
+
56
+ def purchase(money, payment_source, options = {})
57
+ post = new_request
58
+
59
+ add_invoice(post, options)
60
+ add_amount(post, money, options)
61
+
62
+ if payment_source.is_a?(String)
63
+ add_token(post, payment_source)
64
+ else
65
+ add_credit_card(post, payment_source)
66
+ end
67
+
68
+ add_customer_data(post, options) if options.has_key?(:customer)
69
+
70
+ commit(post)
71
+ end
72
+
73
+ def store(credit_card, options = {})
74
+ post = new_request
75
+
76
+ add_invoice(post, options)
77
+ add_credit_card(post, credit_card)
78
+ store_credit_card(post, options)
79
+
80
+ commit(post)
81
+ end
82
+
83
+ private
84
+
85
+ def new_request
86
+ {
87
+ :pi => @options[:paystation_id], # paystation account id
88
+ :gi => @options[:gateway_id], # paystation gateway id
89
+ "2p" => "t", # two-party transaction type
90
+ :nr => "t", # -- redirect??
91
+ :df => "yymm" # date format: optional sometimes, required others
92
+ }
93
+ end
94
+
95
+ def add_customer_data(post, options)
96
+ post[:mc] = options[:customer]
97
+ end
98
+
99
+ def add_invoice(post, options)
100
+ requires!(options, :order_id)
101
+
102
+ post[:ms] = options[:order_id] # "Merchant Session", must be unique per request
103
+ post[:mo] = options[:invoice] # "Order Details", displayed in Paystation Admin
104
+ post[:mr] = options[:description] # "Merchant Reference Code", seen from Paystation Admin
105
+ end
106
+
107
+ def add_credit_card(post, credit_card)
108
+
109
+ post[:cn] = credit_card.number
110
+ post[:ct] = credit_card.brand
111
+ post[:ex] = format_date(credit_card.month, credit_card.year)
112
+ post[:cc] = credit_card.verification_value if credit_card.verification_value?
113
+
114
+ end
115
+
116
+ # bill a token (stored via "store") rather than a Credit Card
117
+ def add_token(post, token)
118
+ post[:fp] = "t" # turn on "future payments" - what paystation calls Token Billing
119
+ post[:ft] = token
120
+ end
121
+
122
+ def store_credit_card(post, options)
123
+
124
+ post[:fp] = "t" # turn on "future payments" - what paystation calls Token Billing
125
+ post[:fs] = "t" # tells paystation to store right now, not bill
126
+ post[:ft] = options[:token] if options[:token] # specify a token to use that, or let Paystation generate one
127
+
128
+ end
129
+
130
+ def add_authorize_flag(post, options)
131
+ post[:pa] = "t" # tells Paystation that this is a pre-auth authorisation payment (account must be in pre-auth mode)
132
+ end
133
+
134
+ def add_authorization_token(post, auth_token, verification_value = nil)
135
+ post[:cp] = "t" # Capture Payment flag – tells Paystation this transaction should be treated as a capture payment
136
+ post[:cx] = auth_token
137
+ post[:cc] = verification_value
138
+ end
139
+
140
+ def add_amount(post, money, options)
141
+
142
+ post[:am] = amount(money)
143
+ post[:cu] = options[:currency] || currency(money)
144
+
145
+ end
146
+
147
+ def parse(xml_response)
148
+ response = {}
149
+
150
+ xml = REXML::Document.new(xml_response)
151
+
152
+ # for normal payments, the root node is <Response>
153
+ # for "future payments", it's <PaystationFuturePaymentResponse>
154
+ xml.elements.each("#{xml.root.name}/*") do |element|
155
+ response[element.name.underscore.to_sym] = element.text
156
+ end
157
+
158
+ response
159
+ end
160
+
161
+ def commit(post)
162
+
163
+ post[:tm] = "T" if test? # test mode
164
+
165
+ pstn_prefix_params = post.collect { |key, value| "pstn_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
166
+
167
+ # need include paystation param as "initiator flag for payment engine"
168
+ data = ssl_post(self.live_url, "#{pstn_prefix_params}&paystation=_empty")
169
+ response = parse(data)
170
+ message = message_from(response)
171
+
172
+ PaystationResponse.new(success?(response), message, response,
173
+ :test => (response[:tm] && response[:tm].downcase == "t"),
174
+ :authorization => response[:paystation_transaction_id]
175
+ )
176
+ end
177
+
178
+ def success?(response)
179
+ (response[:ec] == SUCCESSFUL_RESPONSE_CODE) || (response[:ec] == SUCCESSFUL_FUTURE_PAYMENT)
180
+ end
181
+
182
+ def message_from(response)
183
+ response[:em]
184
+ end
185
+
186
+ def format_date(month, year)
187
+ "#{format(year, :two_digits)}#{format(month, :two_digits)}"
188
+ end
189
+
190
+ end
191
+
192
+ class PaystationResponse < Response
193
+ # add a method to response so we can easily get the token
194
+ # for Validate transactions
195
+ def token
196
+ @params["future_payment_token"]
197
+ end
198
+ end
199
+ end
200
+ end
201
+
@@ -0,0 +1,214 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ class PaywayGateway < Gateway
4
+ self.live_url = self.test_url = 'https://ccapi.client.qvalent.com/payway/ccapi'
5
+
6
+ self.supported_countries = [ 'AU' ]
7
+ self.supported_cardtypes = [ :visa, :master, :diners_club, :american_express, :bankcard ]
8
+ self.display_name = 'Pay Way'
9
+ self.homepage_url = 'http://www.payway.com.au'
10
+ self.default_currency = 'AUD'
11
+ self.money_format = :cents
12
+
13
+ SUMMARY_CODES = {
14
+ '0' => 'Approved',
15
+ '1' => 'Declined',
16
+ '2' => 'Erred',
17
+ '3' => 'Rejected'
18
+ }
19
+
20
+ RESPONSE_CODES= {
21
+ '00' => 'Completed Successfully',
22
+ '01' => 'Refer to card issuer',
23
+ '03' => 'Invalid merchant',
24
+ '04' => 'Pick-up card',
25
+ '05' => 'Do not honour',
26
+ '08' => 'Honour only with identification',
27
+ '12' => 'Invalid transaction',
28
+ '13' => 'Invalid amount',
29
+ '14' => 'Invalid card number (no such number)',
30
+ '30' => 'Format error',
31
+ '36' => 'Restricted card',
32
+ '41' => 'Lost card',
33
+ '42' => 'No universal card',
34
+ '43' => 'Stolen card',
35
+ '51' => 'Not sufficient funds',
36
+ '54' => 'Expired card',
37
+ '61' => 'Exceeds withdrawal amount limits',
38
+ '62' => 'Restricted card',
39
+ '65' => 'Exceeds withdrawal frequency limit',
40
+ '91' => 'Issuer or switch is inoperative',
41
+ '92' => 'Financial institution or intermediate network facility cannot be found for routing',
42
+ '94' => 'Duplicate transmission',
43
+ 'Q1' => 'Unknown Buyer',
44
+ 'Q2' => 'Transaction Pending',
45
+ 'Q3' => 'Payment Gateway Connection Error',
46
+ 'Q4' => 'Payment Gateway Unavailable',
47
+ 'Q5' => 'Invalid Transaction',
48
+ 'Q6' => 'Duplicate Transaction - requery to determine status',
49
+ 'QA' => 'Invalid parameters or Initialisation failed',
50
+ 'QB' => 'Order type not currently supported',
51
+ 'QC' => 'Invalid Order Type',
52
+ 'QD' => 'Invalid Payment Amount - Payment amount less than minimum/exceeds maximum allowed limit',
53
+ 'QE' => 'Internal Error',
54
+ 'QF' => 'Transaction Failed',
55
+ 'QG' => 'Unknown Customer Order Number',
56
+ 'QH' => 'Unknown Customer Username or Password',
57
+ 'QI' => 'Transaction incomplete - contact Westpac to confirm reconciliation',
58
+ 'QJ' => 'Invalid Client Certificate',
59
+ 'QK' => 'Unknown Customer Merchant',
60
+ 'QL' => 'Business Group not configured for customer',
61
+ 'QM' => 'Payment Instrument not configured for customer',
62
+ 'QN' => 'Configuration Error',
63
+ 'QO' => 'Missing Payment Instrument',
64
+ 'QP' => 'Missing Supplier Account',
65
+ 'QQ' => 'Invalid Credit Card Verification Number',
66
+ 'QR' => 'Transaction Retry',
67
+ 'QS' => 'Transaction Successful',
68
+ 'QT' => 'Invalid currency',
69
+ 'QU' => 'Unknown Customer IP Address',
70
+ 'QV' => 'Invalid Original Order Number specified for Refund, Refund amount exceeds capture amount, or Previous capture was not approved',
71
+ 'QW' => 'Invalid Reference Number',
72
+ 'QX' => 'Network Error has occurred',
73
+ 'QY' => 'Card Type Not Accepted',
74
+ 'QZ' => 'Zero value transaction'
75
+ }
76
+
77
+ TRANSACTIONS = {
78
+ :authorize => 'preauth',
79
+ :purchase => 'capture',
80
+ :capture => 'captureWithoutAuth',
81
+ :status => 'query',
82
+ :refund => 'refund',
83
+ :store => 'registerAccount'
84
+ }
85
+
86
+ def initialize(options={})
87
+ @options = options
88
+
89
+ options[:merchant] ||= 'TEST' if test?
90
+
91
+ requires!(options, :username, :password, :merchant, :pem)
92
+
93
+ @options[:eci] ||= 'SSL'
94
+
95
+ super
96
+ end
97
+
98
+ def authorize(amount, payment_method, options={})
99
+ requires!(options, :order_id)
100
+
101
+ post = {}
102
+ add_payment_method(post, payment_method)
103
+ add_order(post, amount, options)
104
+ commit(:authorize, post)
105
+ end
106
+
107
+ def capture(amount, authorization, options={})
108
+ requires!(options, :order_id)
109
+
110
+ post = {}
111
+ add_reference(post, authorization)
112
+ add_order(post, amount, options)
113
+ commit(:capture, post)
114
+ end
115
+
116
+ def purchase(amount, payment_method, options={})
117
+ requires!(options, :order_id)
118
+
119
+ post = {}
120
+ add_payment_method(post, payment_method)
121
+ add_order(post, amount, options)
122
+ commit(:purchase, post)
123
+ end
124
+
125
+ def refund(amount, authorization, options={})
126
+ requires!(options, :order_id)
127
+
128
+ post = {}
129
+ add_reference(post, authorization)
130
+ add_order(post, amount, options)
131
+ commit(:refund, post)
132
+ end
133
+
134
+ def store(credit_card, options={})
135
+ requires!(options, :billing_id)
136
+
137
+ post = {}
138
+ add_payment_method(post, credit_card)
139
+ add_payment_method(post, options[:billing_id])
140
+ commit(:store, post)
141
+ end
142
+
143
+ def status(options={})
144
+ requires!(options, :order_id)
145
+
146
+ commit(:status, 'customer.orderNumber' => options[:order_id])
147
+ end
148
+
149
+ private
150
+
151
+ def add_payment_method(post, payment_method)
152
+ if payment_method.respond_to?(:number)
153
+ post['card.cardHolderName'] = "#{payment_method.first_name} #{payment_method.last_name}"
154
+ post['card.PAN'] = payment_method.number
155
+ post['card.CVN'] = payment_method.verification_value
156
+ post['card.expiryYear'] = payment_method.year.to_s[-2,2]
157
+ post['card.expiryMonth'] = sprintf('%02d', payment_method.month)
158
+ else
159
+ post['customer.customerReferenceNumber'] = payment_method
160
+ end
161
+ end
162
+
163
+ def add_reference(post, reference)
164
+ post['customer.originalOrderNumber'] = reference
165
+ end
166
+
167
+ def add_order(post, amount, options)
168
+ post['order.ECI'] = @options[:eci]
169
+ post['order.amount'] = amount
170
+ post['card.currency'] = (options[:currency] || currency(amount))
171
+ post['customer.orderNumber'] = options[:order_id][0...20]
172
+ end
173
+
174
+ def add_auth(post)
175
+ post['customer.username'] = @options[:username]
176
+ post['customer.password'] = @options[:password]
177
+ post['customer.merchant'] = @options[:merchant]
178
+ end
179
+
180
+ # Creates the request and returns the summarized result
181
+ def commit(action, post)
182
+ add_auth(post)
183
+ post.merge!('order.type' => TRANSACTIONS[action])
184
+
185
+ request = post.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join("&")
186
+ response = ssl_post(self.live_url, request)
187
+
188
+ params = {}
189
+ CGI.parse(response).each_pair do |key, value|
190
+ actual_key = key.split(".").last
191
+ params[actual_key.underscore.to_sym] = value[0]
192
+ end
193
+
194
+ message = "#{SUMMARY_CODES[params[:summary_code]]} - #{RESPONSE_CODES[params[:response_code]]}"
195
+
196
+ success = (params[:summary_code] ? (params[:summary_code] == "0") : (params[:response_code] == "00"))
197
+
198
+ Response.new(success, message, params,
199
+ :test => (@options[:merchant].to_s == "TEST"),
200
+ :authorization => post[:order_number]
201
+ )
202
+ rescue ActiveMerchant::ResponseError => e
203
+ raise unless e.response.code == '403'
204
+ return Response.new(false, "Invalid credentials", {}, :test => test?)
205
+ rescue ActiveMerchant::ClientCertificateError
206
+ return Response.new(false, "Invalid certificate", {}, :test => test?)
207
+ end
208
+
209
+ def test?
210
+ (@options[:test] || super)
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,295 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ class PlugnpayGateway < Gateway
4
+ class PlugnpayPostData < PostData
5
+ # Fields that will be sent even if they are blank
6
+ self.required_fields = [ :publisher_name, :publisher_password,
7
+ :card_amount, :card_name, :card_number, :card_exp, :orderID ]
8
+ end
9
+ self.live_url = self.test_url = 'https://pay1.plugnpay.com/payment/pnpremote.cgi'
10
+
11
+ CARD_CODE_MESSAGES = {
12
+ "M" => "Card verification number matched",
13
+ "N" => "Card verification number didn't match",
14
+ "P" => "Card verification number was not processed",
15
+ "S" => "Card verification number should be on card but was not indicated",
16
+ "U" => "Issuer was not certified for card verification"
17
+ }
18
+
19
+ CARD_CODE_ERRORS = %w( N S )
20
+
21
+ AVS_MESSAGES = {
22
+ "A" => "Street address matches billing information, zip/postal code does not",
23
+ "B" => "Address information not provided for address verification check",
24
+ "E" => "Address verification service error",
25
+ "G" => "Non-U.S. card-issuing bank",
26
+ "N" => "Neither street address nor zip/postal match billing information",
27
+ "P" => "Address verification not applicable for this transaction",
28
+ "R" => "Payment gateway was unavailable or timed out",
29
+ "S" => "Address verification service not supported by issuer",
30
+ "U" => "Address information is unavailable",
31
+ "W" => "9-digit zip/postal code matches billing information, street address does not",
32
+ "X" => "Street address and 9-digit zip/postal code matches billing information",
33
+ "Y" => "Street address and 5-digit zip/postal code matches billing information",
34
+ "Z" => "5-digit zip/postal code matches billing information, street address does not",
35
+ }
36
+
37
+ AVS_ERRORS = %w( A E N R W Z )
38
+
39
+ PAYMENT_GATEWAY_RESPONSES = {
40
+ "P01" => "AVS Mismatch Failure",
41
+ "P02" => "CVV2 Mismatch Failure",
42
+ "P21" => "Transaction may not be marked",
43
+ "P30" => "Test Tran. Bad Card",
44
+ "P35" => "Test Tran. Problem",
45
+ "P40" => "Username already exists",
46
+ "P41" => "Username is blank",
47
+ "P50" => "Fraud Screen Failure",
48
+ "P51" => "Missing PIN Code",
49
+ "P52" => "Invalid Bank Acct. No.",
50
+ "P53" => "Invalid Bank Routing No.",
51
+ "P54" => "Invalid/Missing Check No.",
52
+ "P55" => "Invalid Credit Card No.",
53
+ "P56" => "Invalid CVV2/CVC2 No.",
54
+ "P57" => "Expired. CC Exp. Date",
55
+ "P58" => "Missing Data",
56
+ "P59" => "Missing Email Address",
57
+ "P60" => "Zip Code does not match Billing State.",
58
+ "P61" => "Invalid Billing Zip Code",
59
+ "P62" => "Zip Code does not match Shipping State.",
60
+ "P63" => "Invalid Shipping Zip Code",
61
+ "P64" => "Invalid Credit Card CVV2/CVC2 Format.",
62
+ "P65" => "Maximum number of attempts has been exceeded.",
63
+ "P66" => "Credit Card number has been flagged and can not be used to access this service.",
64
+ "P67" => "IP Address is on Blocked List.",
65
+ "P68" => "Billing country does not match ipaddress country.",
66
+ "P69" => "US based ipaddresses are currently blocked.",
67
+ "P70" => "Credit Cards issued from this bank are currently not being accepted.",
68
+ "P71" => "Credit Cards issued from this bank are currently not being accepted.",
69
+ "P72" => "Daily volume exceeded.",
70
+ "P73" => "Too many transactions within allotted time.",
71
+ "P91" => "Missing/incorrect password",
72
+ "P92" => "Account not configured for mobil administration",
73
+ "P93" => "IP Not registered to username.",
74
+ "P94" => "Mode not permitted for this account.",
75
+ "P95" => "Currently Blank",
76
+ "P96" => "Currently Blank",
77
+ "P97" => "Processor not responding",
78
+ "P98" => "Missing merchant/publisher name",
79
+ "P99" => "Currently Blank"
80
+ }
81
+
82
+ TRANSACTIONS = {
83
+ :authorization => 'auth',
84
+ :purchase => 'auth',
85
+ :capture => 'mark',
86
+ :void => 'void',
87
+ :refund => 'return',
88
+ :credit => 'newreturn'
89
+ }
90
+
91
+ SUCCESS_CODES = [ 'pending', 'success' ]
92
+ FAILURE_CODES = [ 'badcard', 'fraud' ]
93
+
94
+ self.default_currency = 'USD'
95
+ self.supported_countries = ['US']
96
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
97
+ self.homepage_url = 'http://www.plugnpay.com/'
98
+ self.display_name = "Plug'n Pay"
99
+
100
+ def initialize(options = {})
101
+ requires!(options, :login, :password)
102
+ @options = options
103
+ super
104
+ end
105
+
106
+ def purchase(money, creditcard, options = {})
107
+ post = PlugnpayPostData.new
108
+
109
+ add_amount(post, money, options)
110
+ add_creditcard(post, creditcard)
111
+ add_addresses(post, options)
112
+ add_invoice_data(post, options)
113
+ add_customer_data(post, options)
114
+
115
+ post[:authtype] = 'authpostauth'
116
+ commit(:authorization, post)
117
+ end
118
+
119
+ def authorize(money, creditcard, options = {})
120
+ post = PlugnpayPostData.new
121
+
122
+ add_amount(post, money, options)
123
+ add_creditcard(post, creditcard)
124
+ add_addresses(post, options)
125
+ add_invoice_data(post, options)
126
+ add_customer_data(post, options)
127
+
128
+ post[:authtype] = 'authonly'
129
+ commit(:authorization, post)
130
+ end
131
+
132
+ def capture(money, authorization, options = {})
133
+ post = PlugnpayPostData.new
134
+
135
+ post[:orderID] = authorization
136
+
137
+ add_amount(post, money, options)
138
+ add_customer_data(post, options)
139
+
140
+ commit(:capture, post)
141
+ end
142
+
143
+ def void(authorization, options = {})
144
+ post = PlugnpayPostData.new
145
+
146
+ post[:orderID] = authorization
147
+ post[:txn_type] = 'auth'
148
+
149
+ commit(:void, post)
150
+ end
151
+
152
+ def credit(money, identification_or_creditcard, options = {})
153
+ post = PlugnpayPostData.new
154
+ add_amount(post, money, options)
155
+
156
+ if identification_or_creditcard.is_a?(String)
157
+ deprecated CREDIT_DEPRECATION_MESSAGE
158
+ refund(money, identification_or_creditcard, options)
159
+ else
160
+ add_creditcard(post, identification_or_creditcard)
161
+ add_addresses(post, options)
162
+ add_customer_data(post, options)
163
+
164
+ commit(:credit, post)
165
+ end
166
+ end
167
+
168
+ def refund(money, reference, options = {})
169
+ post = PlugnpayPostData.new
170
+ add_amount(post, money, options)
171
+ post[:orderID] = reference
172
+ commit(:refund, post)
173
+ end
174
+
175
+ private
176
+ def commit(action, post)
177
+ response = parse( ssl_post(self.live_url, post_data(action, post)) )
178
+ success = SUCCESS_CODES.include?(response[:finalstatus])
179
+ message = success ? 'Success' : message_from(response)
180
+
181
+ Response.new(success, message, response,
182
+ :test => test?,
183
+ :authorization => response[:orderid],
184
+ :avs_result => { :code => response[:avs_code] },
185
+ :cvv_result => response[:cvvresp]
186
+ )
187
+ end
188
+
189
+ def parse(body)
190
+ body = CGI.unescape(body)
191
+ results = {}
192
+ body.split('&').collect { |e| e.split('=') }.each do |key,value|
193
+ results[key.downcase.to_sym] = normalize(value.to_s.strip)
194
+ end
195
+
196
+ results.delete(:publisher_password)
197
+ results[:avs_message] = AVS_MESSAGES[results[:avs_code]] if results[:avs_code]
198
+ results[:card_code_message] = CARD_CODE_MESSAGES[results[:cvvresp]] if results[:cvvresp]
199
+
200
+ results
201
+ end
202
+
203
+ def post_data(action, post)
204
+ post[:mode] = TRANSACTIONS[action]
205
+ post[:convert] = 'underscores'
206
+ post[:app_level] = 0
207
+ post[:publisher_name] = @options[:login]
208
+ post[:publisher_password] = @options[:password]
209
+
210
+ post.to_s
211
+ end
212
+
213
+ def add_creditcard(post, creditcard)
214
+ post[:card_number] = creditcard.number
215
+ post[:card_cvv] = creditcard.verification_value
216
+ post[:card_exp] = expdate(creditcard)
217
+ post[:card_name] = creditcard.name.slice(0..38)
218
+ end
219
+
220
+ def add_customer_data(post, options)
221
+ post[:email] = options[:email]
222
+ post[:dontsndmail] = 'yes' unless options[:send_email_confirmation]
223
+ post[:ipaddress] = options[:ip]
224
+ end
225
+
226
+ def add_invoice_data(post, options)
227
+ post[:shipping] = amount(options[:shipping]) unless options[:shipping].blank?
228
+ post[:tax] = amount(options[:tax]) unless options[:tax].blank?
229
+ end
230
+
231
+ def add_addresses(post, options)
232
+ if address = options[:billing_address] || options[:address]
233
+ post[:card_address1] = address[:address1]
234
+ post[:card_zip] = address[:zip]
235
+ post[:card_city] = address[:city]
236
+ post[:card_country] = address[:country]
237
+ post[:phone] = address[:phone]
238
+
239
+ case address[:country]
240
+ when 'US', 'CA'
241
+ post[:card_state] = address[:state]
242
+ else
243
+ post[:card_state] = 'ZZ'
244
+ post[:card_prov] = address[:state]
245
+ end
246
+ end
247
+
248
+ if shipping_address = options[:shipping_address] || address
249
+ post[:shipname] = shipping_address[:name]
250
+ post[:address1] = shipping_address[:address1]
251
+ post[:address2] = shipping_address[:address2]
252
+ post[:city] = shipping_address[:city]
253
+
254
+ case shipping_address[:country]
255
+ when 'US', 'CA'
256
+ post[:state] = shipping_address[:state]
257
+ else
258
+ post[:state] = 'ZZ'
259
+ post[:province] = shipping_address[:state]
260
+ end
261
+
262
+ post[:country] = shipping_address[:country]
263
+ post[:zip] = shipping_address[:zip]
264
+ end
265
+ end
266
+
267
+ def add_amount(post, money, options)
268
+ post[:card_amount] = amount(money)
269
+ post[:currency] = options[:currency] || currency(money)
270
+ end
271
+
272
+ # Make a ruby type out of the response string
273
+ def normalize(field)
274
+ case field
275
+ when "true" then true
276
+ when "false" then false
277
+ when "" then nil
278
+ when "null" then nil
279
+ else field
280
+ end
281
+ end
282
+
283
+ def message_from(results)
284
+ PAYMENT_GATEWAY_RESPONSES[results[:resp_code]]
285
+ end
286
+
287
+ def expdate(creditcard)
288
+ year = sprintf("%.4i", creditcard.year)
289
+ month = sprintf("%.2i", creditcard.month)
290
+
291
+ "#{month}/#{year[-2..-1]}"
292
+ end
293
+ end
294
+ end
295
+ end