Skip to content

Commit

Permalink
feat: Add swish models
Browse files Browse the repository at this point in the history
  • Loading branch information
NullableInt committed Jun 28, 2021
1 parent f572d91 commit 6fc9ec0
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/paymentInstruments/swish/swishPayment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishPayment extends Identifiable, PaymentInstrument {
sales: SwishSaleListResponse;
}
8 changes: 8 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentOperations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface SwishPaymentOperations extends Dictionary<LinkRelation, HttpOperation> {
abort: Func<PaymentAbortRequest, Task<SwishPaymentResponse>>;
paidPayment: HttpOperation;
redirectSale: HttpOperation;
reverse: Func<SwishPaymentReversalRequest, Task<ReversalResponse>>;
sale: Func<SwishPaymentSaleRequest, Task<SwishPaymentSaleResponse>>;
viewSales: HttpOperation;
}
3 changes: 3 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishPaymentRequest {
payment: SwishPaymentRequestDetails;
}
15 changes: 15 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentRequestDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface SwishPaymentRequestDetails {
currency: Currency;
description: string;
intent: PaymentIntent;
language: Language;
operation: Operation;
payeeInfo: PayeeInfo;
payerReference: string;
prefillInfo: PrefillInfo;
prices: Price[];
swish: SwishRequestData;
urls: Urls;
userAgent: string;
metadata: Metadata;
}
4 changes: 4 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface SwishPaymentResponse {
payment: SwishPayment;
operations: SwishPaymentOperations;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishPaymentReversalRequest {
transaction: SwishPaymentReversalTransaction;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface SwishPaymentReversalTransaction {
amount: Amount;
description: string;
payeeReference: string;
vatAmount: Amount;
}
6 changes: 6 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentSale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface SwishPaymentSale extends Identifiable {
created: string;
updated: string;
paymentRequestToken: string;
transaction: Transaction;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishPaymentSaleRequest {
transaction: SwishPaymentSaleTransaction;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface SwishPaymentSaleResponse {
payment: Uri;
sale: SwishPaymentSale;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishPaymentSaleTransaction {
msisdn: Msisdn;
}
3 changes: 3 additions & 0 deletions src/models/paymentInstruments/swish/swishPaymentsResource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishResource {

}
3 changes: 3 additions & 0 deletions src/models/paymentInstruments/swish/swishRequestData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishRequestData {
enableEcomOnly: boolean;
}
8 changes: 8 additions & 0 deletions src/models/paymentInstruments/swish/swishSaleListItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface SwishSaleListItem extends Identifiable {
date: string;
payerAlias: string;
paymentRequestToken: string;
swishPaymentReference: string;
swishStatus: string;
transaction: Transaction;
}
3 changes: 3 additions & 0 deletions src/models/paymentInstruments/swish/swishSaleListResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SwishSaleListResponse extends Identifiable {
saleList: SwishSaleListItem[];
}

0 comments on commit 6fc9ec0

Please sign in to comment.