Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Rate.available_payment_methods #876

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Stays/StaysTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export type StaysLoyaltyProgramme =
| 'global_hotel_alliance_discovery'
| 'duffel_hotel_group_rewards'

export type StaysPaymentType = 'balance' | 'card'

export interface StaysRate {
/**
* The currency of the base_amount, as an ISO 4217 currency code.
Expand Down Expand Up @@ -158,9 +160,18 @@ export interface StaysRate {
total_currency: string

/**
* The method available for payment of this rate. A rate with the `balance` payment type will be paid for using your Duffel Balance, and a rate with the `card` payment type will be paid for with card details provided at time of booking.
Deprecated. Refer to available_payment_methods instead.
*/
payment_method: StaysPaymentType

/**
* The methods available for payment of this rate.

A rate with the `balance` payment type can be paid for using your Duffel Balance.

A rate with the `card` payment type can be paid for with card details provided at time of booking.
*/
payment_method: 'balance' | 'card'
available_payment_methods: StaysPaymentType[]

/**
* The loyalty programme that this rate supports.
Expand Down
6 changes: 4 additions & 2 deletions src/Stays/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
fee_amount: '40.00',
cancellation_timeline: [],
board_type: 'room_only',
payment_method: 'balance',
payment_method: 'balance', // Deprecated. Refer to available_payment_methods instead.
available_payment_methods: ['balance'],
quantity_available: 1,
supported_loyalty_programme: null,
source: 'duffel_hotel_group',
Expand Down Expand Up @@ -80,7 +81,8 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
fee_amount: '40.00',
cancellation_timeline: [],
board_type: 'room_only',
payment_method: 'card',
payment_method: 'card', // Deprecated. Refer to available_payment_methods instead.
available_payment_methods: ['card'],
quantity_available: 1,
supported_loyalty_programme: 'duffel_hotel_group_rewards',
source: 'duffel_hotel_group',
Expand Down