Skip to content

Commit

Permalink
one last fix
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf committed Feb 27, 2024
1 parent 00d708c commit 9307953
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions server/paymentProviders/opencollective/manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions test/cron/monthly/host-settlement.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 ----
Expand Down

0 comments on commit 9307953

Please sign in to comment.