2019-11-27 14:57:56 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2020-05-12 18:16:04 +01:00
|
|
|
import {
|
|
|
|
AccountBalance,
|
2021-08-06 21:14:33 +01:00
|
|
|
Coupon,
|
2020-05-12 18:16:04 +01:00
|
|
|
CreditCard,
|
|
|
|
PaymentsApi,
|
2020-05-21 18:01:56 +01:00
|
|
|
PaymentsHistoryItem,
|
2020-05-12 18:16:04 +01:00
|
|
|
ProjectUsageAndCharges,
|
2023-01-12 03:50:31 +00:00
|
|
|
ProjectUsagePriceModel,
|
2020-05-12 18:16:04 +01:00
|
|
|
TokenDeposit,
|
2022-08-23 11:37:46 +01:00
|
|
|
NativePaymentHistoryItem,
|
2022-07-12 16:20:53 +01:00
|
|
|
Wallet,
|
2020-05-12 18:16:04 +01:00
|
|
|
} from '@/types/payments';
|
2019-11-27 14:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mock for PaymentsApi
|
|
|
|
*/
|
|
|
|
export class PaymentsMock implements PaymentsApi {
|
2021-08-06 21:14:33 +01:00
|
|
|
private mockCoupon: Coupon | null = null;
|
|
|
|
|
|
|
|
public setMockCoupon(coupon: Coupon | null): void {
|
|
|
|
this.mockCoupon = coupon;
|
|
|
|
}
|
|
|
|
|
2021-10-26 14:30:19 +01:00
|
|
|
setupAccount(): Promise<string> {
|
2019-11-27 14:57:56 +00:00
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
|
|
|
|
2020-05-12 18:16:04 +01:00
|
|
|
getBalance(): Promise<AccountBalance> {
|
|
|
|
return Promise.resolve(new AccountBalance());
|
2019-11-27 14:57:56 +00:00
|
|
|
}
|
|
|
|
|
2020-03-26 13:34:16 +00:00
|
|
|
projectsUsageAndCharges(): Promise<ProjectUsageAndCharges[]> {
|
2019-11-27 14:57:56 +00:00
|
|
|
return Promise.resolve([]);
|
|
|
|
}
|
|
|
|
|
2023-01-12 03:50:31 +00:00
|
|
|
projectUsagePriceModel(): Promise<ProjectUsagePriceModel> {
|
|
|
|
return Promise.resolve(new ProjectUsagePriceModel('1', '1', '1'));
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
addCreditCard(_token: string): Promise<void> {
|
2019-11-27 14:57:56 +00:00
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
removeCreditCard(_cardId: string): Promise<void> {
|
2019-11-27 14:57:56 +00:00
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
listCreditCards(): Promise<CreditCard[]> {
|
|
|
|
return Promise.resolve([]);
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
makeCreditCardDefault(_cardId: string): Promise<void> {
|
2019-11-27 14:57:56 +00:00
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
|
|
|
|
2020-05-21 18:01:56 +01:00
|
|
|
paymentsHistory(): Promise<PaymentsHistoryItem[]> {
|
2019-11-27 14:57:56 +00:00
|
|
|
return Promise.resolve([]);
|
|
|
|
}
|
|
|
|
|
2022-08-23 11:37:46 +01:00
|
|
|
nativePaymentsHistory(): Promise<NativePaymentHistoryItem[]> {
|
|
|
|
return Promise.resolve([]);
|
|
|
|
}
|
|
|
|
|
2019-11-27 14:57:56 +00:00
|
|
|
makeTokenDeposit(amount: number): Promise<TokenDeposit> {
|
2020-03-12 15:32:40 +00:00
|
|
|
return Promise.resolve(new TokenDeposit(amount, 'testAddress', 'testLink'));
|
2019-11-27 14:57:56 +00:00
|
|
|
}
|
2020-07-10 14:05:17 +01:00
|
|
|
|
2021-08-06 21:14:33 +01:00
|
|
|
applyCouponCode(_: string): Promise<Coupon> {
|
2020-07-10 14:05:17 +01:00
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
2021-08-06 21:14:33 +01:00
|
|
|
|
|
|
|
getCoupon(): Promise<Coupon | null> {
|
|
|
|
return Promise.resolve(this.mockCoupon);
|
|
|
|
}
|
2022-07-12 16:20:53 +01:00
|
|
|
|
|
|
|
getWallet(): Promise<Wallet> {
|
|
|
|
return Promise.resolve(new Wallet());
|
|
|
|
}
|
|
|
|
|
|
|
|
claimWallet(): Promise<Wallet> {
|
|
|
|
return Promise.resolve(new Wallet());
|
|
|
|
}
|
2023-01-20 16:41:02 +00:00
|
|
|
|
|
|
|
purchasePricingPackage(_: string): Promise<void> {
|
|
|
|
throw new Error('Method not implemented');
|
|
|
|
}
|
2019-11-27 14:57:56 +00:00
|
|
|
}
|