1
|
|
|
package stubs |
2
|
|
|
|
3
|
|
|
// OrderItemGetResponse is a dummy response to the GET /v1/order-items/:id endpoint |
4
|
|
|
func OrderItemGetResponse() []byte { |
5
|
|
|
return []byte(` |
6
|
|
|
{ |
7
|
|
|
"jsonapi": { |
8
|
|
|
"version": "1.0" |
9
|
|
|
}, |
10
|
|
|
"links": { |
11
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1" |
12
|
|
|
}, |
13
|
|
|
"data": { |
14
|
|
|
"type": "order-items", |
15
|
|
|
"id": "1", |
16
|
|
|
"attributes": { |
17
|
|
|
"order_id": 1, |
18
|
|
|
"product_id": 1, |
19
|
|
|
"variant_id": 1, |
20
|
|
|
"product_name": "Example Product", |
21
|
|
|
"variant_name": "Example Variant", |
22
|
|
|
"price": 999, |
23
|
|
|
"created_at": "2021-05-24T14:15:06.000000Z", |
24
|
|
|
"updated_at": "2021-05-24T14:15:06.000000Z" |
25
|
|
|
}, |
26
|
|
|
"relationships": { |
27
|
|
|
"order": { |
28
|
|
|
"links": { |
29
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/order", |
30
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/order" |
31
|
|
|
} |
32
|
|
|
}, |
33
|
|
|
"product": { |
34
|
|
|
"links": { |
35
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/product", |
36
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/product" |
37
|
|
|
} |
38
|
|
|
}, |
39
|
|
|
"variant": { |
40
|
|
|
"links": { |
41
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/variant", |
42
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/variant" |
43
|
|
|
} |
44
|
|
|
} |
45
|
|
|
}, |
46
|
|
|
"links": { |
47
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1" |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
`) |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
// OrderItemsListResponse is a dummy response to GET /v1/order-items |
55
|
|
|
func OrderItemsListResponse() []byte { |
56
|
|
|
return []byte(` |
57
|
|
|
{ |
58
|
|
|
"meta": { |
59
|
|
|
"page": { |
60
|
|
|
"currentPage": 1, |
61
|
|
|
"from": 1, |
62
|
|
|
"lastPage": 1, |
63
|
|
|
"perPage": 10, |
64
|
|
|
"to": 10, |
65
|
|
|
"total": 10 |
66
|
|
|
} |
67
|
|
|
}, |
68
|
|
|
"jsonapi": { |
69
|
|
|
"version": "1.0" |
70
|
|
|
}, |
71
|
|
|
"links": { |
72
|
|
|
"first": "https://api.lemonsqueezy.com/v1/order-items?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id", |
73
|
|
|
"last": "https://api.lemonsqueezy.com/v1/order-items?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id" |
74
|
|
|
}, |
75
|
|
|
"data": [ |
76
|
|
|
{ |
77
|
|
|
"type": "order-items", |
78
|
|
|
"id": "1", |
79
|
|
|
"attributes": { |
80
|
|
|
"order_id": 1, |
81
|
|
|
"product_id": 1, |
82
|
|
|
"variant_id": 1, |
83
|
|
|
"product_name": "Example Product", |
84
|
|
|
"variant_name": "Example Variant", |
85
|
|
|
"price": 999, |
86
|
|
|
"created_at": "2021-05-24T14:15:06.000000Z", |
87
|
|
|
"updated_at": "2021-05-24T14:15:06.000000Z" |
88
|
|
|
}, |
89
|
|
|
"relationships": { |
90
|
|
|
"order": { |
91
|
|
|
"links": { |
92
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/order", |
93
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/order" |
94
|
|
|
} |
95
|
|
|
}, |
96
|
|
|
"product": { |
97
|
|
|
"links": { |
98
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/product", |
99
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/product" |
100
|
|
|
} |
101
|
|
|
}, |
102
|
|
|
"variant": { |
103
|
|
|
"links": { |
104
|
|
|
"related": "https://api.lemonsqueezy.com/v1/order-items/1/variant", |
105
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1/relationships/variant" |
106
|
|
|
} |
107
|
|
|
} |
108
|
|
|
}, |
109
|
|
|
"links": { |
110
|
|
|
"self": "https://api.lemonsqueezy.com/v1/order-items/1" |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
] |
114
|
|
|
} |
115
|
|
|
`) |
116
|
|
|
} |
117
|
|
|
|