Skip to content

Commit

Permalink
feat: add set articles to KlarnaKP pay function
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsmin committed Nov 27, 2024
1 parent 6b5b5a3 commit 935ea55
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PaymentMethods/KlarnaKP/Models/IPay.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { IPaymentRequest, Person, ServiceParameter } from '../../../Models';
import { IArticle, IPaymentRequest, Person, ServiceParameter } from '../../../Models';
import Article, { IKlarnaKpArticle } from './Article';

export interface IPay extends IPaymentRequest {
reservationNumber?: string;
articles?: Partial<IKlarnaKpArticle>[];
}

export class Pay extends ServiceParameter {
set reservationNumber(value: string) {
this.set('reservationNumber', value);
}

set articles(articles: IArticle[]) {
this.set(
'articles',
articles.map((article) => new Article(article))
);
}
}

export class Customer extends Person {
Expand Down

0 comments on commit 935ea55

Please sign in to comment.