spree_cm_commissioner 2.13.3 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +0 -1
  3. data/Gemfile.lock +1 -1
  4. data/app/assets/config/spree_cm_commissioner_manifest.js +0 -1
  5. data/app/assets/javascripts/spree_cm_commissioner/backend.js +0 -8
  6. data/app/assets/stylesheets/spree_cm_commissioner/backend/commissioner_admin.css.scss +0 -1
  7. data/app/controllers/concerns/spree_cm_commissioner/content_cachable.rb +10 -8
  8. data/app/controllers/spree/admin/base_controller_decorator.rb +0 -12
  9. data/app/controllers/spree/admin/oauth_application_api_keys_controller.rb +118 -0
  10. data/app/controllers/spree/admin/oauth_applications_controller.rb +10 -0
  11. data/app/controllers/spree/api/v2/storefront/dynamic_field_options_controller.rb +12 -0
  12. data/app/controllers/spree/api/v2/storefront/trip_search_controller.rb +0 -5
  13. data/app/controllers/spree/api/v2/tenant/trip_search_controller.rb +0 -5
  14. data/app/helpers/spree/{billing → admin}/navigation_helper_decorator.rb +2 -9
  15. data/app/interactors/spree_cm_commissioner/user_acleda_bank_web_app_authenticator.rb +38 -0
  16. data/app/interactors/spree_cm_commissioner/user_wing_bank_web_app_authenticator.rb +39 -0
  17. data/app/models/concerns/spree_cm_commissioner/oauth_application/mini_app.rb +72 -0
  18. data/app/models/spree_cm_commissioner/dynamic_field.rb +12 -1
  19. data/app/models/spree_cm_commissioner/dynamic_field_option.rb +11 -0
  20. data/app/models/spree_cm_commissioner/guest.rb +8 -0
  21. data/app/models/spree_cm_commissioner/mini_app_provider/acleda_bank.rb +28 -0
  22. data/app/models/spree_cm_commissioner/mini_app_provider/base.rb +219 -0
  23. data/app/models/spree_cm_commissioner/mini_app_provider/vattanac_bank.rb +6 -0
  24. data/app/models/spree_cm_commissioner/mini_app_provider/wing_bank.rb +30 -0
  25. data/app/models/spree_cm_commissioner/oauth_application_decorator.rb +7 -0
  26. data/app/models/spree_cm_commissioner/product_dynamic_field.rb +9 -0
  27. data/app/models/spree_cm_commissioner/user_identity_provider.rb +1 -1
  28. data/app/services/spree_cm_commissioner/mini_app_provider/api_key_history.rb +128 -0
  29. data/app/services/spree_cm_commissioner/mini_app_provider/ip_rules.rb +26 -0
  30. data/app/services/spree_cm_commissioner/mini_app_provider/session_gate.rb +79 -0
  31. data/app/services/spree_cm_commissioner/mini_app_provider/session_throttle.rb +66 -0
  32. data/app/services/spree_cm_commissioner/payment_method_type_mapper.rb +3 -1
  33. data/app/services/spree_cm_commissioner/rate_limiter/result.rb +20 -0
  34. data/app/services/spree_cm_commissioner/rate_limiter.rb +62 -0
  35. data/app/services/spree_cm_commissioner/seeds/user_usernames.rb +3 -1
  36. data/app/services/spree_cm_commissioner/ticket_transfers/eligibility_checker.rb +5 -6
  37. data/app/services/spree_cm_commissioner/ticket_transfers/preview_rule.rb +3 -5
  38. data/app/services/spree_cm_commissioner/user_authenticator.rb +12 -2
  39. data/app/services/spree_cm_commissioner/wing_mini_app/config.rb +44 -0
  40. data/app/services/spree_cm_commissioner/wing_mini_app/find_or_create_user.rb +89 -0
  41. data/app/services/spree_cm_commissioner/wing_mini_app/profile_verifier.rb +65 -0
  42. data/app/views/spree/admin/guests/_table.html.erb +4 -0
  43. data/app/views/spree/admin/oauth_applications/_api_key_minted_modal.html.erb +71 -0
  44. data/app/views/spree/admin/oauth_applications/_api_key_modal.html.erb +68 -0
  45. data/app/views/spree/admin/oauth_applications/_api_key_restore_list.html.erb +40 -0
  46. data/app/views/spree/admin/oauth_applications/_api_key_restore_modal.html.erb +72 -0
  47. data/app/views/spree/admin/oauth_applications/_api_key_revoke_modal.html.erb +54 -0
  48. data/app/views/spree/admin/oauth_applications/_form.html.erb +152 -0
  49. data/app/views/spree/admin/oauth_applications/edit.html.erb +36 -0
  50. data/app/views/spree/admin/shared/_ticket_transfer_details.html.erb +8 -2
  51. data/config/locales/en.yml +12 -0
  52. data/config/routes.rb +15 -113
  53. data/db/migrate/20260928070109_add_provider_and_api_key_to_spree_oauth_applications.rb +11 -0
  54. data/lib/spree_cm_commissioner/test_helper/factories/vendor_factory.rb +16 -2
  55. data/lib/spree_cm_commissioner/version.rb +1 -1
  56. data/lib/spree_cm_commissioner.rb +8 -1
  57. metadata +28 -229
  58. data/app/assets/javascripts/spree_cm_commissioner/address_hide_form.js +0 -17
  59. data/app/assets/javascripts/spree_cm_commissioner/location_checkbox_manager.js +0 -45
  60. data/app/assets/javascripts/spree_cm_commissioner/report_hide_filter.js +0 -37
  61. data/app/assets/javascripts/spree_cm_commissioner/role_form.js +0 -51
  62. data/app/assets/javascripts/spree_cm_commissioner/selected_field_filter_origin_destination.js +0 -37
  63. data/app/assets/javascripts/spree_cm_commissioner/trip_stop_selection.js +0 -41
  64. data/app/assets/javascripts/spree_cm_commissioner/update_popup_confirmation.js +0 -42
  65. data/app/assets/javascripts/spree_cm_commissioner/vehicle_seat.js +0 -291
  66. data/app/assets/stylesheets/spree_cm_commissioner/backend/invoice.scss +0 -92
  67. data/app/assets/stylesheets/spree_cm_commissioner/backend/vehicle_seat.scss +0 -28
  68. data/app/controllers/concerns/spree/billing/order_parents_concern.rb +0 -31
  69. data/app/controllers/concerns/spree/billing/payment_creatable.rb +0 -64
  70. data/app/controllers/concerns/spree/billing/payment_fireable.rb +0 -35
  71. data/app/controllers/concerns/spree_cm_commissioner/billing/role_authorization.rb +0 -53
  72. data/app/controllers/spree/billing/addresses_controller.rb +0 -32
  73. data/app/controllers/spree/billing/adjustments_controller.rb +0 -72
  74. data/app/controllers/spree/billing/base_controller.rb +0 -82
  75. data/app/controllers/spree/billing/businesses_controller.rb +0 -135
  76. data/app/controllers/spree/billing/customers_controller.rb +0 -107
  77. data/app/controllers/spree/billing/errors_controller.rb +0 -14
  78. data/app/controllers/spree/billing/invoice_controller.rb +0 -36
  79. data/app/controllers/spree/billing/option_types_controller.rb +0 -32
  80. data/app/controllers/spree/billing/orders_controller.rb +0 -90
  81. data/app/controllers/spree/billing/payment_qrcodes_controller.rb +0 -14
  82. data/app/controllers/spree/billing/payments_controller.rb +0 -148
  83. data/app/controllers/spree/billing/places_controller.rb +0 -35
  84. data/app/controllers/spree/billing/products_controller.rb +0 -56
  85. data/app/controllers/spree/billing/refunds_controller.rb +0 -9
  86. data/app/controllers/spree/billing/reports_controller.rb +0 -202
  87. data/app/controllers/spree/billing/roles_controller.rb +0 -107
  88. data/app/controllers/spree/billing/store_credits_controller.rb +0 -117
  89. data/app/controllers/spree/billing/subscriptions_controller.rb +0 -49
  90. data/app/controllers/spree/billing/users_controller.rb +0 -19
  91. data/app/controllers/spree/billing/variants_controller.rb +0 -36
  92. data/app/controllers/spree/billing/vendors_controller.rb +0 -83
  93. data/app/controllers/spree/transit/amenities_controller.rb +0 -79
  94. data/app/controllers/spree/transit/amenity_values_controller.rb +0 -16
  95. data/app/controllers/spree/transit/base_controller.rb +0 -53
  96. data/app/controllers/spree/transit/branches_controller.rb +0 -35
  97. data/app/controllers/spree/transit/locations_controller.rb +0 -38
  98. data/app/controllers/spree/transit/places_controller.rb +0 -151
  99. data/app/controllers/spree/transit/reservations_controller.rb +0 -15
  100. data/app/controllers/spree/transit/routes_controller.rb +0 -66
  101. data/app/controllers/spree/transit/service_calendars_controller.rb +0 -109
  102. data/app/controllers/spree/transit/stops_controller.rb +0 -32
  103. data/app/controllers/spree/transit/trip_stops_controller.rb +0 -35
  104. data/app/controllers/spree/transit/trips_controller.rb +0 -90
  105. data/app/controllers/spree/transit/vectors/amenity_values_controller.rb +0 -40
  106. data/app/controllers/spree/transit/vectors/icons_controller.rb +0 -26
  107. data/app/controllers/spree/transit/vehicle_photos_controller.rb +0 -52
  108. data/app/controllers/spree/transit/vehicle_seats_controller.rb +0 -29
  109. data/app/controllers/spree/transit/vehicle_types_controller.rb +0 -81
  110. data/app/controllers/spree/transit/vehicles_controller.rb +0 -54
  111. data/app/controllers/spree/transit/vendors_controller.rb +0 -83
  112. data/app/helpers/spree/billing/sortable_tree_helper.rb +0 -32
  113. data/app/helpers/spree/transit/navigation_helper_decorator.rb +0 -14
  114. data/app/helpers/spree/transit/sortable_tree_helper.rb +0 -32
  115. data/app/helpers/spree_cm_commissioner/billing/monthly_orders_helper.rb +0 -66
  116. data/app/helpers/spree_cm_commissioner/billing/qrcodes_helper.rb +0 -11
  117. data/app/helpers/spree_cm_commissioner/transit/service_calendars_helper.rb +0 -17
  118. data/app/views/spree/billing/addresses/_form.html.erb +0 -38
  119. data/app/views/spree/billing/addresses/index.html.erb +0 -19
  120. data/app/views/spree/billing/adjustments/_adjustment.html.erb +0 -34
  121. data/app/views/spree/billing/adjustments/_adjustments_table.html.erb +0 -32
  122. data/app/views/spree/billing/adjustments/_form.html.erb +0 -12
  123. data/app/views/spree/billing/adjustments/edit.html.erb +0 -13
  124. data/app/views/spree/billing/adjustments/index.html.erb +0 -32
  125. data/app/views/spree/billing/adjustments/new.html.erb +0 -9
  126. data/app/views/spree/billing/businesses/_assets_form.html.erb +0 -8
  127. data/app/views/spree/billing/businesses/_form.html.erb +0 -88
  128. data/app/views/spree/billing/businesses/edit.html.erb +0 -21
  129. data/app/views/spree/billing/businesses/index.html.erb +0 -32
  130. data/app/views/spree/billing/businesses/new.html.erb +0 -16
  131. data/app/views/spree/billing/customers/_form.html.erb +0 -44
  132. data/app/views/spree/billing/customers/edit.html.erb +0 -23
  133. data/app/views/spree/billing/customers/index.html.erb +0 -160
  134. data/app/views/spree/billing/customers/new.html.erb +0 -15
  135. data/app/views/spree/billing/errors/forbidden.html.erb +0 -7
  136. data/app/views/spree/billing/invoice/show.html.erb +0 -21
  137. data/app/views/spree/billing/option_types/_form.html.erb +0 -29
  138. data/app/views/spree/billing/option_types/_option_value_fields.html.erb +0 -13
  139. data/app/views/spree/billing/option_types/edit.html.erb +0 -56
  140. data/app/views/spree/billing/option_types/index.html.erb +0 -50
  141. data/app/views/spree/billing/option_types/new.html.erb +0 -13
  142. data/app/views/spree/billing/orders/_form.html.erb +0 -54
  143. data/app/views/spree/billing/orders/_line_item.html.erb +0 -57
  144. data/app/views/spree/billing/orders/_search.html.erb +0 -62
  145. data/app/views/spree/billing/orders/edit.html.erb +0 -16
  146. data/app/views/spree/billing/orders/index.html.erb +0 -84
  147. data/app/views/spree/billing/orders/show.html.erb +0 -1
  148. data/app/views/spree/billing/payments/_list.html.erb +0 -49
  149. data/app/views/spree/billing/payments/_state_changes.html.erb +0 -33
  150. data/app/views/spree/billing/payments/index.html.erb +0 -35
  151. data/app/views/spree/billing/payments/new.html.erb +0 -24
  152. data/app/views/spree/billing/payments/show.html.erb +0 -15
  153. data/app/views/spree/billing/places/_form.html.erb +0 -16
  154. data/app/views/spree/billing/places/edit.html.erb +0 -12
  155. data/app/views/spree/billing/places/index.html.erb +0 -72
  156. data/app/views/spree/billing/places/new.html.erb +0 -15
  157. data/app/views/spree/billing/products/_add_stock_form.html.erb +0 -40
  158. data/app/views/spree/billing/products/_filters.html.erb +0 -31
  159. data/app/views/spree/billing/products/_form.html.erb +0 -123
  160. data/app/views/spree/billing/products/edit.html.erb +0 -8
  161. data/app/views/spree/billing/products/index.html.erb +0 -72
  162. data/app/views/spree/billing/products/new.html.erb +0 -85
  163. data/app/views/spree/billing/products/stock.html.erb +0 -77
  164. data/app/views/spree/billing/reports/_date_range_picker.html.erb +0 -78
  165. data/app/views/spree/billing/reports/_overview.html.erb +0 -48
  166. data/app/views/spree/billing/reports/active_subscribers.html.erb +0 -97
  167. data/app/views/spree/billing/reports/balance_due.html.erb +0 -188
  168. data/app/views/spree/billing/reports/export.html.erb +0 -70
  169. data/app/views/spree/billing/reports/failed_orders.html.erb +0 -58
  170. data/app/views/spree/billing/reports/index.html.erb +0 -62
  171. data/app/views/spree/billing/reports/overdue.html.erb +0 -61
  172. data/app/views/spree/billing/reports/paid.html.erb +0 -60
  173. data/app/views/spree/billing/roles/_form.html.erb +0 -52
  174. data/app/views/spree/billing/roles/edit.html.erb +0 -13
  175. data/app/views/spree/billing/roles/index.html.erb +0 -44
  176. data/app/views/spree/billing/roles/new.html.erb +0 -13
  177. data/app/views/spree/billing/shared/_customer_credit_form.html.erb +0 -33
  178. data/app/views/spree/billing/shared/_customer_promotion_form.html.erb +0 -29
  179. data/app/views/spree/billing/shared/_customer_promotion_table.html.erb +0 -39
  180. data/app/views/spree/billing/shared/_customer_tabs.html.erb +0 -46
  181. data/app/views/spree/billing/shared/_header.html.erb +0 -21
  182. data/app/views/spree/billing/shared/_invoice.html.erb +0 -280
  183. data/app/views/spree/billing/shared/_language_switcher.html.erb +0 -5
  184. data/app/views/spree/billing/shared/_main_menu.html.erb +0 -73
  185. data/app/views/spree/billing/shared/_order_tabs.html.erb +0 -41
  186. data/app/views/spree/billing/shared/_pop_up_confirmation.html.erb +0 -103
  187. data/app/views/spree/billing/shared/_product_tabs.html.erb +0 -24
  188. data/app/views/spree/billing/shared/_role_tabs.html.erb +0 -13
  189. data/app/views/spree/billing/shared/_subscription_tabs.html.erb +0 -20
  190. data/app/views/spree/billing/shared/_user_tabs.html.erb +0 -13
  191. data/app/views/spree/billing/shared/_vendor_logo.html.erb +0 -1
  192. data/app/views/spree/billing/shared/_vendor_switcher.html.erb +0 -57
  193. data/app/views/spree/billing/shared/sortable_tree/_taxonomy.html.erb +0 -29
  194. data/app/views/spree/billing/shared/sub_menu/_product.html.erb +0 -8
  195. data/app/views/spree/billing/shared/sub_menu/_report.html.erb +0 -23
  196. data/app/views/spree/billing/shared/sub_menu/_setting.html.erb +0 -11
  197. data/app/views/spree/billing/store_credits/_form.html.erb +0 -11
  198. data/app/views/spree/billing/store_credits/index.html.erb +0 -44
  199. data/app/views/spree/billing/store_credits/new.html.erb +0 -17
  200. data/app/views/spree/billing/subscriptions/_form.html.erb +0 -27
  201. data/app/views/spree/billing/subscriptions/_subscribed_variants_table.html.erb +0 -24
  202. data/app/views/spree/billing/subscriptions/edit.html.erb +0 -12
  203. data/app/views/spree/billing/subscriptions/index.html.erb +0 -86
  204. data/app/views/spree/billing/subscriptions/new.html.erb +0 -21
  205. data/app/views/spree/billing/users/_form.html.erb +0 -64
  206. data/app/views/spree/billing/users/edit.html.erb +0 -25
  207. data/app/views/spree/billing/users/index.html.erb +0 -116
  208. data/app/views/spree/billing/users/new.html.erb +0 -17
  209. data/app/views/spree/billing/variants/_form.html.erb +0 -28
  210. data/app/views/spree/billing/variants/edit.html.erb +0 -15
  211. data/app/views/spree/billing/variants/index.html.erb +0 -66
  212. data/app/views/spree/billing/variants/new.html.erb +0 -15
  213. data/app/views/spree/billing/vendors/_form.html.erb +0 -75
  214. data/app/views/spree/billing/vendors/edit.html.erb +0 -9
  215. data/app/views/spree/layouts/billing.html.erb +0 -74
  216. data/app/views/spree/layouts/transit.html.erb +0 -74
  217. data/app/views/spree/transit/amenities/_form.html.erb +0 -50
  218. data/app/views/spree/transit/amenities/_option_value_fields.html.erb +0 -15
  219. data/app/views/spree/transit/amenities/edit.html.erb +0 -53
  220. data/app/views/spree/transit/branches/_filter_form.erb +0 -23
  221. data/app/views/spree/transit/branches/_form.html.erb +0 -36
  222. data/app/views/spree/transit/branches/edit.html.erb +0 -15
  223. data/app/views/spree/transit/branches/index.html.erb +0 -43
  224. data/app/views/spree/transit/branches/new.html.erb +0 -19
  225. data/app/views/spree/transit/locations/_filter_form.erb +0 -30
  226. data/app/views/spree/transit/locations/_form.html.erb +0 -19
  227. data/app/views/spree/transit/locations/edit.html.erb +0 -15
  228. data/app/views/spree/transit/locations/index.html.erb +0 -49
  229. data/app/views/spree/transit/locations/new.html.erb +0 -17
  230. data/app/views/spree/transit/places/_assets_form.html.erb +0 -8
  231. data/app/views/spree/transit/places/_form.html.erb +0 -128
  232. data/app/views/spree/transit/places/edit.html.erb +0 -21
  233. data/app/views/spree/transit/places/index.html.erb +0 -32
  234. data/app/views/spree/transit/places/new.html.erb +0 -16
  235. data/app/views/spree/transit/reservations/index.html.erb +0 -5
  236. data/app/views/spree/transit/routes/_filter_form.erb +0 -24
  237. data/app/views/spree/transit/routes/_form.html.erb +0 -74
  238. data/app/views/spree/transit/routes/edit.html.erb +0 -13
  239. data/app/views/spree/transit/routes/index.html.erb +0 -79
  240. data/app/views/spree/transit/routes/new.html.erb +0 -18
  241. data/app/views/spree/transit/service_calendars/_exception_rules.html.erb +0 -44
  242. data/app/views/spree/transit/service_calendars/_filters.html.erb +0 -17
  243. data/app/views/spree/transit/service_calendars/_form.html.erb +0 -107
  244. data/app/views/spree/transit/service_calendars/index.html.erb +0 -77
  245. data/app/views/spree/transit/service_calendars/new.html.erb +0 -13
  246. data/app/views/spree/transit/shared/_amenity_tabs.html.erb +0 -21
  247. data/app/views/spree/transit/shared/_header.html.erb +0 -20
  248. data/app/views/spree/transit/shared/_main_menu.html.erb +0 -34
  249. data/app/views/spree/transit/shared/_route_tabs.html.erb +0 -25
  250. data/app/views/spree/transit/shared/_vehicle_tabs.html.erb +0 -15
  251. data/app/views/spree/transit/shared/_vendor_switcher.html.erb +0 -40
  252. data/app/views/spree/transit/shared/sortable_tree/_taxonomy.html.erb +0 -29
  253. data/app/views/spree/transit/shared/sub_menu/_setting.html.erb +0 -3
  254. data/app/views/spree/transit/stops/_filters.html.erb +0 -33
  255. data/app/views/spree/transit/stops/_form.html.erb +0 -68
  256. data/app/views/spree/transit/stops/edit.html.erb +0 -16
  257. data/app/views/spree/transit/stops/index.html.erb +0 -58
  258. data/app/views/spree/transit/stops/new.html.erb +0 -16
  259. data/app/views/spree/transit/trip_stops/index.html.erb +0 -38
  260. data/app/views/spree/transit/trips/_form.html.erb +0 -82
  261. data/app/views/spree/transit/trips/edit.html.erb +0 -15
  262. data/app/views/spree/transit/trips/new.html.erb +0 -15
  263. data/app/views/spree/transit/vectors/amenity_values/index.html.erb +0 -111
  264. data/app/views/spree/transit/vehicle_photos/_form.html.erb +0 -22
  265. data/app/views/spree/transit/vehicle_photos/edit.html.erb +0 -9
  266. data/app/views/spree/transit/vehicle_photos/index.html.erb +0 -61
  267. data/app/views/spree/transit/vehicle_photos/new.html.erb +0 -9
  268. data/app/views/spree/transit/vehicle_seats/_form.html.erb +0 -48
  269. data/app/views/spree/transit/vehicle_seats/_seats.html.erb +0 -63
  270. data/app/views/spree/transit/vehicle_types/_filter_form.html.erb +0 -29
  271. data/app/views/spree/transit/vehicle_types/_form.html.erb +0 -65
  272. data/app/views/spree/transit/vehicle_types/_seat_view.erb +0 -83
  273. data/app/views/spree/transit/vehicle_types/edit.html.erb +0 -93
  274. data/app/views/spree/transit/vehicle_types/index.html.erb +0 -94
  275. data/app/views/spree/transit/vehicle_types/new.html.erb +0 -14
  276. data/app/views/spree/transit/vehicles/_filter_form.html.erb +0 -23
  277. data/app/views/spree/transit/vehicles/_form.html.erb +0 -19
  278. data/app/views/spree/transit/vehicles/edit.html.erb +0 -19
  279. data/app/views/spree/transit/vehicles/index.html.erb +0 -57
  280. data/app/views/spree/transit/vehicles/new.html.erb +0 -19
  281. data/app/views/spree/transit/vendors/_form.html.erb +0 -34
  282. data/app/views/spree/transit/vendors/_tabs.html.erb +0 -16
  283. data/app/views/spree/transit/vendors/edit.html.erb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8c022ba33110958bd0da63395b5e814fb1c5d82469b4801a134b5697dde8a7b
4
- data.tar.gz: 30f528c86e5b3cd05e22c4ad44fa85d68a0446065c25b1d30b790897afd73f5f
3
+ metadata.gz: 565fc705e24c32c2f3bd35aad88607d80d7f26b1bab3ff62dc64e2890202ed9a
4
+ data.tar.gz: b6647ca2838265f710f999389157765f24ba1baf92369521aab95a711779a0d9
5
5
  SHA512:
6
- metadata.gz: fdb920f19e40a0634796748e15283642dcec8bbcc5d75ff4140628b2c4146e424a987f88c89c14e211e16f0646cae97964af025620aecc69457e518df5cbf1c7
7
- data.tar.gz: '09ce9911bf7008a80d729b93890f06f24b2deb98e00be9f811550c5803daa49fcb57e94c40decdfdc88e90e8e0a908964984ad7d8c3b146a10e331c93573da15'
6
+ metadata.gz: 36a8d1f75f387fb33ab1d394ee91e61ce6c1179bbf2323352f1d56e3bbb303942d57af72933910e8017f184dcf0a24174a12f70ec4a69e42309cbec47fe9cdd7
7
+ data.tar.gz: d7dc21e3383b9784c9b0cef12c354f4a3d4d3535fe122b666b8abdd3b4e4fea4660f321ada830e83fdb409ebd8d2d91ed9fa6295b1801371d803475334431860
data/.env.example CHANGED
@@ -50,7 +50,6 @@ DISTANCE_SIGNING_KEY=hei********************VY
50
50
  # Cache durations (in seconds) for different content types
51
51
  # See: app/controllers/concerns/spree_cm_commissioner/content_cachable.rb
52
52
  CACHE_AUTO_INVALIDATION_DISABLED="" # Set to yes to disable CDN cache invalidation entirely (kill switch)
53
- CACHE_CDN_MAX_AGE=86400 # CDN/server-side cache duration for all responses
54
53
  CACHE_STATIC_MAX_AGE=86400 # Static content (countries, provinces, seat layouts, CMS pages) - 1 day
55
54
  CACHE_SEMI_STATIC_MAX_AGE=3600 # Semi-static content (menus, homepage backgrounds, routes) - 1 hour
56
55
  CACHE_MODERATE_MAX_AGE=1800 # Moderate freshness (products, events, vendors) - 30 minutes
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.13.3)
37
+ spree_cm_commissioner (2.13.4)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -1,5 +1,4 @@
1
1
  //= link_tree ../images
2
- //= link spree_cm_commissioner/backend/invoice.css
3
2
 
4
3
  //= link spree_cm_commissioner/telegram/all.js
5
4
  //= link spree_cm_commissioner/telegram/all.css
@@ -2,14 +2,6 @@
2
2
  //= require map/map-picker
3
3
  //= require spree_cm_commissioner/routes
4
4
  //= require spree_cm_commissioner/calendar
5
- //= require spree_cm_commissioner/role_form
6
- //= require spree_cm_commissioner/address_hide_form
7
5
  //= require spree_cm_commissioner/annual_calendar_form
8
- //= require spree_cm_commissioner/report_hide_filter
9
- //= require spree_cm_commissioner/update_popup_confirmation
10
- //= require spree_cm_commissioner/vehicle_seat
11
- //= require spree_cm_commissioner/selected_field_filter_origin_destination
12
- //= require spree_cm_commissioner/location_checkbox_manager
13
- //= require spree_cm_commissioner/trip_stop_selection
14
6
  //= require spree_cm_commissioner/tenant_payment_icon_fields
15
7
  //= require spree_cm_commissioner/copy_to_clipboard
@@ -2,5 +2,4 @@
2
2
  @import "spree_cm_commissioner/backend/calendar";
3
3
  @import "spree_cm_commissioner/backend/service_calendar";
4
4
  @import "spree_cm_commissioner/backend/guest_qr_code";
5
- @import "spree_cm_commissioner/backend/vehicle_seat";
6
5
  @import "spree_cm_commissioner/backend/tenant_payment_icon_fields";
@@ -24,7 +24,7 @@ module SpreeCmCommissioner
24
24
  MenusController
25
25
  HomepageBackgroundController
26
26
  HomepageDataController
27
- PopularRoutesController
27
+ PopularRoutePlacesController
28
28
  RoutePlacesController
29
29
  ShowsController
30
30
  EpisodesController
@@ -46,7 +46,6 @@ module SpreeCmCommissioner
46
46
  AccommodationsController
47
47
  VendorsController
48
48
  VendorPhotosController
49
- DynamicFieldsController
50
49
  ].freeze
51
50
 
52
51
  # Priority 4: High Freshness (5 minutes)
@@ -54,12 +53,9 @@ module SpreeCmCommissioner
54
53
  TripsController
55
54
  TripSearchController
56
55
  VotingContestantsController
56
+ DynamicFieldsController
57
57
  ].freeze
58
58
 
59
- def shared_max_age
60
- ENV.fetch('CACHE_CDN_MAX_AGE', 1.day.to_i).to_i
61
- end
62
-
63
59
  # Override This Method based on your UseCase
64
60
  # Or let it auto-detect based on controller name
65
61
  def client_max_age
@@ -78,12 +74,18 @@ module SpreeCmCommissioner
78
74
  end
79
75
  end
80
76
 
77
+ # Defaults to the client TTL so a tier's max-age bounds CDN staleness too: most endpoints
78
+ # (e.g. trips, trip search) have no invalidation on change, and an unlisted controller
79
+ # (max-age 0) must not be CDN-cached at all.
80
+ def shared_max_age
81
+ client_max_age
82
+ end
83
+
81
84
  def set_cache_control_for_cdn
82
85
  return if response.committed?
83
86
  return if response.status != 200
84
87
 
85
- # max-age: browser/client cache, s-maxage: CDN/server cache
86
- # Allow client caching for mobile apps while keeping CDN cache longer
88
+ # max-age: browser/client cache, s-maxage: CDN cache
87
89
  response.headers['Cache-Control'] = "public, max-age=#{client_max_age}, s-maxage=#{shared_max_age}"
88
90
 
89
91
  # Expires: Absolute timestamp when cache becomes stale (HTTP/1.0 fallback)
@@ -1,10 +1,6 @@
1
1
  module Spree
2
2
  module Admin
3
3
  module BaseControllerDecorator
4
- def self.prepended(base)
5
- base.before_action :redirect_to_billing, if: -> { Spree::Store.default.code.include?('billing') }
6
- end
7
-
8
4
  # even db in read only mode, authorizor still need to run Warden callbacks which will write to db
9
5
  # this include update tracked fields such as sign_in_count, last_sign_in_at, etc.
10
6
  def authorize!(*args)
@@ -44,14 +40,6 @@ module Spree
44
40
 
45
41
  redirect_back fallback_location: admin_root_path
46
42
  end
47
-
48
- private
49
-
50
- def redirect_to_billing
51
- return if request.path.include?('/billing')
52
-
53
- redirect_to billing_root_url unless spree_current_user.super_admin?
54
- end
55
43
  end
56
44
  end
57
45
  end
@@ -0,0 +1,118 @@
1
+ module Spree
2
+ module Admin
3
+ # A mini app's API key as its own resource: POST mints one, PATCH restores a previous one, DELETE
4
+ # revokes it. Each asks for nothing else, so no ordinary save of the application can reach the key.
5
+ class OauthApplicationApiKeysController < Spree::Admin::BaseController
6
+ before_action :load_oauth_application
7
+
8
+ # A minted key is one the admin has no other copy of, so it is handed to the page this redirects
9
+ # to and shown there once. Stashed only if the save went through — a key that never reached the
10
+ # row is not one to hand out.
11
+ def create
12
+ minted = change_api_key(:saved) { save_api_key(nil) }
13
+
14
+ session[:minted_api_key] = @oauth_application.mini_app.api_key if minted
15
+ end
16
+
17
+ # Puts back a key this application used to hold, named by the version that recorded it. The value
18
+ # never travels through the request — the admin picks one and the plaintext is read out of history
19
+ # here, so no key can be typed in and nothing weak can get in.
20
+ def update
21
+ key = api_key_history.key_for(params[:version_id])
22
+
23
+ if key.blank?
24
+ flash[:error] = I18n.t('mini_apps.api_key.not_restorable')
25
+ return redirect_to_application
26
+ end
27
+
28
+ change_api_key(:restored) { save_api_key(key, source: 'restored') }
29
+ end
30
+
31
+ # Leaves the mini app with no key at all, rather than handing the partner a working one they never
32
+ # asked for — what a leak calls for. #create puts one back.
33
+ def destroy
34
+ mini_app = @oauth_application.mini_app
35
+
36
+ # Said plainly rather than reporting a revoke that removed nothing.
37
+ if mini_app&.supports_api_key? && mini_app.api_key.blank?
38
+ flash[:error] = I18n.t('mini_apps.api_key.nothing_to_revoke')
39
+ return redirect_to_application
40
+ end
41
+
42
+ change_api_key(:revoked) do
43
+ mini_app.revoke_api_key!
44
+ @oauth_application.save
45
+ end
46
+ end
47
+
48
+ # The dialog's contents, fetched when it is opened. Reading history costs a scan of the
49
+ # application's versions, which is not worth doing on every render of the edit page.
50
+ def history
51
+ render partial: 'spree/admin/oauth_applications/api_key_restore_list',
52
+ locals: { application: @oauth_application, entries: api_key_history.entries },
53
+ layout: false
54
+ end
55
+
56
+ private
57
+
58
+ # Authorized as an edit of the application, not as create/destroy of a key. Spelled out because
59
+ # #model_class only tells BaseController the class, never this row.
60
+ def load_oauth_application
61
+ @oauth_application = Spree::OauthApplication.find(params[:oauth_application_id])
62
+
63
+ authorize! :update, @oauth_application
64
+ end
65
+
66
+ def model_class
67
+ Spree::OauthApplication
68
+ end
69
+
70
+ # The gate every key change passes. Replacing, restoring or clearing a live key changes what the
71
+ # partner has to send, so it costs the application's name typed back — checked here because a
72
+ # hand-made request walks past the dialog. A mini app with no key yet is asked for nothing.
73
+ #
74
+ # Returns whether this request changed the key. A `flash[:success]` check would also see the
75
+ # previous request's flash, and #create would reveal a key it never minted.
76
+ def change_api_key(success)
77
+ mini_app = @oauth_application.mini_app
78
+ changed = false
79
+
80
+ if mini_app.nil? || !mini_app.supports_api_key?
81
+ flash[:error] = I18n.t('mini_apps.api_key.unsupported')
82
+ elsif confirmation_mismatched?(mini_app)
83
+ flash[:error] = I18n.t('mini_apps.api_key.confirmation_mismatched')
84
+ elsif yield
85
+ flash[:success] = I18n.t("mini_apps.api_key.#{success}")
86
+ changed = true
87
+ else
88
+ # The key's own validations still apply — a restored one another application has since taken
89
+ # lands here.
90
+ flash[:error] = @oauth_application.errors.full_messages.to_sentence
91
+ end
92
+
93
+ redirect_to_application
94
+
95
+ changed
96
+ end
97
+
98
+ def save_api_key(value, source: nil)
99
+ @oauth_application.mini_app.replace_api_key!(value, actor: try_spree_current_user, source: source)
100
+ @oauth_application.save
101
+ end
102
+
103
+ def api_key_history
104
+ SpreeCmCommissioner::MiniAppProvider::ApiKeyHistory.new(@oauth_application)
105
+ end
106
+
107
+ def confirmation_mismatched?(mini_app)
108
+ return false if mini_app.api_key.blank?
109
+
110
+ params[:api_key_confirm].to_s.strip != @oauth_application.name
111
+ end
112
+
113
+ def redirect_to_application
114
+ redirect_to spree.edit_admin_oauth_application_path(@oauth_application)
115
+ end
116
+ end
117
+ end
118
+ end
@@ -5,8 +5,18 @@ module Spree
5
5
  # Edit forms allow users to modify scopes without forced default
6
6
  before_action :set_default_scopes, only: [:new]
7
7
 
8
+ # Declared after ResourceController's own callbacks so @object is loaded by the time it runs.
9
+ before_action :take_minted_api_key, only: [:edit]
10
+
8
11
  private
9
12
 
13
+ # Written by OauthApplicationApiKeysController#create and read here, because this is the page that
14
+ # shows it. The session rather than the flash, because the admin layout renders whichever flash
15
+ # entry happens to be first. Deleted as it is read, so it is on screen for exactly one render.
16
+ def take_minted_api_key
17
+ @minted_api_key = session.delete(:minted_api_key)
18
+ end
19
+
10
20
  def create_turbo_stream_enabled?
11
21
  true
12
22
  end
@@ -3,6 +3,8 @@ module Spree
3
3
  module V2
4
4
  module Storefront
5
5
  class DynamicFieldOptionsController < ::Spree::Api::V2::ResourceController
6
+ before_action :ensure_dynamic_field_enabled_for_product, if: -> { params[:product_id].present? }
7
+
6
8
  # override
7
9
  def collection
8
10
  return @collection if defined?(@collection)
@@ -17,6 +19,16 @@ module Spree
17
19
  @collection
18
20
  end
19
21
 
22
+ private
23
+
24
+ # Only the product-scoped route checks this; the legacy flat route serves any field by id.
25
+ def ensure_dynamic_field_enabled_for_product
26
+ SpreeCmCommissioner::ProductDynamicField.find_by!(
27
+ product_id: params[:product_id],
28
+ dynamic_field_id: params[:dynamic_field_id]
29
+ )
30
+ end
31
+
20
32
  # override
21
33
  def collection_serializer
22
34
  SpreeCmCommissioner::V2::Storefront::DynamicFieldOptionSerializer
@@ -25,11 +25,6 @@ module Spree
25
25
 
26
26
  private
27
27
 
28
- # override from ContentCacheable
29
- def max_age
30
- CACHE_EXPIRES_IN.to_i
31
- end
32
-
33
28
  # override
34
29
  def collection_cache_key
35
30
  cache_key_parts = [
@@ -25,11 +25,6 @@ module Spree
25
25
 
26
26
  private
27
27
 
28
- # override from ContentCacheable
29
- def max_age
30
- CACHE_EXPIRES_IN.to_i
31
- end
32
-
33
28
  # override
34
29
  def collection_cache_key
35
30
  cache_key_parts = [
@@ -1,13 +1,6 @@
1
1
  module Spree
2
- module Billing
2
+ module Admin
3
3
  module NavigationHelperDecorator
4
- def billing_main_menu_tree(text, icon: nil, sub_menu: nil, url: '#')
5
- content_tag :li, class: 'sidebar-menu-item d-block w-100 text-muted' do
6
- main_menu_item(text, url: url, icon: icon) +
7
- render(partial: "spree/billing/shared/sub_menu/#{sub_menu}")
8
- end
9
- end
10
-
11
4
  def customer_per_page_dropdown
12
5
  per_page_default = Spree::Backend::Config.admin_orders_per_page
13
6
  per_page_options = %w[24 48 120 200 400 600]
@@ -23,4 +16,4 @@ module Spree
23
16
  end
24
17
  end
25
18
 
26
- Spree::Admin::NavigationHelper.prepend(Spree::Billing::NavigationHelperDecorator)
19
+ Spree::Admin::NavigationHelper.prepend(Spree::Admin::NavigationHelperDecorator)
@@ -0,0 +1,38 @@
1
+ module SpreeCmCommissioner
2
+ # Authenticates an ACLEDA Mini App session_key (a JWT minted by
3
+ # Vpago::AcledaMiniApp::Session::Create, signed with the user's secure_token).
4
+ #
5
+ # Unlike the Vattanac authenticator, this enforces the JWT signature: a token
6
+ # must be signed with the user's secure_token or it is rejected.
7
+ class UserAcledaBankWebAppAuthenticator < BaseInteractor
8
+ delegate :session_key, to: :context
9
+
10
+ def call
11
+ return context.fail!(message: 'Invalid token') unless payload
12
+ return context.fail!(message: 'User not found') unless user
13
+ return context.fail!(message: 'Invalid token signature') unless valid_signature?
14
+
15
+ context.user = user
16
+ rescue JWT::DecodeError => e
17
+ context.fail!(message: "Decode error: #{e.message}")
18
+ end
19
+
20
+ private
21
+
22
+ # Unverified decode, only to read user_id. The signature is enforced
23
+ # separately in #valid_signature?.
24
+ def payload
25
+ @payload ||= SpreeCmCommissioner::UserSessionJwtToken.decode(session_key)
26
+ end
27
+
28
+ def user
29
+ @user ||= Spree::User.find_by(id: payload['user_id']) if payload
30
+ end
31
+
32
+ # UserSessionJwtToken.decode returns nil when the signature does not verify
33
+ # against the user's secure_token, so a forged/tampered token fails here.
34
+ def valid_signature?
35
+ SpreeCmCommissioner::UserSessionJwtToken.decode(session_key, user.secure_token).present?
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,39 @@
1
+ module SpreeCmCommissioner
2
+ # Authenticates a Wing Mini App session_key (a JWT minted by
3
+ # Vpago::WingMiniApp::Session::Create, signed with the user's secure_token).
4
+ #
5
+ # Same shape as UserAcledaBankWebAppAuthenticator: the JWT signature is enforced
6
+ # here — a token must be signed with the user's secure_token or it is rejected.
7
+ class UserWingBankWebAppAuthenticator < BaseInteractor
8
+ delegate :session_key, to: :context
9
+
10
+ def call
11
+ return context.fail!(message: 'Invalid token') unless payload
12
+ return context.fail!(message: 'User not found') unless user
13
+ return context.fail!(message: 'Invalid token signature') unless valid_signature?
14
+
15
+ context.user = user
16
+ reject_unauthenticatable_user!(context.user)
17
+ rescue JWT::DecodeError => e
18
+ context.fail!(message: "Decode error: #{e.message}")
19
+ end
20
+
21
+ private
22
+
23
+ # Unverified decode, only to read user_id. The signature is enforced
24
+ # separately in #valid_signature?.
25
+ def payload
26
+ @payload ||= SpreeCmCommissioner::UserSessionJwtToken.decode(session_key)
27
+ end
28
+
29
+ def user
30
+ @user ||= Spree::User.find_by(id: payload['user_id']) if payload
31
+ end
32
+
33
+ # UserSessionJwtToken.decode returns nil when the signature does not verify
34
+ # against the user's secure_token, so a forged/tampered token fails here.
35
+ def valid_signature?
36
+ SpreeCmCommissioner::UserSessionJwtToken.decode(session_key, user.secure_token).present?
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,72 @@
1
+ module SpreeCmCommissioner
2
+ module OauthApplication
3
+ # Lets a Spree::OauthApplication stand for a mini app — the storefront a partner embeds in its
4
+ # own banking app. `provider` names which one; its settings live on a MiniAppProvider class.
5
+ module MiniApp
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ # Deterministic so `find_by` and the unique index keep working: calls are looked up by key.
10
+ encrypts :api_key, deterministic: true
11
+
12
+ # '' encrypts to a non-empty ciphertext, which the partial index cannot tell from a real key.
13
+ before_validation { self.api_key = nil if api_key.blank? }
14
+
15
+ # Unique: a keyless call is traced back by provider alone.
16
+ validates :provider,
17
+ inclusion: { in: -> (_application) { MiniAppProvider::Base.providers.map(&:provider) } },
18
+ uniqueness: true,
19
+ allow_blank: true
20
+
21
+ # `is`, not a minimum: a short or padded key saves fine, then fails every call the partner makes.
22
+ validates :api_key, uniqueness: true, allow_blank: true
23
+ validates :api_key, length: { is: MiniAppProvider::Base::API_KEY_LENGTH },
24
+ format: { without: /\s/, message: 'cannot contain spaces' }, # rubocop:disable Rails/I18nLocaleTexts
25
+ allow_blank: true
26
+
27
+ # Rules that do not parse stop matching silently and lock the mini app out.
28
+ validate do
29
+ mini_app&.invalid_ip_rules&.each do |name|
30
+ errors.add(:base, I18n.t('mini_apps.ip_rules.invalid', name: name.to_s.humanize))
31
+ end
32
+ end
33
+ end
34
+
35
+ class_methods do
36
+ # Authenticated lookup. The provider must match the row the key found, or one mini app's key
37
+ # would open another's flow. `api_key:` has no default: a missing header fails loudly here
38
+ # instead of falling through to #keyless_mini_app_for, where nothing is checked.
39
+ def mini_app_for(provider, api_key:)
40
+ return nil if api_key.blank?
41
+
42
+ application = find_by(api_key: api_key)
43
+ return nil unless application && application.provider.to_s == provider.to_s
44
+
45
+ mini_app = application.mini_app
46
+
47
+ mini_app if mini_app&.supports_api_key?
48
+ end
49
+
50
+ # For mini apps with no key to send — the partner only opens a WebView, so the customer's
51
+ # browser arrives, not the partner's server. Refuses any provider that does have a key, so
52
+ # nothing reaches a key-using mini app without it.
53
+ def keyless_mini_app_for(provider)
54
+ mini_app = find_by(provider: provider.to_s)&.mini_app
55
+
56
+ mini_app unless mini_app.nil? || mini_app.supports_api_key?
57
+ end
58
+ end
59
+
60
+ def mini_app
61
+ @mini_app ||= MiniAppProvider::Base.for(self)
62
+ end
63
+
64
+ # Preferences belonging to other mini apps are ignored rather than written to `settings`.
65
+ def mini_app_attributes=(attributes)
66
+ attributes.each do |name, value|
67
+ mini_app.public_send("#{name}=", value) if mini_app.respond_to?("#{name}=")
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -4,7 +4,7 @@ module SpreeCmCommissioner
4
4
 
5
5
  belongs_to :vendor, class_name: 'Spree::Vendor', optional: false
6
6
 
7
- has_many :dynamic_field_options, class_name: 'SpreeCmCommissioner::DynamicFieldOption', dependent: :destroy
7
+ has_many :dynamic_field_options, -> { order(:position) }, class_name: 'SpreeCmCommissioner::DynamicFieldOption', dependent: :destroy
8
8
  has_many :guest_dynamic_fields, class_name: 'SpreeCmCommissioner::GuestDynamicField', dependent: :destroy
9
9
  has_many :product_dynamic_fields, class_name: 'SpreeCmCommissioner::ProductDynamicField', dependent: :destroy
10
10
 
@@ -19,6 +19,7 @@ module SpreeCmCommissioner
19
19
  validate :validate_data_fill_stage_phase
20
20
 
21
21
  after_commit :enqueue_data_fill_stage_maintenance_for_products, on: %i[update], if: :saved_change_to_data_fill_stage?
22
+ after_commit :enqueue_cache_invalidation_for_products, on: %i[update]
22
23
 
23
24
  scope :with_dynamic_field_options, -> { includes(dynamic_field_options: :dynamic_field) }
24
25
 
@@ -57,6 +58,16 @@ module SpreeCmCommissioner
57
58
  end
58
59
  end
59
60
 
61
+ # Destroy isn't handled here: by after_commit the join rows are gone, and each
62
+ # ProductDynamicField destroyed with this field enqueues its own product.
63
+ def enqueue_cache_invalidation_for_products
64
+ product_dynamic_fields.distinct.pluck(:product_id).each do |product_id|
65
+ SpreeCmCommissioner::MaintenanceTasks::CacheInvalidation
66
+ .pending
67
+ .create_or_find_by(maintainable_type: 'Spree::Product', maintainable_id: product_id)
68
+ end
69
+ end
70
+
60
71
  def validate_data_fill_stage_phase
61
72
  return if data_fill_stage.blank?
62
73
 
@@ -11,8 +11,19 @@ module SpreeCmCommissioner
11
11
  validates :status, presence: true
12
12
  validate :parent_field_must_be_selection_type
13
13
 
14
+ after_commit :enqueue_cache_invalidation_for_products
15
+
14
16
  private
15
17
 
18
+ # Options are embedded in the storefront dynamic_fields response of every product using the parent field.
19
+ def enqueue_cache_invalidation_for_products
20
+ SpreeCmCommissioner::ProductDynamicField.where(dynamic_field_id: dynamic_field_id).distinct.pluck(:product_id).each do |product_id|
21
+ SpreeCmCommissioner::MaintenanceTasks::CacheInvalidation
22
+ .pending
23
+ .create_or_find_by(maintainable_type: 'Spree::Product', maintainable_id: product_id)
24
+ end
25
+ end
26
+
16
27
  def parent_field_must_be_selection_type
17
28
  return unless dynamic_field
18
29
 
@@ -311,6 +311,14 @@ module SpreeCmCommissioner
311
311
  Array(public_metadata['eligible_check_in_session_ids']).map(&:to_i)
312
312
  end
313
313
 
314
+ # The buyer's order that took over this ticket. Nil until a transfer out of this guest completes,
315
+ # which is also when the guest is marked transferred.
316
+ def transferred_to_order
317
+ return nil unless transferred?
318
+
319
+ ticket_transfers.completed.order(:completed_at).last&.order
320
+ end
321
+
314
322
  # Set by TicketTransfers::TransferGuest when this guest was created to receive a transferred ticket
315
323
  def from_transfer?
316
324
  ActiveModel::Type::Boolean.new.cast(public_metadata['from_transfer']) || false
@@ -0,0 +1,28 @@
1
+ module SpreeCmCommissioner
2
+ module MiniAppProvider
3
+ class AcledaBank < Base
4
+ # The HMAC key ACLEDA signs each session request with, kept here rather than in
5
+ # Doorkeeper's own `secret`: whether that column stays readable depends on
6
+ # `hash_application_secrets`, which the engines turn on and cm-market-server
7
+ # comments out, and a key that has to be recomputed cannot rest on which
8
+ # initializer ran last.
9
+ preference :secret_key, :string, default: ''
10
+
11
+ def self.credential
12
+ :secret_key
13
+ end
14
+
15
+ def self.supports_api_key?
16
+ true
17
+ end
18
+
19
+ def self.preference_groups
20
+ {
21
+ credentials: %i[secret_key],
22
+ ip_rules: IP_RULES,
23
+ rate_limits: RATE_LIMITS
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end