From 3c103097dff205b02ed12a21f132852cea797e28 Mon Sep 17 00:00:00 2001 From: Andreja Kogovsek Date: Fri, 4 Jul 2025 10:28:57 +0100 Subject: [PATCH] fix: order change type --- src/booking/OrderChanges/OrderChangesTypes.ts | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/booking/OrderChanges/OrderChangesTypes.ts b/src/booking/OrderChanges/OrderChangesTypes.ts index e83ccbdd..f7d7cc63 100644 --- a/src/booking/OrderChanges/OrderChangesTypes.ts +++ b/src/booking/OrderChanges/OrderChangesTypes.ts @@ -102,22 +102,32 @@ export interface CreateOrderChangeParameters { } export interface ConfirmOrderChangePayment { - /** - * The amount of the payment. This should be the same as the change_total_amount of the order change. - */ - - amount: string - /** - * The currency of the change_total_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. - */ - currency: string - - /** - * The type of payment you want to use for the Order Change. - * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying arc_bsp_cash. - * Otherwise, you must pay using your Duffel account's balance by specifying balance. - * In test mode, your balance is unlimited. - * If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). - */ - type: PaymentType + /** The payment details to use to pay for the order change, if there is an amount to be paid. + * Some order changes may not need this. + * If the change_total_amount is zero or negative, there is no need to pass a payment object. */ + payment?: { + /** + * The amount of the payment. This should be the same as the change_total_amount of the order change. + */ + + amount: string + /** + * The currency of the change_total_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. + */ + currency: string + + /** + * The type of payment you want to use for the Order Change. + * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying arc_bsp_cash. + * Otherwise, you must pay using your Duffel account's balance by specifying balance. + * In test mode, your balance is unlimited. + * If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). + */ + type: PaymentType | 'card' + + /** + * The id of the 3DSecure Session ID. This is the autentication when paying by card. + */ + three_d_secure_session_id?: string + } }