ea772a8480
This change allows users to see the Stripe coupon applied to their account in the billing area. Change-Id: Ie1e810bfb2847f9b0c0bb827d5ca03c16cf5e818
68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import {
|
|
AccountBalance,
|
|
Coupon,
|
|
CreditCard,
|
|
PaymentsApi,
|
|
PaymentsHistoryItem,
|
|
ProjectUsageAndCharges,
|
|
TokenDeposit,
|
|
} 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<void> {
|
|
throw new Error('Method not implemented');
|
|
}
|
|
|
|
getBalance(): Promise<AccountBalance> {
|
|
return Promise.resolve(new AccountBalance());
|
|
}
|
|
|
|
projectsUsageAndCharges(): Promise<ProjectUsageAndCharges[]> {
|
|
return Promise.resolve([]);
|
|
}
|
|
|
|
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([]);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|