diff --git a/server/paymentProviders/opencollective/manual.js b/server/paymentProviders/opencollective/manual.js index a2c0164c7d5..c4d6576949a 100644 --- a/server/paymentProviders/opencollective/manual.js +++ b/server/paymentProviders/opencollective/manual.js @@ -102,9 +102,8 @@ async function processOrder(order) { * There's nothing more to do because it's up to the host/collective to see how * they want to actually refund the money. */ -const refundTransaction = async (transaction, user, reason, opts = null) => { - const data = reason ? { refundReason: reason } : null; - return await createRefundTransaction(transaction, 0, data, user, opts?.TransactionGroup); +const refundTransaction = async (transaction, user, reason) => { + return createRefundTransaction(transaction, 0, { ...transaction.data, refundReason: reason }, user); }; /* Expected API of a Payment Method Type */ diff --git a/test/cron/monthly/host-settlement.test.js b/test/cron/monthly/host-settlement.test.js index 92f267bb233..b2f1a12eef8 100644 --- a/test/cron/monthly/host-settlement.test.js +++ b/test/cron/monthly/host-settlement.test.js @@ -4,7 +4,7 @@ import sinon, { useFakeTimers } from 'sinon'; import { run as invoicePlatformFees } from '../../../cron/monthly/host-settlement'; import { TransactionKind } from '../../../server/constants/transaction-kind'; -import { refundTransaction } from '../../../server/lib/payments'; +import { createRefundTransaction } from '../../../server/lib/payments'; import { getTaxesSummary } from '../../../server/lib/transactions'; import models, { sequelize } from '../../../server/models'; import { @@ -193,8 +193,8 @@ describe('cron/monthly/host-settlement', () => { // Refund contributions that must be let clock = sinon.useFakeTimers(moment(lastMonth).add(1, 'day').toDate()); - await refundTransaction(unsettledRefundedContribution, user); - await refundTransaction(settledRefundedContribution, user); + await createRefundTransaction(unsettledRefundedContribution, 0, null, user, fakeUUID('00000008')); + await createRefundTransaction(settledRefundedContribution, 0, null, user, fakeUUID('00000009')); clock.restore(); // ---- EUR Host ----