1
|
|
|
package stubs |
2
|
|
|
|
3
|
|
|
// PriceGetResponse is a dummy response to the GET /v1/prices/:id endpoint |
4
|
|
|
func PriceGetResponse() []byte { |
5
|
|
|
return []byte(` |
6
|
|
|
{ |
7
|
|
|
"jsonapi": { |
8
|
|
|
"version": "1.0" |
9
|
|
|
}, |
10
|
|
|
"links": { |
11
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1" |
12
|
|
|
}, |
13
|
|
|
"data": { |
14
|
|
|
"type": "prices", |
15
|
|
|
"id": "1", |
16
|
|
|
"attributes": { |
17
|
|
|
"variant_id": 1, |
18
|
|
|
"category": "subscription", |
19
|
|
|
"scheme": "graduated", |
20
|
|
|
"usage_aggregation": null, |
21
|
|
|
"unit_price": 999, |
22
|
|
|
"unit_price_decimal": null, |
23
|
|
|
"setup_fee_enabled": false, |
24
|
|
|
"setup_fee": null, |
25
|
|
|
"package_size": 1, |
26
|
|
|
"tiers": [ |
27
|
|
|
{ |
28
|
|
|
"last_unit": 2, |
29
|
|
|
"unit_price": 10000, |
30
|
|
|
"unit_price_decimal": null, |
31
|
|
|
"fixed_fee": 1000 |
32
|
|
|
}, |
33
|
|
|
{ |
34
|
|
|
"last_unit": "inf", |
35
|
|
|
"unit_price": 1000, |
36
|
|
|
"unit_price_decimal": null, |
37
|
|
|
"fixed_fee": 1000 |
38
|
|
|
} |
39
|
|
|
], |
40
|
|
|
"renewal_interval_unit": "year", |
41
|
|
|
"renewal_interval_quantity": 1, |
42
|
|
|
"trial_interval_unit": "day", |
43
|
|
|
"trial_interval_quantity": 30, |
44
|
|
|
"min_price": null, |
45
|
|
|
"suggested_price": null, |
46
|
|
|
"tax_code": "eservice", |
47
|
|
|
"created_at": "2023-05-24T14:15:06.000000Z", |
48
|
|
|
"updated_at": "2023-06-24T14:44:38.000000Z" |
49
|
|
|
}, |
50
|
|
|
"relationships": { |
51
|
|
|
"variant": { |
52
|
|
|
"links": { |
53
|
|
|
"related": "https://api.lemonsqueezy.com/v1/prices/1/variant", |
54
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1/relationships/variant" |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
}, |
58
|
|
|
"links": { |
59
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1" |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
`) |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
// PriceListResponse is a dummy response to GET /v1/prices |
67
|
|
|
func PriceListResponse() []byte { |
68
|
|
|
return []byte(` |
69
|
|
|
{ |
70
|
|
|
"meta": { |
71
|
|
|
"page": { |
72
|
|
|
"currentPage": 1, |
73
|
|
|
"from": 1, |
74
|
|
|
"lastPage": 1, |
75
|
|
|
"perPage": 10, |
76
|
|
|
"to": 10, |
77
|
|
|
"total": 10 |
78
|
|
|
} |
79
|
|
|
}, |
80
|
|
|
"jsonapi": { |
81
|
|
|
"version": "1.0" |
82
|
|
|
}, |
83
|
|
|
"links": { |
84
|
|
|
"first": "https://api.lemonsqueezy.com/v1/prices?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-created_at", |
85
|
|
|
"last": "https://api.lemonsqueezy.com/v1/prices?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=-created_at" |
86
|
|
|
}, |
87
|
|
|
"data": [ |
88
|
|
|
{ |
89
|
|
|
"type": "prices", |
90
|
|
|
"id": "1", |
91
|
|
|
"attributes": { |
92
|
|
|
"variant_id": 1, |
93
|
|
|
"category": "subscription", |
94
|
|
|
"scheme": "graduated", |
95
|
|
|
"usage_aggregation": null, |
96
|
|
|
"unit_price": 999, |
97
|
|
|
"unit_price_decimal": null, |
98
|
|
|
"setup_fee_enabled": false, |
99
|
|
|
"setup_fee": null, |
100
|
|
|
"package_size": 1, |
101
|
|
|
"tiers": [ |
102
|
|
|
{ |
103
|
|
|
"last_unit": 2, |
104
|
|
|
"unit_price": 10000, |
105
|
|
|
"unit_price_decimal": null, |
106
|
|
|
"fixed_fee": 1000 |
107
|
|
|
}, |
108
|
|
|
{ |
109
|
|
|
"last_unit": "inf", |
110
|
|
|
"unit_price": 1000, |
111
|
|
|
"unit_price_decimal": null, |
112
|
|
|
"fixed_fee": 1000 |
113
|
|
|
} |
114
|
|
|
], |
115
|
|
|
"renewal_interval_unit": "year", |
116
|
|
|
"renewal_interval_quantity": 1, |
117
|
|
|
"trial_interval_unit": "day", |
118
|
|
|
"trial_interval_quantity": 30, |
119
|
|
|
"min_price": null, |
120
|
|
|
"suggested_price": null, |
121
|
|
|
"tax_code": "eservice", |
122
|
|
|
"created_at": "2023-05-24T14:15:06.000000Z", |
123
|
|
|
"updated_at": "2023-06-24T14:44:38.000000Z" |
124
|
|
|
}, |
125
|
|
|
"relationships": { |
126
|
|
|
"variant": { |
127
|
|
|
"links": { |
128
|
|
|
"related": "https://api.lemonsqueezy.com/v1/prices/1/variant", |
129
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1/relationships/variant" |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
}, |
133
|
|
|
"links": { |
134
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1" |
135
|
|
|
} |
136
|
|
|
}, |
137
|
|
|
{ |
138
|
|
|
"type": "prices", |
139
|
|
|
"id": "2", |
140
|
|
|
"attributes": { |
141
|
|
|
"variant_id": 1, |
142
|
|
|
"category": "subscription", |
143
|
|
|
"scheme": "graduated", |
144
|
|
|
"usage_aggregation": null, |
145
|
|
|
"unit_price": 999, |
146
|
|
|
"unit_price_decimal": null, |
147
|
|
|
"setup_fee_enabled": false, |
148
|
|
|
"setup_fee": null, |
149
|
|
|
"package_size": 1, |
150
|
|
|
"tiers": [ |
151
|
|
|
{ |
152
|
|
|
"last_unit": 2, |
153
|
|
|
"unit_price": 10000, |
154
|
|
|
"unit_price_decimal": null, |
155
|
|
|
"fixed_fee": 1000 |
156
|
|
|
}, |
157
|
|
|
{ |
158
|
|
|
"last_unit": "inf", |
159
|
|
|
"unit_price": 1000, |
160
|
|
|
"unit_price_decimal": null, |
161
|
|
|
"fixed_fee": 1000 |
162
|
|
|
} |
163
|
|
|
], |
164
|
|
|
"renewal_interval_unit": "year", |
165
|
|
|
"renewal_interval_quantity": 1, |
166
|
|
|
"trial_interval_unit": "day", |
167
|
|
|
"trial_interval_quantity": 30, |
168
|
|
|
"min_price": null, |
169
|
|
|
"suggested_price": null, |
170
|
|
|
"tax_code": "eservice", |
171
|
|
|
"created_at": "2023-05-24T14:15:06.000000Z", |
172
|
|
|
"updated_at": "2023-06-24T14:44:38.000000Z" |
173
|
|
|
}, |
174
|
|
|
"relationships": { |
175
|
|
|
"variant": { |
176
|
|
|
"links": { |
177
|
|
|
"related": "https://api.lemonsqueezy.com/v1/prices/1/variant", |
178
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1/relationships/variant" |
179
|
|
|
} |
180
|
|
|
} |
181
|
|
|
}, |
182
|
|
|
"links": { |
183
|
|
|
"self": "https://api.lemonsqueezy.com/v1/prices/1" |
184
|
|
|
} |
185
|
|
|
} |
186
|
|
|
] |
187
|
|
|
} |
188
|
|
|
`) |
189
|
|
|
} |
190
|
|
|
|