@@ -14,7 +14,7 @@ import { createRefundTransaction, pauseOrderInDb } from '../../lib/payments';
1414import { validateWebhookEvent } from '../../lib/paypal' ;
1515import { recordOrderProcessed } from '../../lib/recurring-contributions' ;
1616import { reportErrorToSentry , reportMessageToSentry } from '../../lib/sentry' ;
17- import models , { Op } from '../../models' ;
17+ import models from '../../models' ;
1818import { PayoutWebhookRequest , PaypalCapture } from '../../types/paypal' ;
1919
2020import { paypalRequestV2 } from './api' ;
@@ -197,7 +197,7 @@ async function handleCaptureCompleted(req: Request): Promise<void> {
197197 const existingTransaction = await models . Transaction . findOne ( {
198198 where : {
199199 OrderId : order . id ,
200- data : { capture : { id : capture . id } } ,
200+ data : { paypalCaptureId : capture . id } ,
201201 } ,
202202 } ) ;
203203
@@ -249,13 +249,7 @@ async function handleCaptureRefunded(req: Request): Promise<void> {
249249 kind : TransactionKind . CONTRIBUTION ,
250250 isRefund : false ,
251251 RefundTransactionId : null ,
252- data : {
253- [ Op . or ] : [
254- { capture : { id : captureDetails . id } } ,
255- { paypalSale : { id : captureDetails . id } } ,
256- { paypalTransaction : { id : captureDetails . id } } ,
257- ] ,
258- } ,
252+ data : { paypalCaptureId : captureDetails . id } ,
259253 } ,
260254 include : [
261255 {
0 commit comments