Skip to content

Commit 13aac2d

Browse files
committed
fix: correct gateway isActive mapping and improve refund error handling
This fixes the 'is_active' column mapping in Gateway model and adds a null check for transaction.gateway in the PaymentService refund method.
1 parent bd668e8 commit 13aac2d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/models/gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Gateway extends BaseModel {
88
@column()
99
declare name: string
1010

11-
@column()
11+
@column({ columnName: 'is_active' })
1212
declare isActive: boolean
1313

1414
@column()

app/services/payment_service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class PaymentService {
8787
}
8888

8989
const instance = this.gatewayInstances[transaction.gateway?.name || '']
90-
if (!instance) {
90+
if (!instance || !transaction.gateway) {
9191
throw new Error('Gateway implementation not found for refund')
9292
}
9393

0 commit comments

Comments
 (0)