Skip to content

Commit

Permalink
Add check to refund stripe donations only (podkrepi-bg#1648)
Browse files Browse the repository at this point in the history
* Add if check to refund only stripe donations

* Use enum for variables

* Fix prettier
  • Loading branch information
Nnachevvv authored and tongo-angelov committed Nov 14, 2023
1 parent 1042123 commit 7e3c89a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/admin/donations/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useStores } from '../../../../common/hooks/useStores'
import RenderEditBillingEmailCell from './RenderEditBillingEmailCell'
import RestoreIcon from '@mui/icons-material/Restore'
import RefundModal from '../modals/RefundModal'
import { DonationStatus, PaymentProvider } from '../../../../gql/donations.enums'

interface RenderCellProps {
params: GridRenderCellParams
Expand Down Expand Up @@ -154,7 +155,8 @@ export default observer(function Grid() {
width: 120,
resizable: false,
renderCell: (params: GridRenderCellParams) => {
return params.row?.status === 'succeeded' ? (
return params.row?.status === DonationStatus.succeeded &&
params.row?.provider === PaymentProvider.stripe ? (
<>
<Tooltip title={t('donations:refund.icon')}>
<IconButton
Expand Down

0 comments on commit 7e3c89a

Please sign in to comment.