-
Notifications
You must be signed in to change notification settings - Fork 70
/
types.ts
33 lines (32 loc) · 1007 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2023 Sourcefuse Technologies
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import {Orders, Subscriptions} from '../models';
import {DataObject} from '@loopback/repository';
export interface IGateway {
create(
payorder: Orders,
paymentTemplate: string | undefined,
): Promise<unknown> | DataObject<{}>;
charge(chargeResponse: DataObject<{}>): Promise<DataObject<{res: string}>>;
refund(transactionId: string): Promise<unknown> | void;
subscriptionCreate(
subscriptions: Subscriptions,
paymentTemplate: string | undefined,
): Promise<string> | {};
subscriptionCharge(
chargeResponse: DataObject<{
stripeEmail: string;
stripeToken: string;
subscriptionId: string;
}>,
): Promise<DataObject<{res: string}>>;
subscriptionWebHook(
sub: DataObject<{
data: DataObject<{
object: DataObject<{subscription: string; status: string}>;
}>;
}>,
): Promise<{}>;
}