@spritz-finance/service-client 0.2.71 → 0.2.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { CheckbookUser, CreateDirectPaymentInput, DirectPayment } from './lib/graphClient/generated';
|
|
2
|
+
import { AccountProvider, CheckbookUser, CreateDirectPaymentInput, DirectPayment, PaymentStatus } from './lib/graphClient/generated';
|
|
3
3
|
import { ExternalBillInput } from './payableAccountsServiceClient';
|
|
4
4
|
export declare enum RewardProvider {
|
|
5
5
|
INTERNAL = "INTERNAL",
|
|
@@ -187,7 +187,8 @@ export declare enum PaymentSource {
|
|
|
187
187
|
Mobile = "Mobile",
|
|
188
188
|
Integrator = "Integrator",
|
|
189
189
|
PaymentAddress = "PaymentAddress",
|
|
190
|
-
Subscription = "Subscription"
|
|
190
|
+
Subscription = "Subscription",
|
|
191
|
+
External = "Subscription"
|
|
191
192
|
}
|
|
192
193
|
type GetUsersTransactionVolumeBody = {
|
|
193
194
|
userIds: string[];
|
|
@@ -205,6 +206,19 @@ export interface CreateDirectPaymentArgs extends CreateDirectPaymentInput {
|
|
|
205
206
|
noFees?: boolean;
|
|
206
207
|
source?: PaymentSource;
|
|
207
208
|
}
|
|
209
|
+
export type ExternalPaymentInput = {
|
|
210
|
+
externalPaymentId: string;
|
|
211
|
+
userId: string;
|
|
212
|
+
paymentAmountUSD: number;
|
|
213
|
+
feeAmountUSD: number;
|
|
214
|
+
accountId: string;
|
|
215
|
+
paymentProvider: AccountProvider;
|
|
216
|
+
paymentCurrency: string;
|
|
217
|
+
targetCurrency: string;
|
|
218
|
+
targetCurrencyRate: number;
|
|
219
|
+
targetCurrencyFee: number;
|
|
220
|
+
targetCurrencyAmount: number;
|
|
221
|
+
};
|
|
208
222
|
export declare class LiabilitiesServiceClient {
|
|
209
223
|
client: AxiosInstance;
|
|
210
224
|
constructor();
|
|
@@ -223,5 +237,8 @@ export declare class LiabilitiesServiceClient {
|
|
|
223
237
|
getValidPaymentsForAccount(accountId: string): Promise<Payment[]>;
|
|
224
238
|
getRewardTransactionVolume(args: GetUsersTransactionVolumeBody): Promise<number>;
|
|
225
239
|
getRewardFeeAmount(args: GetUserRewardFeeAmountBody): Promise<number>;
|
|
240
|
+
initializeExternalPayment(args: ExternalPaymentInput): Promise<Payment>;
|
|
241
|
+
scheduleExternalPayment(args: ExternalPaymentInput): Promise<Payment>;
|
|
242
|
+
updateExternalPaymentStatus(paymentId: string, status: PaymentStatus): Promise<Payment>;
|
|
226
243
|
}
|
|
227
244
|
export {};
|
|
@@ -30,6 +30,7 @@ var PaymentSource;
|
|
|
30
30
|
PaymentSource["Integrator"] = "Integrator";
|
|
31
31
|
PaymentSource["PaymentAddress"] = "PaymentAddress";
|
|
32
32
|
PaymentSource["Subscription"] = "Subscription";
|
|
33
|
+
PaymentSource["External"] = "Subscription";
|
|
33
34
|
})(PaymentSource || (exports.PaymentSource = PaymentSource = {}));
|
|
34
35
|
class LiabilitiesServiceClient {
|
|
35
36
|
constructor() {
|
|
@@ -118,5 +119,20 @@ class LiabilitiesServiceClient {
|
|
|
118
119
|
.post('/payments/rewards/fees', args)
|
|
119
120
|
.then((res) => res.data);
|
|
120
121
|
}
|
|
122
|
+
async initializeExternalPayment(args) {
|
|
123
|
+
return this.client
|
|
124
|
+
.post('/external-payment/initialize', args)
|
|
125
|
+
.then((res) => res.data);
|
|
126
|
+
}
|
|
127
|
+
async scheduleExternalPayment(args) {
|
|
128
|
+
return this.client
|
|
129
|
+
.post('/external-payment/schedule', args)
|
|
130
|
+
.then((res) => res.data);
|
|
131
|
+
}
|
|
132
|
+
async updateExternalPaymentStatus(paymentId, status) {
|
|
133
|
+
return this.client
|
|
134
|
+
.post(`/external-payment/status/${paymentId}`, { status })
|
|
135
|
+
.then((res) => res.data);
|
|
136
|
+
}
|
|
121
137
|
}
|
|
122
138
|
exports.LiabilitiesServiceClient = LiabilitiesServiceClient;
|