Maikel Linke
f3c60148c1
Simplify filtering of Stripe
2026-01-09 16:54:25 +11:00
Maikel Linke
2e08c9c44e
Simplify with defined order of payment methods
2026-01-09 16:54:21 +11:00
Maikel Linke
93f2af7e7d
Lazy load payment method classes
...
This avoids any class reloading issues in dev, simplifies most of the
code path and opens up for refactoring.
The only reason we still load the class is to call `clean_name` on it
for the translation key. We can probably do better.
2026-01-09 16:54:02 +11:00
Maikel Linke
cb7a4b67ce
Replace custom lookup with default Rails feature
...
Rails renders an error when you try to supply an invalid value. Our code
is safe without an allow-list and the UX doesn't allow you to select an
invalid value.
2026-01-09 16:53:06 +11:00
Maikel Linke
41a8d06326
Remove duplicate definition of payment providers
2026-01-09 15:16:36 +11:00
Maikel Linke
a1bdfa0a20
Move list of payment methods to where it is used
2026-01-09 15:16:36 +11:00
Gaetan Craig-Riou
bd0db57768
Per review, more concise code
2025-11-03 15:58:27 +11:00
Gaetan Craig-Riou
adb7563ccb
Fix possible code injection
...
It will fix this security issue :
https://github.com/openfoodfoundation/openfoodnetwork/security/code-scanning/247
2025-10-21 15:48:27 +11:00
Maikel Linke
687176cf49
Remove trouble-some hiredis
...
The hiredis client was praised as being faster parsing bulk responses
but it seems to have multiple issues now:
- The redis release 5.0 moved hiredis support to another gem.
- I tried the hiredis-client gem and it raised errors.
- There are claims of worse performance of hiredis [1].
- Maintenance responsiveness has been questioned [2].
Using the default redis driver seems to work fine though.
[1]: https://discuss.rubyonrails.org/t/hiredis-does-not-support-ssl-action-cable/75945
[2]: https://github.com/redis/hiredis/issues/655
2024-01-25 13:28:44 +11:00
Neal Chambers
0663f04535
Remove Simple References to Bogus Gateway
2023-11-07 11:19:26 +09:00
Maikel
6a236a8678
Revert "replace hiredis gem with hiredis-client"
2023-11-01 15:16:57 +11:00
Mohamed ABDELLANI
d6890e9828
check key class before call Rails.cache.delete
2023-10-26 10:27:00 +01:00
James Wu
2a7cb50fa9
Keep and display submitted data on new payment method page
2023-04-18 09:39:39 +10:00
James Wu
ae5f2cc19d
Fix error saving data on new Calculator
2023-04-18 09:39:39 +10:00
James Wu
41ce4fbc16
Fix cache issue with invalid form data
2023-04-18 09:39:39 +10:00
James Wu
48753df5f0
Improve input validation and error notification
2023-04-18 09:39:39 +10:00
Maikel Linke
f22c2b0e73
Remove option to create StripeConnect methods
2022-01-24 12:35:45 +11:00
Maikel Linke
6d1e984af7
Enable testers to activate StripeConnect
...
This will make it easier to test the removal of StripeConnect.
2021-12-20 17:16:39 +11:00
Maikel Linke
470fc92825
Fix old, confusing typo
2021-12-20 17:13:40 +11:00
Maikel Linke
22de357724
Hide deprecated StripeConnect payment gateway
...
StripeConnect has been replaced by StripeSCA but some people still use
the old StripeConnect. Let's prevent people from creating deprecated
payment methods before migrating existing data.
2021-12-20 17:12:19 +11:00
Maikel Linke
6966dea0f5
Extract changing Stripe method selection logic
...
It will change and it's clearer in a separate method.
2021-12-20 17:09:57 +11:00
Maikel
c9d36e6f5c
Merge pull request #8204 from meronokbay/6942-fix-payment-method-fee-bug-all
...
Fix payment method fee bug for all calculator types
2021-09-28 08:39:05 +10:00
Maikel
a3c31f7d86
Revert "Kill stripe connect"
2021-09-20 08:39:34 +10:00
Meron Ogbai
cd992ee866
Validate preferred values all calculators
2021-09-17 18:50:29 +03:00
Meron Ogbai
957f834694
Rename preferred amount to preferred value
2021-09-17 18:49:57 +03:00
Meron Ogbai
d73df78f43
Extract gateway_params to a private method
2021-09-17 16:48:53 +03:00
Luis Ramos
60a8ae6675
Remove Stripe Connect gateway and related code
2021-09-10 14:43:24 +05:30
Maikel
9affc6a945
Merge pull request #8108 from Matt-Yorkley/andand
...
Remove `andand` gem
2021-09-10 15:06:00 +10:00
Matt-Yorkley
1d5077061e
Remove andand
...
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Meron Ogbai
5ca552d380
Show flash error if preferred amount isn't valid
2021-09-05 01:11:12 +03:00
Luis Ramos
e52937c113
Use rubocop auto correct to add frozen string literal to all files
...
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Matt-Yorkley
50e0d78c0c
Remove dead callback invocations
2021-03-21 14:06:23 +00:00
Matt-Yorkley
365dc2a49e
Update payment methods controller callback
2021-03-21 14:05:57 +00:00
Matt-Yorkley
707d089419
Update type handling in PaymentMethodsController and add tests
2021-03-13 10:57:54 +00:00
Matt-Yorkley
6d51ece69c
Tidy up payment method params
2021-03-13 10:57:51 +00:00
Andy Brett
51630ac77b
remove "Bogus" payment providers from staging and production
2021-02-03 14:03:13 -08:00
Matt-Yorkley
0e82160b76
Touch the updated_at column when updating records via #update_column
...
#update_column(s) skips callbacks (which is useful), but it doesn't change the updated_at field on the record by default (which we should be doing in these cases).
This change is made in Spree 2.2 here: b367c629ce
2021-01-30 12:49:38 +00:00
Luis Ramos
0f27f57cbb
Use new Admin::ResourceController
2020-12-03 15:32:20 -08:00
Luis Ramos
0fb9f44dda
Make all controllers use new Admin::ResourceController
2020-12-03 15:32:20 -08:00
Matt-Yorkley
36f4f40e84
Refactor and fix PaymentMethod strong params
2020-11-17 18:51:48 +00:00
Luis Ramos
7b06fdd943
Convert to array before using sort_by!
2020-10-30 10:12:56 +00:00
Luis Ramos
1df7890a0d
Use spree url_helpers
2020-09-17 13:59:41 +01:00
Luis Ramos
e0cb7a29bf
Add helper prefix to helper calls
2020-09-17 13:58:45 +01:00
Matt-Yorkley
c009fed6be
Update StrongParams for Pin Payments
2020-07-15 14:00:19 +02:00
Luis Ramos
f848a89a00
Rename update_attributes to update #rails4
2020-06-22 16:51:43 +01:00
Luis Ramos
8a61257547
Rename all before_filter to before_action, it's the same function with a new name
2020-06-22 13:11:57 +01:00
Luis Ramos
df799340df
Add missing permitted attributes to payment_methods controller
2020-03-21 14:21:52 +00:00
Luis Ramos
e5ebf45765
Improve strong params implementation on payment methods controller by specifying specific list of permitted attributes
2020-03-21 14:09:33 +00:00
Luis Ramos
38849f5589
Extract method in payments_method_controller to make it readable
2020-03-21 14:09:32 +00:00
Luis Ramos
86d09ff21e
Bring strong parameters code from spree to payment_methods_controller
...
This code comes from spree commit fbc2d150f6
2020-03-21 14:08:03 +00:00