1
|
|
|
/** Identifier for in-app receipt fields (starting with 17*) */ |
2
|
1 |
|
export const IN_APP: number = 17 |
3
|
|
|
|
4
|
|
|
/** Identifies pkcs7 content information encoded as Octet string */ |
5
|
1 |
|
export const CONTENT_ID = 'pkcs7_content' |
6
|
|
|
|
7
|
|
|
/** Identifies field type id information */ |
8
|
1 |
|
export const FIELD_TYPE_ID: string = 'FieldType' |
9
|
|
|
|
10
|
|
|
/** Identifies field value information encoded as Octet string */ |
11
|
1 |
|
export const FIELD_VALUE_ID: string = 'FieldTypeOctetString' |
12
|
|
|
|
13
|
|
|
export type ReceiptFieldsKeyValues = |
14
|
|
|
| 0 // Environment |
15
|
|
|
| 2 // Bundle ID |
16
|
|
|
| 3 // App version |
17
|
|
|
| 4 // Opaque value |
18
|
|
|
| 5 // SHA-1 hash |
19
|
|
|
| 12 // Receipt creation date |
20
|
|
|
| 18 // Original purchase date |
21
|
|
|
| 19 // Original app version |
22
|
|
|
| 1701 // In-app quantity |
23
|
|
|
| 1702 // In-app product ID |
24
|
|
|
| 1703 // In-app transaction ID |
25
|
|
|
| 1704 // In-app purchase date |
26
|
|
|
| 1705 // In-app original transaction ID |
27
|
|
|
| 1706 // In-app original purchase date |
28
|
|
|
| 1708 // In-app expires date |
29
|
|
|
| 1711 // In-app web order line item ID |
30
|
|
|
| 1712 // In-app cancellation date |
31
|
|
|
|
32
|
|
|
export type ReceiptFieldsKeyNames = |
33
|
|
|
| 'ENVIRONMENT' |
34
|
|
|
| 'BUNDLE_ID' |
35
|
|
|
| 'APP_VERSION' |
36
|
|
|
| 'OPAQUE_VALUE' |
37
|
|
|
| 'SHA1_HASH' |
38
|
|
|
| 'RECEIPT_CREATION_DATE' |
39
|
|
|
| 'ORIGINAL_PURCHASE_DATE' |
40
|
|
|
| 'ORIGINAL_APP_VERSION' |
41
|
|
|
| 'IN_APP_QUANTITY' |
42
|
|
|
| 'IN_APP_PRODUCT_ID' |
43
|
|
|
| 'IN_APP_TRANSACTION_ID' |
44
|
|
|
| 'IN_APP_PURCHASE_DATE' |
45
|
|
|
| 'IN_APP_ORIGINAL_TRANSACTION_ID' |
46
|
|
|
| 'IN_APP_ORIGINAL_PURCHASE_DATE' |
47
|
|
|
| 'IN_APP_EXPIRES_DATE' |
48
|
|
|
| 'IN_APP_WEB_ORDER_LINE_ITEM_ID' |
49
|
|
|
| 'IN_APP_CANCELLATION_DATE' |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Receipt fields |
53
|
|
|
* @see https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html |
54
|
|
|
*/ |
55
|
1 |
|
export const RECEIPT_FIELDS_MAP: ReadonlyMap<ReceiptFieldsKeyValues, ReceiptFieldsKeyNames> = new Map([ |
56
|
|
|
[0, 'ENVIRONMENT'], |
57
|
|
|
[2, 'BUNDLE_ID'], |
58
|
|
|
[3, 'APP_VERSION'], |
59
|
|
|
[4, 'OPAQUE_VALUE'], |
60
|
|
|
[5, 'SHA1_HASH'], |
61
|
|
|
[12, 'RECEIPT_CREATION_DATE'], |
62
|
|
|
[18, 'ORIGINAL_PURCHASE_DATE'], |
63
|
|
|
[19, 'ORIGINAL_APP_VERSION'], |
64
|
|
|
[1701, 'IN_APP_QUANTITY'], |
65
|
|
|
[1702, 'IN_APP_PRODUCT_ID'], |
66
|
|
|
[1703, 'IN_APP_TRANSACTION_ID'], |
67
|
|
|
[1704, 'IN_APP_PURCHASE_DATE'], |
68
|
|
|
[1705, 'IN_APP_ORIGINAL_TRANSACTION_ID'], |
69
|
|
|
[1706, 'IN_APP_ORIGINAL_PURCHASE_DATE'], |
70
|
|
|
[1708, 'IN_APP_EXPIRES_DATE'], |
71
|
|
|
[1711, 'IN_APP_WEB_ORDER_LINE_ITEM_ID'], |
72
|
|
|
[1712, 'IN_APP_CANCELLATION_DATE'], |
73
|
|
|
]) |
74
|
|
|
|