Skip to content

Commit

Permalink
fix(bankid): personal details not provided correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkih committed Apr 23, 2022
1 parent 63d26ac commit d39e7eb
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/services/bookingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,13 @@ export class BookingService {
throw new BookingPageError({ page: $ });
}

const tin = $("#Customers_0__BookingFieldValues_0__Value").text();
const firstname = $("#Customers_0__BookingFieldValues_1__Value").text();
const lastname = $("#Customers_0__BookingFieldValues_2__Value").text();
const tin = $("#Customers_0__BookingFieldValues_0__Value").val() as string;
const firstname = $(
"#Customers_0__BookingFieldValues_1__Value"
).val() as string;
const lastname = $(
"#Customers_0__BookingFieldValues_2__Value"
).val() as string;

return { tin, firstname, lastname };
}
Expand All @@ -366,12 +370,15 @@ export class BookingService {
) {
const people = [
personalDetails,
...[extra_personnummer].map((_, i) => ({
firstname: [extra_firstnames][i],
lastname: [extra_lastnames][i],
tin: [extra_personnummer][i],
})),
...(extra_personnummer.length > 0
? [extra_personnummer].map((_, i) => ({
firstname: extra_firstnames[i],
lastname: extra_lastnames[i],
tin: extra_personnummer[i],
}))
: []),
];

logger.verbose(`Providing personal details`);
const customerData = people.map((person, index) => ({
[`Customers[${index}].BookingCustomerId`]: 0,
Expand Down

0 comments on commit d39e7eb

Please sign in to comment.