rtml 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +396 -0
  3. data/PostInstall.txt +2 -0
  4. data/README.rdoc +42 -0
  5. data/Rakefile +33 -0
  6. data/app_generators/rtml/USAGE +5 -0
  7. data/app_generators/rtml/rtml_generator.rb +78 -0
  8. data/app_generators/rtml/templates/rails_template.rb +36 -0
  9. data/app_generators/rtml/templates/rtml/MIT-LICENSE +20 -0
  10. data/app_generators/rtml/templates/rtml/README +109 -0
  11. data/app_generators/rtml/templates/rtml/Rakefile +38 -0
  12. data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +70 -0
  13. data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +9 -0
  14. data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +158 -0
  15. data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +252 -0
  16. data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +418 -0
  17. data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +72 -0
  18. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +56 -0
  19. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +19 -0
  20. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +82 -0
  21. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +2 -0
  22. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +10 -0
  23. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +20 -0
  24. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +33 -0
  25. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +2 -0
  26. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +23 -0
  27. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +23 -0
  28. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +11 -0
  29. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +384 -0
  30. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +191 -0
  31. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +152 -0
  32. data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +74 -0
  33. data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +9 -0
  34. data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +43 -0
  35. data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +83 -0
  36. data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +14 -0
  37. data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +14 -0
  38. data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +21 -0
  39. data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +18 -0
  40. data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +25 -0
  41. data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +21 -0
  42. data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +26 -0
  43. data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +12 -0
  44. data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +8 -0
  45. data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +68 -0
  46. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +15 -0
  47. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +108 -0
  48. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +106 -0
  49. data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +8 -0
  50. data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +4 -0
  51. data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +10 -0
  52. data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +13 -0
  53. data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +12 -0
  54. data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +8 -0
  55. data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +3 -0
  56. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +24 -0
  57. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +8 -0
  58. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +24 -0
  59. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +3 -0
  60. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +3 -0
  61. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +17 -0
  62. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +11 -0
  63. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +15 -0
  64. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +5 -0
  65. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +15 -0
  66. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +2 -0
  67. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +5 -0
  68. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +4 -0
  69. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +2 -0
  70. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +760 -0
  71. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +4 -0
  72. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +8 -0
  73. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +9 -0
  74. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +9 -0
  75. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +11 -0
  76. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +20 -0
  77. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +8 -0
  78. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +9 -0
  79. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +8 -0
  80. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +8 -0
  81. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +1 -0
  82. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +2 -0
  83. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +19 -0
  84. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +1 -0
  85. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +3 -0
  86. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +1 -0
  87. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +4 -0
  88. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +31 -0
  89. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +40 -0
  90. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +1 -0
  91. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +1 -0
  92. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +1 -0
  93. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +10 -0
  94. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +1 -0
  95. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +1 -0
  96. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +1 -0
  97. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +2 -0
  98. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +3 -0
  99. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +2 -0
  100. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +2 -0
  101. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +1 -0
  102. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +1 -0
  103. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +29 -0
  104. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +3 -0
  105. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +167 -0
  106. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +12 -0
  107. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +8 -0
  108. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +14 -0
  109. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +7 -0
  110. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +26 -0
  111. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +9 -0
  112. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +42 -0
  113. data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +303 -0
  114. data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +46 -0
  115. data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +22 -0
  116. data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +49 -0
  117. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +10 -0
  118. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +3 -0
  119. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +2 -0
  120. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +4 -0
  121. data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +11 -0
  122. data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +7 -0
  123. data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +11 -0
  124. data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +5 -0
  125. data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +4 -0
  126. data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +4 -0
  127. data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +10 -0
  128. data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +8 -0
  129. data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +8 -0
  130. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +12 -0
  131. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +8 -0
  132. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +10 -0
  133. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +8 -0
  134. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +9 -0
  135. data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +6 -0
  136. data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +8 -0
  137. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +8 -0
  138. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +8 -0
  139. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +5 -0
  140. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +5 -0
  141. data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +1 -0
  142. data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +1 -0
  143. data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +1 -0
  144. data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +7 -0
  145. data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +1 -0
  146. data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +1 -0
  147. data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +10 -0
  148. data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +30 -0
  149. data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +90 -0
  150. data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +66 -0
  151. data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +123 -0
  152. data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +365 -0
  153. data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +65 -0
  154. data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +33 -0
  155. data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +39 -0
  156. data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +66 -0
  157. data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +49 -0
  158. data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +15 -0
  159. data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +16 -0
  160. data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +24 -0
  161. data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +23 -0
  162. data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +20 -0
  163. data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +17 -0
  164. data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +19 -0
  165. data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +14 -0
  166. data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +10 -0
  167. data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +10 -0
  168. data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +10 -0
  169. data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +16 -0
  170. data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +16 -0
  171. data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +16 -0
  172. data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +11 -0
  173. data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +31 -0
  174. data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +25 -0
  175. data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +49 -0
  176. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +20 -0
  177. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +3 -0
  178. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +37 -0
  179. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +12 -0
  180. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +11 -0
  181. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +2 -0
  182. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +24 -0
  183. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +3 -0
  184. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +16 -0
  185. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +15 -0
  186. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +2 -0
  187. data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +8 -0
  188. data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +45 -0
  189. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +7 -0
  190. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +10 -0
  191. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +2 -0
  192. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +11 -0
  193. data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +8 -0
  194. data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +66 -0
  195. data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +57 -0
  196. data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +27 -0
  197. data/app_generators/rtml/templates/rtml/init.rb +40 -0
  198. data/app_generators/rtml/templates/rtml/install.rb +18 -0
  199. data/app_generators/rtml/templates/rtml/lib/environment.rb +61 -0
  200. data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +9 -0
  201. data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +34 -0
  202. data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +74 -0
  203. data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +24 -0
  204. data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +13 -0
  205. data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +25 -0
  206. data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +15 -0
  207. data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +10 -0
  208. data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +28 -0
  209. data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +20 -0
  210. data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +19 -0
  211. data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +16 -0
  212. data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +37 -0
  213. data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +23 -0
  214. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +20 -0
  215. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +36 -0
  216. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +44 -0
  217. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +25 -0
  218. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +30 -0
  219. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +43 -0
  220. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +45 -0
  221. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +87 -0
  222. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +26 -0
  223. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +25 -0
  224. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +29 -0
  225. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +24 -0
  226. data/app_generators/rtml/templates/rtml/lib/rtml.rb +77 -0
  227. data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +12 -0
  228. data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +11 -0
  229. data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +13 -0
  230. data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +30 -0
  231. data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +59 -0
  232. data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +188 -0
  233. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +91 -0
  234. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +63 -0
  235. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +70 -0
  236. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +73 -0
  237. data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +55 -0
  238. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +318 -0
  239. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +79 -0
  240. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +83 -0
  241. data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +123 -0
  242. data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +59 -0
  243. data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +7 -0
  244. data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +11 -0
  245. data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +3 -0
  246. data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +8 -0
  247. data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +12 -0
  248. data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +75 -0
  249. data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +9 -0
  250. data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +79 -0
  251. data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +106 -0
  252. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +10 -0
  253. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +18 -0
  254. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +21 -0
  255. data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +32 -0
  256. data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +195 -0
  257. data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +18 -0
  258. data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +17 -0
  259. data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +30 -0
  260. data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +35 -0
  261. data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +21 -0
  262. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +59 -0
  263. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +193 -0
  264. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +23 -0
  265. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +28 -0
  266. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +47 -0
  267. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +181 -0
  268. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +28 -0
  269. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +33 -0
  270. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +17 -0
  271. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +71 -0
  272. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +21 -0
  273. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +6 -0
  274. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +10 -0
  275. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +27 -0
  276. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +70 -0
  277. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +174 -0
  278. data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +48 -0
  279. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +14 -0
  280. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +33 -0
  281. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +18 -0
  282. data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +51 -0
  283. data/app_generators/rtml/templates/rtml/lib/rtml/tml_param_parser.rb +95 -0
  284. data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +61 -0
  285. data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +52 -0
  286. data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +97 -0
  287. data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +16 -0
  288. data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +11 -0
  289. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +11 -0
  290. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +59 -0
  291. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +251 -0
  292. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +213 -0
  293. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/dot.gif +0 -0
  294. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_can.gif +0 -0
  295. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_cand.gif +0 -0
  296. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_en.gif +0 -0
  297. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_end.gif +0 -0
  298. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_i.gif +0 -0
  299. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icd.gif +0 -0
  300. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icl.gif +0 -0
  301. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icr.gif +0 -0
  302. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ics.gif +0 -0
  303. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icsw.gif +0 -0
  304. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icv.gif +0 -0
  305. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int.gif +0 -0
  306. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int2.gif +0 -0
  307. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_men.gif +0 -0
  308. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_mend.gif +0 -0
  309. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_next.gif +0 -0
  310. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_no.gif +0 -0
  311. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_nod.gif +0 -0
  312. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ok.gif +0 -0
  313. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_okd.gif +0 -0
  314. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic1.gif +0 -0
  315. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic2.gif +0 -0
  316. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic3.gif +0 -0
  317. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic4.gif +0 -0
  318. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_top.gif +0 -0
  319. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_txn.gif +0 -0
  320. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yes.gif +0 -0
  321. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yesd.gif +0 -0
  322. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/btmlpa.gif +0 -0
  323. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_dn.gif +0 -0
  324. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_up.gif +0 -0
  325. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/conf.gif +0 -0
  326. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/iccemv.gif +0 -0
  327. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/images.lib +0 -0
  328. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/magcard.gif +0 -0
  329. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_dn.gif +0 -0
  330. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_up.gif +0 -0
  331. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_dn.gif +0 -0
  332. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_up.gif +0 -0
  333. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/top.gif +0 -0
  334. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_dn.gif +0 -0
  335. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_up.gif +0 -0
  336. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_color.css +37 -0
  337. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +17 -0
  338. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css +0 -0
  339. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +12 -0
  340. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +37 -0
  341. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +4 -0
  342. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +12 -0
  343. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +37 -0
  344. data/app_generators/rtml/templates/rtml/reporting/110409 +227 -0
  345. data/app_generators/rtml/templates/rtml/reporting/linecount.rb +42 -0
  346. data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +63 -0
  347. data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +84 -0
  348. data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +30 -0
  349. data/app_generators/rtml/templates/rtml/rules/varns/card.rb +17 -0
  350. data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +31 -0
  351. data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +8 -0
  352. data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +7 -0
  353. data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +6 -0
  354. data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +15 -0
  355. data/app_generators/rtml/templates/rtml/rules/varns/com.rb +9 -0
  356. data/app_generators/rtml/templates/rtml/rules/varns/err.rb +14 -0
  357. data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +13 -0
  358. data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +8 -0
  359. data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +8 -0
  360. data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +15 -0
  361. data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +42 -0
  362. data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +7 -0
  363. data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +4 -0
  364. data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +1 -0
  365. data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +5 -0
  366. data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +5 -0
  367. data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +5 -0
  368. data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +12 -0
  369. data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +21 -0
  370. data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +11 -0
  371. data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +29 -0
  372. data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +78 -0
  373. data/app_generators/rtml/templates/rtml/template.rb +64 -0
  374. data/app_generators/rtml/templates/rtml/test/core/element_test.rb +17 -0
  375. data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +91 -0
  376. data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +53 -0
  377. data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +13 -0
  378. data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +13 -0
  379. data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +20 -0
  380. data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +9 -0
  381. data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +19 -0
  382. data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +20 -0
  383. data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +44 -0
  384. data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +11 -0
  385. data/app_generators/rtml/templates/rtml/uninstall.rb +1 -0
  386. data/app_generators/rtml/templates/rtml/update.rb +57 -0
  387. data/bin/rtml +36 -0
  388. data/lib/rtml.rb +4 -0
  389. data/script/console +10 -0
  390. data/script/destroy +14 -0
  391. data/script/generate +14 -0
  392. data/tasks/reglob.rake +28 -0
  393. data/test/test_generator_helper.rb +29 -0
  394. data/test/test_helper.rb +3 -0
  395. data/test/test_rtml.rb +11 -0
  396. data/test/test_rtml_generator.rb +43 -0
  397. metadata +516 -0
@@ -0,0 +1,191 @@
1
+ Rtml.actions_for Rtml::Oe::BtmlpaController do
2
+ def index
3
+ on :cancel => :index
4
+ default_screen :index
5
+ includes url_for(:action => 'receipt', :only_path => true)
6
+ layout tml_layout
7
+ includes tml_stylesheet
8
+ supports_emv :entry_point => :emv_start, :exit_point => :emv_submit,
9
+ :on_abort => :trans_abrt, :on_reject => :reject_trans
10
+
11
+ strings :decline_reason, :screen_after_call, :prev_txn_type => "-1", :currency_code => 'USD'
12
+ integers 'btmlpa.signature_check', 'btmlpa.dupl_available' => 0,
13
+ 'btmlpa.duplicate_receipt' => 0, :reversal_txnid => -1, :transid => -1
14
+ date 'payment.txn_date'
15
+
16
+ @main = url_for(:controller => "/rtml/oe/examples/index", :only_path => true)
17
+ @restart = url_for(:action => :index, :only_path => true)
18
+ @reverse = url_for(:action => "reverse", :only_path => true)
19
+ @icc = :emv_start#url_for(:action => 'icc', :anchor => 'check_apps', :only_path => true)
20
+ @auth = url_for(:action => "auth", :only_path => true)
21
+ @receipt = :rcpt_start #url_for(:action => 'receipt', :anchor => "rcpt_start", :only_path => true)
22
+
23
+ screens do
24
+ index :next => :main_menu do
25
+ #set :screen_after_call => "#index"
26
+ card :parser => :mag, :params => :clean do
27
+ baddata "<getvar name='err.baddata_reason' />: <getvar name='err.description' />"
28
+ end
29
+ end
30
+
31
+ # Submits EMV transaction data to host
32
+ emv_submit :next => @receipt do
33
+ set 'card.expiry_date', :to => '2010/12/31'
34
+ set 'oebr.submit_mode', :to => 'tmlvar:card.parser.verdict'
35
+ submit :target => @auth, :on_error => :icc_conn_fld do
36
+ get_variables :transid, :currency_code, 'oebr.submit_mode', 'oebr.time_zone',
37
+ 'payment.trans_type', 'payment.amount', 'payment.amount_other', 'payment.txn_date',
38
+ 'card.pan', 'card.issue_number', 'card.expiry_date', 'card.cardholder_name',
39
+ 'card.effective_date', 'card.input_type', 'card.mag.iso2_track',
40
+ 'card.emv.aid', 'card.emv.aip', 'card.emv.auc', 'card.emv.atc', 'card.emv.aac',
41
+ 'card.emv.tc', 'card.emv.arqc', 'card.emv.iad', 'card.emv.tvr', 'card.emv.unumber'
42
+ end
43
+ end
44
+
45
+ main_menu(:next => :trans_abrt) { display }
46
+ about(:next => :index, :timeout => 3) { display }
47
+ sale(:read_card) { set "payment.trans_type" => "debit" }
48
+ sale_cb(:read_card) { set "payment.trans_type" => "cashback" }
49
+ refund(:read_card) { set "payment.trans_type" => "credit" }
50
+ check_rev(:confirm_rev) { variants ["tmlvar:transid == -1","tmlvar:prev_txn_type == -1",
51
+ "tmlvar:prev_txn_type == reversal"] => :rev_bad }
52
+ confirm_rev { display }
53
+ rev_bad(:timeout => 3, :next => :close_trans) { display }
54
+ conn_fld(:offline_rev) { variants [ "tmlvar:oebr.submit_mode == offline",
55
+ "tmlvar:card.parser.verdict == offline" ] => :subm_err }
56
+ offline_rev(:submit_rev) { set "oebr.submit_mode" => "offline"; }
57
+ subm_err(@restart) { display }
58
+ to_man_entry(:timeout => 1, :next => :man_entry) { display }
59
+
60
+ sub_rev_prep(:next => :submit_rev, :on_cancel => :trans_abrt) do
61
+ set 'payment.trans_type' => 'reversal'
62
+ set 'payment.auth_code' => ''
63
+ set "btmlpa.duplicate_receipt" => 0
64
+ set "oebr.submit_mode" => "tmlvar:card.parser.verdict"
65
+ end
66
+
67
+ submit_rev(:on_cancel => :trans_abrt) do
68
+ submit :target => @reverse, :on_error => :conn_fld do
69
+ get_variable :transid
70
+ get_variable "oebr.submit_mode"
71
+ end
72
+ end
73
+
74
+
75
+ read_card :on_menu => :man_entry, :next => :read_amount do
76
+ # reset variables
77
+ set 'btmlpa.dupl_available' => 0
78
+ set 'btmlpa.duplicate_receipt' => 0
79
+ set 'payment.amount' => 0
80
+ set 'payment.amount_other' => 0
81
+ set 'oebr.submit_mode' => ''
82
+ set :reversal_txnid, :to => -1
83
+
84
+ build :tform do
85
+ baddata :max => 3, :next => :to_man_entry.to_screen_ref do
86
+ table :border => 2, :class => 'warning' do; tr { td { span { getvar :name => 'err.baddata_reason' } } } end
87
+ end
88
+ build :name => :card, :parser => 'mag', :parser_params => 'read_data'
89
+ build :name => :card, :parser => 'icc_emv', :parser_params => 'init_app'
90
+ prompt { table :class => 'message' do; tr { td { span { "Please swipe / insert card<br/>Press MENU for keying" } } } end }
91
+ end
92
+ end
93
+
94
+ man_entry(:card_nmb) do
95
+ set 'card.input_type' => 3
96
+ set 'card.parser.type' => ''
97
+ set 'card.pan' => ''
98
+ set 'card.expiry_date' => '2007/01/01'
99
+ set 'card.effective_date' => ''
100
+ end
101
+
102
+ card_nmb(:on_cancel => :trans_abrt, :next => :read_amount) do
103
+ display
104
+ end
105
+
106
+ read_amount(:on_cancel => :close_trans, :next => :assert) do
107
+ set :transid, :to => "tmlvar:oebr.unique_id"
108
+ variants "tmlvar:payment.trans_type contains debit" => :read_sale,
109
+ "tmlvar:payment.trans_type contains cashback" => :read_scb,
110
+ "tmlvar:payment.trans_type contains credit" => :read_refund
111
+ end
112
+
113
+ read_sale :next => :rd_sale_disp do set "payment.amount", :to => ""; end
114
+
115
+ [ :rd_sale_disp, :read_refund].each do |sym|
116
+ self.send sym, :on_cancel => :trans_abrt, :next => @icc do
117
+ next_screen :mg_risk_mgmt, :if => "tmlvar:card.parser.type == mag"
118
+ next_screen :mg_risk_mgmt, :if => "tmlvar:card.input_type == 3"
119
+ display
120
+ end
121
+ end
122
+
123
+ read_scb :next => :scb_check, :on_cancel => :trans_abrt do
124
+ display
125
+ end
126
+
127
+ scb_check :on_cancel => :close_trans do
128
+ next_screen @icc
129
+ next_screen :scb_check_f, :if => "tmlvar:payment.amount <= tmlvar:payment.amount_other"
130
+ next_screen :mg_risk_mgmt, :if => "tmlvar:card.parser.type == mag"
131
+ next_screen :mg_risk_mgmt, :if => "tmlvar:card.input_type == 3"
132
+ end
133
+
134
+ scb_check_f :next => :close_trans do display end
135
+
136
+ mg_risk_mgmt do
137
+ set "payment.txn_date", :to => "tmlvar:terminal.datetime"
138
+ next_screen :mg_submit
139
+ next_screen :reject_trans, :if => "tmlvar:card.parser.verdict == reject"
140
+ card :parser => 'mag', :params => 'risk_mgmt' do
141
+ baddata "<table border='2' class='warning'><tr><td><span><getvar name='err.baddata_reason'/></span></td></tr></table>"
142
+ baddata_options :max => 1, :next => :trans_abrt.to_screen_ref
143
+ end
144
+ end
145
+
146
+ mg_submit :on_cancel => :trans_abrt do
147
+ set "oebr.submit_mode", :to => "tmlvar:card.parser.verdict"
148
+ set "payment.auth_code", :to => ""
149
+ submit :target => @auth, :on_error => :conn_failed do
150
+ get_variables *%W(oebr.submit_mode payment.trans_type card.pan card.issue_number
151
+ card.expiry_date card.cardholder_name card.effective_date transid
152
+ payment.amount payment.amount_other currency_code card.input_type
153
+ card.mag.iso2_track payment.txn_date oebr.time_zone)
154
+ end
155
+ end
156
+
157
+ conn_failed :timeout => 8 do
158
+ next_screen :mg_risk_mgmt
159
+ next_screen :print_pf, :if => "tmlvar:oebr.submit_mode == offline"
160
+ next_screen :print_pf, :if => "tmlvar:card.parser.verdict == offline"
161
+ end
162
+
163
+ print_pf :next => :trans_abrt do display end
164
+
165
+ duplicate do
166
+ next_screen :assert
167
+ next_screen :duplicate_na, :if => "tmlvar:btmlpa.dupl_available == 0"
168
+ next_screen :duplicate_av, :if => "tmlvar:btmlpa.dupl_available == 1"
169
+ end
170
+
171
+ duplicate_na :timeout => 8, :next => :index do display end
172
+ duplicate_av :next => :receipt do set "btmlpa.duplicate_receipt", :to => 1; end
173
+ remove_card :next => "tmlvar:screen_after_call" do
174
+ card :parser => :icc_emv, :params => :wait_remove_card do prompt nil end
175
+ end
176
+ compl_txn :timeout => 4, :next => :index do set "err.baddata_reason", :to => ""; display end
177
+ reject_trans :next => :trans_abrt do display end
178
+ void_trans :next => :close_trans, :timeout => 1 do display end
179
+ close_trans do
180
+ set :screen_after_call, :to => :index.to_screen_ref
181
+ next_screen :index
182
+ next_screen :remove_card, :if => "tmlvar:card.input_type == 2"
183
+ end
184
+ trans_abrt :timeout => 1, :next => :close_trans do display end
185
+ sign_check :on_cancel => :sub_rev_prep do display end
186
+ assert :timeout => 3, :next => :index do display end
187
+ receipt :next => @receipt do end
188
+ error_scr :next => :index, :timeout => 5 do display end
189
+ end
190
+ end
191
+ end
@@ -0,0 +1,152 @@
1
+ Rtml.actions_for Rtml::Oe::BtmlpaController do
2
+ def receipt
3
+ # used if all conditions fail
4
+ @assert = url_for :action => 'index', :anchor => 'assert', :only_path => true
5
+
6
+ # used to transfer to set either emv or mag variables
7
+ @mag_or_emv = { "tmlvar:card.input_type == 1" => :rcpt_mag_man,
8
+ "tmlvar:card.input_type == 2" => :rcpt_emv,
9
+ "tmlvar:card.input_type == 3" => :rcpt_mag_man }
10
+
11
+ includes '/stylesheets/rtml/oe/btmlpa/receipt.css'
12
+ includes tml_stylesheet
13
+ on :error => :error_scr
14
+
15
+ # define btmlpa.receipt.header, btmlpa.receipt.emv_app_aid, etc.
16
+ # per OE BTMLPA app (see its example for details)
17
+ strings 'btmlpa.receipt.header', 'btmlpa.receipt.emv_app_aid', 'btmlpa.receipt.emv_app_label',
18
+ 'btmlpa.receipt.store_name', 'btmlpa.receipt.store_address', 'btmlpa.receipt.currency',
19
+ 'btmlpa.receipt.cashback_message', 'btmlpa.receipt.cashback_amount', 'btmlpa.receipt.signature',
20
+ 'btmlpa.receipt.pan_format', 'btmlpa.receipt.footr', 'btmlpa.receipt.target_screen',
21
+ 'btmlpa.receipt.authorization'
22
+
23
+ # check the transaction type
24
+ screen :rcpt_start, :next => @assert do
25
+ set "btmlpa.receipt.pan_format" => "n4n#*n4"
26
+ set :prev_txn_type, :to => "tmlvar:payment.trans_type"
27
+ set :reversal_txnid, :to => "tmlvar:transid"
28
+ set 'btmlpa.receipt.store_name' => "Ingenico"
29
+ set 'btmlpa.receipt.store_address' => 'France'
30
+ set 'btmlpa.receipt.currency' => [' ', 'plus', 'tmlvar:currency_code']
31
+ variants "tmlvar:btmlpa.duplicate_receipt == 1" => :rcpt_duplct,
32
+ "tmlvar:payment.trans_type contains debit" => :rcpt_dbt,
33
+ "tmlvar:payment.trans_type contains cashback" => :rcpt_cshbck,
34
+ "tmlvar:payment.trans_type contains reversal" => :rcpt_rvrsl,
35
+ "tmlvar:payment.trans_type contains credit" => :rcpt_crdt
36
+ timeout 5
37
+ end
38
+
39
+ # sets the variables that are printed for debit transaction
40
+ screen :rcpt_dbt, :next => @assert do
41
+ set 'btmlpa.receipt.header' => 'Debit'
42
+ set ['btmlpa.receipt.cashback_message', 'btmlpa.receipt.cashback_amount'], :to => ""
43
+ variants @mag_or_emv
44
+ end
45
+
46
+ # sets the variables that are printed for cashback transaction
47
+ screen :rcpt_cshbck, :next => @assert do
48
+ set 'btmlpa.receipt.header' => 'Cashback'
49
+ set 'btmlpa.receipt.cashback_message' => "Cash back amount:"
50
+ set 'btmlpa.receipt.cashback_amount', :to => "tmlvar:payment.amount_other", :format => "^*0.00"
51
+ set 'btmlpa.receipt.cashback_amount' => "tmlvar:btmlpa.receipt.cashback_amount + tmlvar:btmlpa.receipt.currency"
52
+ variants @mag_or_emv
53
+ end
54
+
55
+ # sets the variables that are printed for reversal transaction
56
+ screen :rcpt_rvrsl, :next => :rcpt_print do
57
+ set 'btmlpa.receipt.header' => "Transaction Cancelled"
58
+ set 'btmlpa.receipt.target_screen' => url_for(:action => 'index', :anchor => :void_trans, :only_path => true)
59
+ set 'btmlpa.receipt.signature' => ""
60
+ set 'btmlpa.receipt.footr' => ""
61
+ set 'btmlpa.dupl_available' => 0
62
+ set 'btmlpa.signature_check' => 0
63
+ end
64
+
65
+ # sets the variables that are printed for credit transaction
66
+ screen :rcpt_crdt, :next => @assert do
67
+ set 'btmlpa.receipt.header' => 'Credit'
68
+ set ['btmlpa.receipt.cashback_message', 'btmlpa.receipt.cashback_amount'] => ''
69
+ variants @mag_or_emv
70
+ end
71
+
72
+ # EMV-specific screens
73
+ # set the variables to be printed
74
+ screen :rcpt_emv, :next => :rcpt_emv2 do
75
+ set 'btmlpa.signature_check' => "tmlvar:card.emv.signature"
76
+ set 'btmlpa.receipt.header' => ["tmlvar:btmlpa.receipt.header", "+", " EMV"]
77
+ set 'btmlpa.receipt.authorization', :to => "tmlvar:card.emv.tc", :format => "hex"
78
+ set 'btmlpa.receipt.emv_app_aid' => "tmlvar:btmlpa.emv.txn_aid"
79
+ set 'btmlpa.receipt.emv_app_label' => "tmlvar:btmlpa.emv.txn_app"
80
+ end
81
+
82
+ # call the card removal screen
83
+ screen :rcpt_emv2, :next => url_for(:action => 'index', :anchor => :remove_card, :only_path => true) do
84
+ set :screen_after_call, :to => url_for(params.merge({ :anchor => :rcpt_emv3, :only_path => true }))
85
+ end
86
+
87
+ # check if the signature is necessary
88
+ screen :rcpt_emv3, :next => :rcpt_mrch do
89
+ next_screen :rcpt_sig, :if => "tmlvar:btmlpa.signature_check == 1"
90
+ end
91
+ # end EMV-specific screens
92
+
93
+ # sets the variables that are printed for mag and manual entry transactions
94
+ screen :rcpt_mag_man, :next => :rcpt_mrch do
95
+ set 'btmlpa.receipt.header' => ["tmlvar:btmlpa.receipt.header", "+", " MAG"]
96
+ set ['btmlpa.receipt.authorization', 'btmlpa.receipt.emv_app_aid', 'btmlpa.receipt.emv_app_label'], :to => ""
97
+ set 'btmlpa.signature_check' => 1
98
+ next_screen :rcpt_sig, :if => "tmlvar:btmlpa.signature_check != 0"
99
+ end
100
+
101
+ # sets the variables for the signature check
102
+ screen :rcpt_sig, :next => :rcpt_print do
103
+ set 'btmlpa.receipt.target_screen' => url_for(:action => 'index', :anchor => :sign_check, :only_path => true)
104
+ set 'btmlpa.receipt.signature' => "Please sign:"
105
+ set 'btmlpa.receipt.footr' => ""
106
+ set 'btmlpa.signature_check' => 0
107
+ end
108
+
109
+ # sets the variables for the merchant copy where signature check is not required
110
+ screen :rcpt_mrch, :next => :rcpt_print do
111
+ set 'btmlpa.receipt.pan_format' => "n4n#*n4"
112
+ set 'btmlpa.receipt.target_screen' => "#rcpt_cust"
113
+ set 'btmlpa.receipt.signature' => ""
114
+ set 'btmlpa.receipt.footr' => "Merchant Copy"
115
+ end
116
+
117
+ # sets the variables for the customer copy
118
+ screen :rcpt_cust, :next => :rcpt_print do
119
+ set 'btmlpa.receipt.pan_format' => "n4n#*n4"
120
+ set 'btmlpa.receipt.target_screen' => url_for(:action => 'index', :anchor => :compl_txn, :only_path => true)
121
+ set 'btmlpa.receipt.signature' => ""
122
+ set 'btmlpa.receipt.footr' => "Customer Copy"
123
+ set 'btmlpa.signature_check' => 0
124
+ set 'btmlpa.dupl_available' => 1
125
+ end
126
+
127
+ # prepare for the duplicate receipt
128
+ # it will be identical to the previously printed customer copy
129
+ screen :rcpt_duplct, :next => :rcpt_print do
130
+ set 'btmlpa.receipt.target_screen', :to => url_for(:action => 'index', :only_path => true)
131
+ end
132
+
133
+ # print the reciept
134
+ screen :rcpt_print, :next => "tmlvar:btmlpa.receipt.target_screen" do
135
+ concat :partial => 'receipt'
136
+ end
137
+
138
+ # handling of some common printing errors
139
+ screen :error_scr, :next => url_for(:action => 'index', :anchor => :error_scr, :only_path => true) do
140
+ variants "tmlvar:err.code.high == -32921" => :error_paper,
141
+ "tmlvar:err.code.low == -32921" => :error_paper
142
+ end
143
+
144
+ screen :error_paper, :next => @assert do
145
+ next_screen :rcpt_print, :key => :enter
146
+ next_screen url_for(:action => "index", :anchor => :trans_abrt, :only_path => true), :key => :cancel
147
+ next_screen :error_paper, :key => :any
148
+ layout controller.tml_layout
149
+ display
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,74 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+
4
+ module Rtml
5
+ # NOTE: This file is included into both RTMLAppController and any Views!
6
+ module RtmlAppHelper
7
+ include Rtml::Helpers::ControllerHelpers::MenuHelpers
8
+
9
+ def connected_to_berylapp?
10
+ return @connected_to_berylapp unless @connected_to_berylapp.nil?
11
+ Net::HTTP.new("www.berylapp.com", 80).head("/")
12
+ @connected_to_berylapp = true
13
+ rescue SocketError
14
+ @connected_to_berylapp = false
15
+ end
16
+
17
+ def get_uml_image_data(graph_data)
18
+ data = { :data => graph_data.join(";"),
19
+ :tred => params[:tred] || false,
20
+ :rankdir => params[:rankdir] || 'LR' }
21
+ res = Net::HTTP.post_form(URI.parse('http://www.berylapp.com/graph/generate'), data)
22
+ res.body
23
+ end
24
+
25
+ def uml_conditions_for(cond)
26
+ #return "" # due to URI length issues. Can go away after logic is moved to RTML core.
27
+ if cond.blank?
28
+ cond = ""
29
+ else
30
+ lo = ((cond =~ /lo="(.*?)"/) ? $~[1] : "")
31
+ op = ((cond =~ /op="(.*?)"/) ? $~[1] : "")
32
+ ro = ((cond =~ /ro="(.*?)"/) ? $~[1] : "")
33
+ key = ((cond =~ /key="(.*?)"/) ? $~[1] : "")
34
+
35
+ lo = 'empty' if lo.blank?
36
+ ro = 'empty' if ro.blank?
37
+
38
+ if key.blank? then cond = "#{lo} #{op} #{ro}"
39
+ else cond = key
40
+ end
41
+
42
+
43
+ end
44
+ #raise cond unless cond.blank?
45
+ format_for_uml(cond)
46
+ end
47
+
48
+ def uml_for_screen(screen)
49
+ if screen.kind_of? String or screen.kind_of? Symbol
50
+ ret = "#{format_for_uml(screen)}\\nExternal Reference"
51
+ else
52
+ widgets = widgets_for_screen(screen).join(";")
53
+ ret = ''
54
+ ret.concat format_for_uml(screen.id)
55
+ ret.concat "\\n"
56
+ ret.concat format_for_uml(widgets)
57
+ end
58
+
59
+ ret
60
+ end
61
+
62
+ def format_for_uml(text)
63
+ #CGI::escape text.to_s
64
+ text.to_s
65
+ end
66
+
67
+ def widgets_for_screen(screen)
68
+ return [] if screen.nil?
69
+ screen.widgets.collect do |widget|
70
+ widget.class.name.gsub(/^Rtml::Widgets::(.*)Widget$/, '\1').underscore.humanize
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,9 @@
1
+ Rtml::actions_for Rtml::RtmlAppController do
2
+ # Used to build the default list of menu items. Override this in your controller,
3
+ # preferably in the tml_helpers/common.rb file, but you should always call super
4
+ # first.
5
+ def build_menu
6
+ end
7
+
8
+ hide_action :build_menu
9
+ end
@@ -0,0 +1,43 @@
1
+ module Rtml
2
+ module TmlAppHelper
3
+ include Rtml
4
+ include Rtml::Helpers::RenderHelper
5
+ include Rtml::Helpers::TerminalHelpers
6
+
7
+ # Returns the state hash for the terminal or browser. Proxies into TmlAppController#state.
8
+ def state
9
+ controller.send :state
10
+ end
11
+
12
+ # Overrides the Rails default form_for method to produce a TML-compatible form.
13
+ # Does not affect non-RTML based controllers.
14
+ def form_for(record_or_name_or_array, *args, &proc)
15
+ record_or_name_or_array = "" if record_or_name_or_array.nil?
16
+ if request.format == :rtml
17
+ raise ArgumentError, "Missing block" unless block_given?
18
+ @tml_variables_for_submit = []
19
+ options = args.extract_options!.reverse_merge(:builder => Rtml::Helpers::ViewHelpers::RtmlFormBuilder)
20
+ case record_or_name_or_array
21
+ when String, Symbol
22
+ object_name = record_or_name_or_array
23
+ when Array
24
+ object = record_or_name_or_array.last
25
+ object_name = ActionController::RecordIdentifier.singular_class_name(object)
26
+ apply_form_for_options!(record_or_name_or_array, options)
27
+ args.unshift object
28
+ else
29
+ object = record_or_name_or_array
30
+ object_name = ActionController::RecordIdentifier.singular_class_name(object)
31
+ apply_form_for_options!([object], options)
32
+ args.unshift object
33
+ end
34
+
35
+ concat "<form><div>"
36
+ fields_for(object_name, *(args << options), &proc)
37
+ concat "</div></form>"
38
+ else
39
+ super(record_or_name_or_array, *args, &proc)
40
+ end
41
+ end
42
+ end
43
+ end