File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/api/webhooks/trolley/handlers Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ export class RecipientAccountHandler {
97
97
recipient_account_id : recipientAccountId ,
98
98
} ,
99
99
} ) ;
100
- return ;
101
100
}
102
101
103
102
// no recipient, and payment method is not primary in trolley, return and do nothing
@@ -106,7 +105,7 @@ export class RecipientAccountHandler {
106
105
}
107
106
108
107
// update the payment method if it exists & it was set to primary in trolley
109
- if ( isPrimaryPaymentMethod ) {
108
+ if ( recipientPaymentMethod && isPrimaryPaymentMethod ) {
110
109
await this . prisma . trolley_recipient_payment_method . update ( {
111
110
where : { id : recipientPaymentMethod . id } ,
112
111
data : {
@@ -117,6 +116,7 @@ export class RecipientAccountHandler {
117
116
118
117
// remove the payment method if it exists (with the same ID) and it was set as inactive in trolley
119
118
if (
119
+ recipientPaymentMethod &&
120
120
! isPrimaryPaymentMethod &&
121
121
recipientPaymentMethod . recipient_account_id === recipientAccountId
122
122
) {
You can’t perform that action at this time.
0 commit comments