forked from Gurpartap/storekit-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
receipt.go
111 lines (87 loc) · 5.39 KB
/
receipt.go
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package storekit
// Receipt is the decoded version of the encoded receipt data sent with the request to the App Store.
// https://developer.apple.com/documentation/appstorereceipts/responsebody/receipt
type Receipt struct {
// See app_item_id.
AdamId int64 `json:"adam_id,omitempty"`
// Generated by App Store Connect and used by the App Store to uniquely identify
// the app purchased. Apps are assigned this identifier only in production.
// Treat this value as a 64-bit long integer.
AppItemId int64 `json:"app_item_id,omitempty"`
// The app’s version number. The app's version number corresponds to the value
// of CFBundleVersion (in iOS) or CFBundleShortVersionString (in macOS) in the
// Info.plist. In production, this value is the current version of the app on
// the device based on the receipt_creation_date_ms. In the sandbox, the value
// is always "1.0".
ApplicationVersion string `json:"application_version,omitempty"`
// The bundle identifier for the app to which the receipt belongs. You provide
// this string on App Store Connect. This corresponds to the value of
// CFBundleIdentifier in the Info.plist file of the app.
BundleId string `json:"bundle_id,omitempty"`
// A unique identifier for the app download transaction.
DownloadId int64 `json:"download_id,omitempty"`
// The time the receipt expires for apps purchased through the Volume Purchase
// Program, in a date-time format similar to the ISO 8601.
ExpirationDate string `json:"expiration_date,omitempty"`
// The time the receipt expires for apps purchased through the Volume Purchase
// Program, in UNIX epoch time format, in milliseconds. If this key is not
// present for apps purchased through the Volume Purchase Program, the receipt
// does not expire. Use this time format for processing dates.
ExpirationDateMs int64 `json:"expiration_date_ms,string,omitempty"`
// The time the receipt expires for apps purchased through the Volume Purchase
// Program, in the Pacific Time zone.
ExpirationDatePst string `json:"expiration_date_pst,omitempty"`
// An array that contains the in-app purchase receipt fields for all in-app
// purchase transactions.
InApp []InAppPurchaseReceipt `json:"in_app,omitempty"`
// The version of the app that the user originally purchased. This value does
// not change, and corresponds to the value of CFBundleVersion (in iOS) or
// CFBundleShortVersionString (in macOS) in the Info.plist file of the original
// purchase. In the sandbox environment, the value is always "1.0".
OriginalApplicationVersion string `json:"original_application_version,omitempty"`
// The time of the original app purchase, in a date-time format similar to ISO
// 8601.
OriginalPurchaseDate string `json:"original_purchase_date,omitempty"`
// The time of the original app purchase, in UNIX epoch time format, in
// milliseconds. Use this time format for processing dates.
OriginalPurchaseDateMs int64 `json:"original_purchase_date_ms,string,omitempty"`
// The time of the original app purchase, in the Pacific Time zone.
OriginalPurchaseDatePst string `json:"original_purchase_date_pst,omitempty"`
// The time the user ordered the app available for pre-order, in a date-time
// format similar to ISO 8601.
PreorderDate string `json:"preorder_date,omitempty"`
// The time the user ordered the app available for pre-order, in UNIX epoch time
// format, in milliseconds. This field is only present if the user pre-orders
// the app. Use this time format for processing dates.
PreorderDateMs int64 `json:"preorder_date_ms,string,omitempty"`
// The time the user ordered the app available for pre-order, in the Pacific
// Time zone.
PreorderDatePst string `json:"preorder_date_pst,omitempty"`
// The time the App Store generated the receipt, in a date-time format similar
// to ISO 8601.
ReceiptCreationDate string `json:"receipt_creation_date,omitempty"`
// The time the App Store generated the receipt, in UNIX epoch time format, in
// milliseconds. Use this time format for processing dates. This value does not
// change.
ReceiptCreationDateMs int64 `json:"receipt_creation_date_ms,string,omitempty"`
// The time the App Store generated the receipt, in the Pacific Time zone.
ReceiptCreationDatePst string `json:"receipt_creation_date_pst,omitempty"`
// The type of receipt generated. The value corresponds to the environment in
// which the app or VPP purchase was made. Possible values: Production,
// ProductionVPP, ProductionSandbox, ProductionVPPSandbox
ReceiptType string `json:"receipt_type,omitempty"`
// The time the request to the verifyReceipt endpoint was processed and the
// response was generated, in a date-time format similar to ISO 8601.
RequestDate string `json:"request_date,omitempty"`
// The time the request to the verifyReceipt endpoint was processed and the
// response was generated, in UNIX epoch time format, in milliseconds. Use this
// time format for processing dates.
RequestDateMs int64 `json:"request_date_ms,string,omitempty"`
// The time the request to the verifyReceipt endpoint was processed and the
// response was generated, in the Pacific Time zone.
RequestDatePst string `json:"request_date_pst,omitempty"`
// An arbitrary number that identifies a revision of your app. In the sandbox,
// this key's value is “0”. Use this value to identify the version of the app
// that the customer bought.
VersionExternalIdentifier int64 `json:"version_external_identifier,omitempty"`
}