Commit Graph

2765 Commits

Author SHA1 Message Date
Gaetan Craig-Riou
7790259c27 Add transaction origin for internal credit payments 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
e7a2b7ea48 Remove payment method from customer account transaction 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
a4ca56c7a5 Refactored internal payment method
We now check on known payment method type, instead of using the internal
collumn.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
9f7655852d Provide helper method to get internal payment method 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
ec106a8f83 Add new payment method ApiCustomerCredit
It was previously modelled by a "Check" payment method
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
2e7237197a Refactor customer credit payment method
Set fixed name and description
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
3b068b7125 Add created_by to customer account transactions
It allows tracking of who credited the customer via :
- customer account transaction API
- order payment screen
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
c67d47a773 Check if internal payment can be voided
Add extra security, we don't want to void a credit payment that is not
completed, otherwise we would be refunding credit that was not used.
A credit payment should not be in a non completed state, but you never
know.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
219e3ca9c8 Fix typo 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
d95aac333b Add internal to payment method
It's used to hide the payment method used for paying with credit. These
payment method are for internal use only.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
d5bd8fa086 Add ability to "void" a customer credit payment
Voiding the payment will refund the credit used to the customer.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
41e4fd79a3 Move logic to apply customer credit to it's on service
It's now called as a before transition callback when the order move to
payment. We need to apply the credit at this point to account for
order fees, ie: shippment fees.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
5a376c9106 Add customer_credit scope 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
152fd15bd0 Use display_name and display_description for payment method 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
5bdb6e6d69 Clean up spec 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
130401263a Add CreditPaymentMethod::Linker
It links the given enterprise to credit related payment method. It
will create the methods if missing.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
29a8a6641c Add ability to use payment with credit
Currently it works like any other payment method you can select on
checkout. It will eventually be added automatically to the order, when a
customer has credit available.
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
28241756aa Add Customer Credit payment method
It doesn't do anything yet
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
fec5516fce Backoffice customer, Add pop up to list customer payments 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
be7be9bbc6 Add api endpoing to create customer transactions
Plus specs and documentation
2026-03-10 16:07:41 +11:00
Maikel
f7f7a5738a Merge pull request #13895 from cillian/remove-angular-from-enterprise-settings-users
Remove Angular from Enterprise > Settings > Users section
2026-03-06 14:05:13 +11:00
Maikel
9fb8bb15e8 Merge pull request #13951 from zilton7/fix/spree-credit-card-brand-deprecation
Fix Spree::CreditCard#brand= deprecation for Rails 7.2 compatibility
2026-03-04 11:01:10 +11:00
Cillian O'Ruanaidh
f1071575cd Remove Angular from Enterprise > Settings > Users section 2026-03-04 10:28:36 +11:00
David-OFN-CA
7922bf7b65 Revert "Fix 9 Rubocop violations (Rails/Presence and Rails/RedirectBackOrTo)Fix rubocop violations" 2026-02-26 17:04:21 -05:00
David-OFN-CA
2d46676bb4 Merge pull request #13973 from David-OFN-CA/fix-rubocop-violations
Fix 9 Rubocop violations (Rails/Presence and Rails/RedirectBackOrTo)Fix rubocop violations
2026-02-26 16:01:15 -05:00
David Thomas
18869979db Safely autocorrect Rails/Presence
Inspecting 1721 files
...................................C.................................................................................................................................................................................................................................................................................................................................................C...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/controllers/admin/enterprises_controller.rb:180:7: C: [Corrected] Rails/Presence: Use @object.custom_tab.presence&.destroy instead of @object.custom_tab.destroy if @object.custom_tab.present?.
      @object.custom_tab.destroy if @object.custom_tab.present?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:243:9: C: [Corrected] Rails/Presence: Use (enterprises.presence&.includes(supplied_products: [:variants, :image])) instead of if enterprises.present? ... end.
        if enterprises.present? ...
        ^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:243:9: C: [Corrected] Style/RedundantParentheses: Don't use parentheses around a method call.
        (enterprises.presence&.includes(supplied_products: [:variants, :image]))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/product.rb:298:7: C: [Corrected] Rails/Presence: Use (first_variant.supplier.presence&.touch) instead of first_variant.supplier.touch if first_variant.supplier.present?.
      first_variant.supplier.touch if first_variant.supplier.present?
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/product.rb:298:7: C: [Corrected] Style/RedundantParentheses: Don't use parentheses around a method call.
      (first_variant.supplier.presence&.touch)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1721 files inspected, 5 offenses detected, 5 offenses corrected
2026-02-26 15:34:45 -05:00
Zil Norvilis
0bc4b1c885 refactor: Standardize credit card type attribute to cc_type across the application, removing the brand alias and related methods. 2026-02-25 19:35:53 +02:00
Zil Norvilis
ce94b394b2 feat: Add brand= setter to Spree::CreditCard for cc_type assignment. 2026-02-22 22:01:54 +02:00
Maikel Linke
de873ae42c Add void action to Taler for refunds 2026-02-20 13:43:09 +11:00
Maikel Linke
ed701b00dc Stop storing now redundant redirect URL
The Taler gem now computes it from the order id. No need to store it.
2026-02-20 13:43:04 +11:00
Maikel Linke
52e2fb923e Update Taler calls for new v0.2.0 2026-02-20 13:37:46 +11:00
Gaetan Craig-Riou
e276fb0386 Merge pull request #13930 from openfoodfoundation/dependabot/bundler/rubocop-1.84.1
Bump rubocop from 1.81.7 to 1.84.2
2026-02-20 09:05:41 +11:00
Rachel Arnould
f86eb3fb82 Merge pull request #13920 from mkllnk/clean-name
Stop pre-selecting Paypal when creating a payment method
2026-02-19 11:38:56 +01:00
Rachel Arnould
0d46a3bc2e Merge pull request #13902 from mkllnk/refund-simple
Simplify refund logic
2026-02-19 11:06:00 +01:00
Rachel Arnould
fb0f379c43 Merge pull request #13823 from chahmedejaz/bugfix/13625-enterprise-fee-reports-throws-504
Some Enterprise Fee reports are unusable when managing big shops
2026-02-18 15:22:21 +01:00
Maikel Linke
da1e1a9859 Style indentation 2026-02-18 09:42:07 +11:00
Maikel Linke
482c2a4a6e Delete now unused method clean_name 2026-02-13 12:36:26 +11:00
Ashish Gaur
b98552003c 13220 Add Product name in Order LineItem and update it during order creation
13220 Fixes affiliate sales spec

13220 Use before_create to update product name

13220 Fixes rubocop warnings

13220 Update product_name in line_item in specs

13220 Fix before_create lint

13220 Add spec for checking product_name is not set in reports

13220 Fixes rubocop issue

13220 Add migrations for updating the existing line items

13220 Fixing lint issues

13220 Set product_name in line_item before doing validation

13220 Fix linter issues

13220 Fixes spec

13220 Fixes linter issues

13220 Review comments

13220 Review comments

13220 Add default product name

13220 Use product_name instead of variant product name when using line item

13220 Fix specs

13220 Revert change in affiliate_sales_data_spec

CL-13220 Store variant name in line_item

13220 Default variant name to original variant's full name for line_items

13220 Add missing frozen string literal

13220 Add spec for full_variant_name

13220 Remove UpdateProductNameInLineItems and AddNotNullToProductNameInLineItems migrations

13220 Remove presence validation for product_name

13220 Use full_product_name which defaults to variant product name if empty
2026-02-06 12:17:03 +11:00
Maikel Linke
162c58ac39 Check which methods we need to delegate
This implicit delegation makes it impossible to know which code is used
and which code is dead. The refund method is very rarely used though. So
we'll need to wait for a while.
2026-02-04 12:24:50 +11:00
Maikel Linke
02d47d0a0d Remove unused method #payment_profiles_supported?
And useless specs.
2026-02-04 11:37:53 +11:00
Maikel Linke
f9617b8156 Remove broken dead code branch
The StripeSCA method is forwarding all missing methods to the provider
gateway. The ActiveMerchant gateway used to be decorated by our code and
that's how this code may have worked one day. But we removed the
decorator years ago:

- 549610bc35

A bit later we found that refunds are broken with Stripe:

- https://github.com/openfoodfoundation/openfoodnetwork/issues/12843

This commit could potentiall fix that, I guess? I haven't tested that.
It's a rare use case and not the aim of this work.
2026-02-04 11:30:36 +11:00
Maikel Linke
4650e30c09 Remove useless branch on credit method 2026-02-04 11:30:36 +11:00
Maikel Linke
2749965e73 Remove useless branch calling #void
StripeSCA is the only method with a different method signature for
`#void` but the additional parameter wasn't used. So this special case
can just be removed.
2026-02-04 11:30:36 +11:00
Maikel Linke
e87965bda0 Simplify storing of payment profiles
StripeSCA is the only payment method storing profiles following this
logic. This is the first step to remove indirection and let the payment
method handle this instead of the payment decided for the payment
method.
2026-02-04 11:30:36 +11:00
Ahmed Ejaz
99e238d92d Improve reports AJAX search safety, permissions, and TomSelect UX
- Sanitize AJAX search queries to safely support wildcard searches (ILIKE)
- Centralize reports search actions in Spree::Ability and reuse across roles
- Fix TomSelect remote loading to fetch on dropdown open and typing
- Surface HTTP errors in TomSelect via showHttpError and improve error handling
- Update dropdown behavior to show proper “no results” feedback
- Move reports AJAX specs to request specs and expand pagination coverage
- Simplify searchable dropdown component attribute passing
2026-02-04 02:25:41 +05:00
Maikel Linke
c115ab7a0d Translate Taler payment status to error message 2026-01-29 15:07:28 +11:00
Maikel Linke
b9c7925008 Complete Taler payment success scenario 2026-01-29 15:07:28 +11:00
Maikel Linke
c11b93a4dc Demo Taler flow without validating payment yet 2026-01-29 15:07:28 +11:00
Maikel Linke
61e0688392 Demonstrate retrieving the payment Taler URL 2026-01-29 15:07:27 +11:00
Maikel Linke
b3a1d1269a Add Taler as payment method
It doesn't take payments yet but can be selected during checkout.
2026-01-29 15:07:27 +11:00