Commit Graph

35235 Commits

Author SHA1 Message Date
Maikel Linke
9961578fc1 Don't offer to void a refund 2026-03-16 12:56:38 +11:00
Maikel Linke
53c2ef53d5 Call #credit with right arguments 2026-03-16 12:56:22 +11:00
Maikel Linke
7619062ad2 Revert "Move payment action logic to payment"
This reverts commit fdd22bc097.

And it adds the now needed `can_credit?` method to Taler.
It's just a duplicate.
2026-03-11 11:32:08 +11:00
Maikel Linke
fb2dfed6bf Pass amount to payment mailer
We now include the refunded amount in the email to the customer. When
voiding a payment, it's the full amount of the payment. When giving back
credit then it's only the money that has been paid too much.
2026-03-11 10:58:30 +11:00
Maikel Linke
cf53ac1990 Add credit action to Taler 2026-03-11 10:58:30 +11:00
Maikel Linke
fdd22bc097 Move payment action logic to payment
At closer inspection, almost all logic around which payment actions to
display involves only the state of the payment. So I moved the logic
there.

We now have one list of all possible actions supported by the UX. Then
payment methods can declare a list of supported actions. If that's
conditional, they can implement the conditions themselves. The payment
model itself then still filters the actions based on its state.
2026-03-11 10:58:30 +11:00
Maikel Linke
956c4a27c2 Remove unnecessary guard clause
Previously, payment actions that were listed without an associated
`can_?` method were interpreted as supported. All payment methods are
implementing all `can_?` methods for listed actions though. And I think
that new payment methods should explicitely implement all `can_?`
methods instead of relying on this hidden logic.
2026-03-11 10:58:30 +11:00
Maikel Linke
2b32f6b909 Make payment method source of truth of supported actions 2026-03-11 10:58:30 +11:00
Maikel Linke
303b91af5e Move list of payment actions from card to gateway
We currently ask the credit card first which payment actions like "void"
it supports. But all the logic is not card specifc. It depends on the
payment method which actions it supports.

And instead of having two different classes potentially being the source
of truth for actions, I prefer leaving that responsibility with exactly
one class, the payment method.

I'll move the `can_?` methods next.
2026-03-11 10:58:30 +11:00
Maikel Linke
ce96b58800 Remove useless setting of payment amount
It gets overridden later anyway.
2026-03-11 10:58:25 +11:00
Gaetan Craig-Riou
dff9d7ede6 Merge pull request #14009 from openfoodfoundation/dependabot/npm_and_yarn/postcss-8.5.8
Bump postcss from 8.5.6 to 8.5.8
2026-03-11 10:32:14 +11:00
Gaetan Craig-Riou
210303de90 Merge pull request #14011 from openfoodfoundation/dependabot/bundler/flipper-ui-1.4.0
Bump flipper-ui from 1.3.6 to 1.4.0
2026-03-11 10:30:56 +11:00
Gaetan Craig-Riou
7a0eee121d Merge pull request #14010 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.7.6
Bump @floating-ui/dom from 1.7.5 to 1.7.6
2026-03-11 10:24:43 +11:00
Gaetan Craig-Riou
9816332601 Update all locales with the latest Transifex translations v5.4.5 2026-03-10 22:15:29 +11:00
Gaetan Craig-Riou
4810b02233 Merge pull request #13702 from marincarroll/improve-accessibility-of-admin-pagination
Improve accessibility of admin pagination
2026-03-10 22:12:57 +11:00
Gaetan Craig-Riou
f8716f8005 Merge pull request #13963 from rioug/13855-payment-with-credit
Payment with credit
2026-03-10 22:11:40 +11:00
dependabot[bot]
8064154a86 Bump flipper-ui from 1.3.6 to 1.4.0
Bumps [flipper-ui](https://github.com/flippercloud/flipper) from 1.3.6 to 1.4.0.
- [Release notes](https://github.com/flippercloud/flipper/releases)
- [Changelog](https://github.com/flippercloud/flipper/blob/main/Changelog.md)
- [Commits](https://github.com/flippercloud/flipper/compare/v1.3.6...v1.4.0)

---
updated-dependencies:
- dependency-name: flipper-ui
  dependency-version: 1.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 09:34:57 +00:00
dependabot[bot]
c3051ea351 Bump @floating-ui/dom from 1.7.5 to 1.7.6
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.7.5 to 1.7.6.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.7.6/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-version: 1.7.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 09:33:40 +00:00
dependabot[bot]
c850feeab8 Bump postcss from 8.5.6 to 8.5.8
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.6 to 8.5.8.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.6...8.5.8)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 09:33:21 +00:00
Gaetan Craig-Riou
5cf213f22a Fix failing spec 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
251a1acffc Clean up enterprise controller 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
d5dec05ab1 Remove payment method ApiCustomerCredit 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
7790259c27 Add transaction origin for internal credit payments 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
6a99d2a3c8 Add transaction origin in descriptiopn 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
bd0dcd99f3 Fix failing spec
I wrongly fixed it due to my local database having rogue data
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
bc23423521 Remove the link between enterprise and internal payment method
Enterprise have access to the internal payment method by default.
The access is handled at the application level so we don't have to
manage database links.
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
25c579c478 Per review, small code fixes 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
66b820869c Add missing reference to spree_payments 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
ffc819ea76 Linting migration 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
ed3f928783 Fix diplaying customer transactions when no transaction 2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
63a9601812 Add scroll bar to modal component
When content is too big, the bottom is displayed off screen
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
597c0590ed Add the ability to show ID on backoffice customer screen
The customer ID is needed for the customer account transaction api
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
b9b91620ef Make sure to link credit payment method on create and update 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
85e0da8aeb Improve concurrency spec
Add checks to see if breakpoint is actually reach and if we have a race
condition.
2026-03-10 16:07:43 +11:00
Gaetan Craig-Riou
34c91613f7 Customer account transaction, simplify balance calculation
Lock the customer to ensure the balance calculation is correct. Much
simpler than locking the first transaction.
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
628810eb33 Fix spec to work with the internal payment method 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
3e2e7f1799 Add button to credit customer when order is credit owed state
It will add a negative payment, matching the amount credited in the
customer_account_transaction
2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
ee13a3abaf Add Orders::CustomerCreditService.refund
It will be used to credit the customer any fund from an order in
credit_owed state
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
5e4cd4d51d Remove unused helper 2026-03-10 16:07:42 +11:00
Gaetan Craig-Riou
c0823d24c2 Fix deprecation warning 2026-03-10 16:07:42 +11:00