File size: 2,309 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
export const getManagePurchaseUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string => `/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }`;

export const getMyPurchaseUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string => `/me/purchases/${ targetSiteSlug }/${ targetPurchaseId }`;

export const getConfirmCancelDomainUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string =>
	`/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }/confirm-cancel-domain`;

export const getCancelPurchaseUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string => `/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }/cancel`;

export const getDowngradeUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string => `/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }/downgrade`;

export const getPurchaseListUrlFor = ( targetSiteSlug: string | number ): string =>
	`/purchases/subscriptions/${ targetSiteSlug }`;

export const getAddPaymentMethodUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string =>
	`/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }/payment-method/add`;

export const getAddNewPaymentMethodUrlFor = ( targetSiteSlug: string ): string =>
	`/purchases/add-payment-method/${ targetSiteSlug }`;

export const getPaymentMethodsUrlFor = ( targetSiteSlug: string ): string =>
	`/purchases/payment-methods/${ targetSiteSlug }`;

export const getChangePaymentMethodUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number,
	targetCardId: string | number
): string =>
	`/purchases/subscriptions/${ targetSiteSlug }/${ targetPurchaseId }/payment-method/change/${ targetCardId }`;

export const getReceiptUrlFor = (
	targetSiteSlug: string,
	targetReceiptId: string | number
): string => `/purchases/billing-history/${ targetSiteSlug }/${ targetReceiptId }`;

export const getBillingHistoryUrlFor = ( targetSiteSlug: string ): string =>
	`/purchases/billing-history/${ targetSiteSlug }`;

export const getCrmDownloadsUrlFor = (
	targetSiteSlug: string,
	targetPurchaseId: string | number
): string => `/purchases/crm-downloads/${ targetSiteSlug }/${ targetPurchaseId }`;