-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpaymentData.ts
More file actions
85 lines (77 loc) · 1.58 KB
/
Copy pathpaymentData.ts
File metadata and controls
85 lines (77 loc) · 1.58 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import type { Utm } from '@hawk.so/types';
/**
* Data for setting up recurring payments
*/
interface RecurrentPaymentSettings {
/**
* Payment interval
*/
interval: 'Day' | 'Week' | 'Month';
/**
* Payment period. That is, how often to withdraw money
*/
period: number;
/**
* Subscription start date (first payment)
*/
startDate?: string;
/**
* Recurring payment amount.
*/
amount?: number;
}
/**
* Data for the needs of Cloudpayments
*/
interface CloudPaymentsSettings {
/**
* Data for recurrent payments
*
* @see https://developers.cloudpayments.ru/#rekurrentnye-platezhi-podpiska
*/
recurrent: RecurrentPaymentSettings;
}
/**
* Promo reference attached to payment request.
* Amounts are resolved on the server by promo id during check/pay.
*/
export interface PaymentPromoData {
/**
* Applied promo code id
*/
id: string;
/**
* UTM parameters captured when promo was applied
*/
utm?: Utm;
}
export interface PaymentData {
/**
* Data for Cloudpayments needs
*/
cloudPayments?: CloudPaymentsSettings;
/**
* Workspace Identifier
*/
workspaceId: string;
/**
* Id of the user making the payment
*/
userId: string;
/**
* Workspace current plan id or plan id to change
*/
tariffPlanId: string;
/**
* If true, we will save user card
*/
shouldSaveCard: boolean;
/**
* Applied promo code reference
*/
promo?: PaymentPromoData;
/**
* True if this is card linking operation – charging minimal amount of money to validate card info
*/
isCardLinkOperation: boolean;
}