Skip to content

Commit 6ec7b6f

Browse files
committed
feat(backend): start publishing cardDetails in outgoing_payment.created webhook
1 parent ccc939f commit 6ec7b6f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

packages/backend/src/open_payments/payment/outgoing/model.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ export class OutgoingPayment
209209
if (this.grantId) {
210210
data.grantId = this.grantId
211211
}
212+
if (this.cardDetails) {
213+
data.cardDetails = {
214+
requestId: this.cardDetails.requestId,
215+
data: this.cardDetails.data,
216+
initiatedAt: this.cardDetails.initiatedAt
217+
}
218+
}
212219
return data
213220
}
214221

@@ -296,6 +303,10 @@ export type PaymentData = Omit<OutgoingPaymentResponse, 'failed'> & {
296303
stateAttempts: number
297304
balance: string
298305
grantId?: string
306+
cardDetails?: Pick<
307+
OutgoingPaymentCardDetails,
308+
'requestId' | 'data' | 'initiatedAt'
309+
>
299310
}
300311

301312
export const isOutgoingPaymentEventType = (

packages/backend/src/openapi/specs/webhooks.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ components:
242242
grantId:
243243
type: string
244244
format: uuid
245+
cardDetails:
246+
type: object
247+
properties:
248+
data:
249+
type: object
250+
requestId:
251+
type: string
252+
initiatedAt:
253+
type: string
254+
format: date-time
245255
additionalProperties: false
246256
walletAddressNotFound:
247257
required:

0 commit comments

Comments
 (0)