storj/web/satellite/tests/unit/mock/api/payments.ts
Jeremy Wharton 31ec4fae9e web/satellite: add pricing plan selection to onboarding tour
A pricing plan selection step for users with a recognized partner has
been added to the beginning of the onboarding tour. Once visited, users
have the option of purchasing the pricing plan associated with their
partner or proceeding as a paid or free tier user.

Resolves storj-private#118
Resolves storj-private#126

Change-Id: I3b423194d96deaf87cf9807a766bf4d04fbcf86d
2023-02-28 20:49:59 -06:00

91 lines
2.2 KiB
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import {
AccountBalance,
Coupon,
CreditCard,
PaymentsApi,
PaymentsHistoryItem,
ProjectUsageAndCharges,
ProjectUsagePriceModel,
TokenDeposit,
NativePaymentHistoryItem,
Wallet,
} from '@/types/payments';
/**
* Mock for PaymentsApi
*/
export class PaymentsMock implements PaymentsApi {
private mockCoupon: Coupon | null = null;
public setMockCoupon(coupon: Coupon | null): void {
this.mockCoupon = coupon;
}
setupAccount(): Promise<string> {
throw new Error('Method not implemented');
}
getBalance(): Promise<AccountBalance> {
return Promise.resolve(new AccountBalance());
}
projectsUsageAndCharges(): Promise<ProjectUsageAndCharges[]> {
return Promise.resolve([]);
}
projectUsagePriceModel(): Promise<ProjectUsagePriceModel> {
return Promise.resolve(new ProjectUsagePriceModel('1', '1', '1'));
}
addCreditCard(_token: string): Promise<void> {
throw new Error('Method not implemented');
}
removeCreditCard(_cardId: string): Promise<void> {
throw new Error('Method not implemented');
}
listCreditCards(): Promise<CreditCard[]> {
return Promise.resolve([]);
}
makeCreditCardDefault(_cardId: string): Promise<void> {
throw new Error('Method not implemented');
}
paymentsHistory(): Promise<PaymentsHistoryItem[]> {
return Promise.resolve([]);
}
nativePaymentsHistory(): Promise<NativePaymentHistoryItem[]> {
return Promise.resolve([]);
}
makeTokenDeposit(amount: number): Promise<TokenDeposit> {
return Promise.resolve(new TokenDeposit(amount, 'testAddress', 'testLink'));
}
applyCouponCode(_: string): Promise<Coupon> {
throw new Error('Method not implemented');
}
getCoupon(): Promise<Coupon | null> {
return Promise.resolve(this.mockCoupon);
}
getWallet(): Promise<Wallet> {
return Promise.resolve(new Wallet());
}
claimWallet(): Promise<Wallet> {
return Promise.resolve(new Wallet());
}
purchasePricingPackage(_: string): Promise<void> {
throw new Error('Method not implemented');
}
}