Skip to content

Commit

Permalink
Don't show users as unpaid if one of their payment attempts succeeded (
Browse files Browse the repository at this point in the history
…#10290)

* use has_paid when determining tooltip

* only show successful transaction for refund

* revert changes to payment_controller
  • Loading branch information
FinnIckler authored Nov 25, 2024
1 parent b4c85e4 commit fc145bf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import { countries } from '../../../lib/wca-data.js.erb';
const truncateComment = (comment) => (comment?.length > 12 ? `${comment.slice(0, 12)}...` : comment);

function RegistrationTime({
timestamp, registeredOn, paymentStatuses, paidOn, usesPaymentIntegration,
timestamp, registeredOn, paymentStatuses, hasPaid, paidOn, usesPaymentIntegration,
}) {
if (timestamp) {
return getRegistrationTimestamp(paidOn ?? registeredOn);
}

const mostRecentPaymentStatus = paymentStatuses ? paymentStatuses[0] : 'unpaid';

if (usesPaymentIntegration && mostRecentPaymentStatus !== 'succeeded') {
if (usesPaymentIntegration && !hasPaid) {
let content = i18n.t('registrations.list.payment_requested_on', { date: getRegistrationTimestamp(registeredOn) });
let trigger = <span>{i18n.t('registrations.list.not_paid')}</span>;

Expand Down Expand Up @@ -151,6 +151,7 @@ export default function TableRow({
<RegistrationTime
timestamp={timestamp}
paidOn={updatedAt}
hasPaid={hasPaid}
registeredOn={registeredOn}
paymentStatuses={paymentStatuses}
usesPaymentIntegration={competitionInfo['using_payment_integrations?']}
Expand Down

0 comments on commit fc145bf

Please sign in to comment.