@shware/purchase 1.8.9 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/app-store/config.cjs +98 -128
  3. package/dist/app-store/config.cjs.map +1 -1
  4. package/dist/app-store/config.d.cts +31 -31
  5. package/dist/app-store/config.d.cts.map +1 -0
  6. package/dist/app-store/config.d.mts +39 -0
  7. package/dist/app-store/config.d.mts.map +1 -0
  8. package/dist/app-store/config.mjs +93 -91
  9. package/dist/app-store/config.mjs.map +1 -1
  10. package/dist/app-store/index.cjs +3 -31
  11. package/dist/app-store/index.d.cts +2 -3
  12. package/dist/app-store/index.d.mts +2 -0
  13. package/dist/app-store/index.mjs +1 -5
  14. package/dist/google-play/config.cjs +100 -123
  15. package/dist/google-play/config.cjs.map +1 -1
  16. package/dist/google-play/config.d.cts +31 -31
  17. package/dist/google-play/config.d.cts.map +1 -0
  18. package/dist/google-play/config.d.mts +39 -0
  19. package/dist/google-play/config.d.mts.map +1 -0
  20. package/dist/google-play/config.mjs +95 -86
  21. package/dist/google-play/config.mjs.map +1 -1
  22. package/dist/google-play/index.cjs +9 -42
  23. package/dist/google-play/index.d.cts +3 -4
  24. package/dist/google-play/index.d.mts +3 -0
  25. package/dist/google-play/index.mjs +2 -17
  26. package/dist/google-play/real-time-developer-notification.cjs +122 -81
  27. package/dist/google-play/real-time-developer-notification.cjs.map +1 -1
  28. package/dist/google-play/real-time-developer-notification.d.cts +119 -117
  29. package/dist/google-play/real-time-developer-notification.d.cts.map +1 -0
  30. package/dist/google-play/real-time-developer-notification.d.mts +150 -0
  31. package/dist/google-play/real-time-developer-notification.d.mts.map +1 -0
  32. package/dist/google-play/real-time-developer-notification.mjs +118 -53
  33. package/dist/google-play/real-time-developer-notification.mjs.map +1 -1
  34. package/dist/index.cjs +13 -48
  35. package/dist/index.d.cts +5 -6
  36. package/dist/index.d.mts +5 -0
  37. package/dist/index.mjs +2 -19
  38. package/dist/stripe/config.cjs +104 -133
  39. package/dist/stripe/config.cjs.map +1 -1
  40. package/dist/stripe/config.d.cts +35 -35
  41. package/dist/stripe/config.d.cts.map +1 -0
  42. package/dist/stripe/config.d.mts +43 -0
  43. package/dist/stripe/config.d.mts.map +1 -0
  44. package/dist/stripe/config.mjs +99 -96
  45. package/dist/stripe/config.mjs.map +1 -1
  46. package/dist/stripe/handler.cjs +25 -53
  47. package/dist/stripe/handler.cjs.map +1 -1
  48. package/dist/stripe/handler.d.cts +10 -9
  49. package/dist/stripe/handler.d.cts.map +1 -0
  50. package/dist/stripe/handler.d.mts +16 -0
  51. package/dist/stripe/handler.d.mts.map +1 -0
  52. package/dist/stripe/handler.mjs +25 -29
  53. package/dist/stripe/handler.mjs.map +1 -1
  54. package/dist/stripe/index.cjs +27 -74
  55. package/dist/stripe/index.d.cts +8 -12
  56. package/dist/stripe/index.d.mts +8 -0
  57. package/dist/stripe/index.mjs +5 -44
  58. package/dist/stripe/mapper.cjs +168 -219
  59. package/dist/stripe/mapper.cjs.map +1 -1
  60. package/dist/stripe/mapper.d.cts +115 -114
  61. package/dist/stripe/mapper.d.cts.map +1 -0
  62. package/dist/stripe/mapper.d.mts +158 -0
  63. package/dist/stripe/mapper.d.mts.map +1 -0
  64. package/dist/stripe/mapper.mjs +155 -182
  65. package/dist/stripe/mapper.mjs.map +1 -1
  66. package/dist/stripe/metadata.cjs +11 -35
  67. package/dist/stripe/metadata.cjs.map +1 -1
  68. package/dist/stripe/metadata.d.cts +9 -7
  69. package/dist/stripe/metadata.d.cts.map +1 -0
  70. package/dist/stripe/metadata.d.mts +12 -0
  71. package/dist/stripe/metadata.d.mts.map +1 -0
  72. package/dist/stripe/metadata.mjs +11 -11
  73. package/dist/stripe/metadata.mjs.map +1 -1
  74. package/dist/stripe/pending-checkout.cjs +55 -61
  75. package/dist/stripe/pending-checkout.cjs.map +1 -1
  76. package/dist/stripe/pending-checkout.d.cts +3 -1
  77. package/dist/stripe/pending-checkout.d.cts.map +1 -0
  78. package/dist/stripe/{pending-checkout.d.ts → pending-checkout.d.mts} +3 -1
  79. package/dist/stripe/pending-checkout.d.mts.map +1 -0
  80. package/dist/stripe/pending-checkout.mjs +52 -34
  81. package/dist/stripe/pending-checkout.mjs.map +1 -1
  82. package/dist/stripe/schema.cjs +30 -55
  83. package/dist/stripe/schema.cjs.map +1 -1
  84. package/dist/stripe/schema.d.cts +36 -37
  85. package/dist/stripe/schema.d.cts.map +1 -0
  86. package/dist/stripe/schema.d.mts +40 -0
  87. package/dist/stripe/schema.d.mts.map +1 -0
  88. package/dist/stripe/schema.mjs +28 -40
  89. package/dist/stripe/schema.mjs.map +1 -1
  90. package/dist/subscription/index.cjs +178 -80
  91. package/dist/subscription/index.cjs.map +1 -1
  92. package/dist/subscription/index.d.cts +136 -134
  93. package/dist/subscription/index.d.cts.map +1 -0
  94. package/dist/subscription/index.d.mts +150 -0
  95. package/dist/subscription/index.d.mts.map +1 -0
  96. package/dist/subscription/index.mjs +173 -51
  97. package/dist/subscription/index.mjs.map +1 -1
  98. package/dist/types.cjs +0 -19
  99. package/dist/types.d.cts +7 -6
  100. package/dist/types.d.cts.map +1 -0
  101. package/dist/types.d.mts +10 -0
  102. package/dist/types.d.mts.map +1 -0
  103. package/dist/types.mjs +1 -1
  104. package/package.json +40 -25
  105. package/dist/app-store/config.d.ts +0 -39
  106. package/dist/app-store/index.cjs.map +0 -1
  107. package/dist/app-store/index.d.ts +0 -3
  108. package/dist/app-store/index.mjs.map +0 -1
  109. package/dist/google-play/config.d.ts +0 -39
  110. package/dist/google-play/index.cjs.map +0 -1
  111. package/dist/google-play/index.d.ts +0 -4
  112. package/dist/google-play/index.mjs.map +0 -1
  113. package/dist/google-play/real-time-developer-notification.d.ts +0 -148
  114. package/dist/index.cjs.map +0 -1
  115. package/dist/index.d.ts +0 -6
  116. package/dist/index.mjs.map +0 -1
  117. package/dist/stripe/config.d.ts +0 -43
  118. package/dist/stripe/handler.d.ts +0 -15
  119. package/dist/stripe/index.cjs.map +0 -1
  120. package/dist/stripe/index.d.ts +0 -12
  121. package/dist/stripe/index.mjs.map +0 -1
  122. package/dist/stripe/mapper.d.ts +0 -157
  123. package/dist/stripe/metadata.d.ts +0 -10
  124. package/dist/stripe/schema.d.ts +0 -41
  125. package/dist/subscription/index.d.ts +0 -148
  126. package/dist/types.cjs.map +0 -1
  127. package/dist/types.d.ts +0 -9
  128. package/dist/types.mjs.map +0 -1
@@ -1,19 +1,40 @@
1
- import { Stripe } from 'stripe';
2
- import { SubscriptionStatus } from '../subscription/index.cjs';
3
-
1
+ import { SubscriptionStatus } from "../subscription/index.cjs";
2
+ import { Stripe } from "stripe";
3
+ //#region src/stripe/mapper.d.ts
4
4
  declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
5
5
  type Price = {
6
- id: string;
7
- type: Stripe.Price.Type;
8
- active: boolean;
9
- billing_scheme: Stripe.Price.BillingScheme;
10
- currency: Stripe.Price['currency'];
11
- unit_amount: number | null;
12
- unit_amount_decimal: string | null;
13
- recurring: Stripe.Price.Recurring | null;
6
+ id: string;
7
+ type: Stripe.Price.Type;
8
+ active: boolean;
9
+ billing_scheme: Stripe.Price.BillingScheme;
10
+ currency: Stripe.Price['currency'];
11
+ unit_amount: number | null;
12
+ unit_amount_decimal: string | null;
13
+ recurring: Stripe.Price.Recurring | null;
14
14
  };
15
15
  declare function mapPrice(price: Stripe.Price): Price;
16
16
  declare function mapLineItem(item: Stripe.LineItem): {
17
+ id: string;
18
+ currency: string;
19
+ quantity: number | null;
20
+ description: string | null;
21
+ amount_tax: number;
22
+ amount_total: number;
23
+ amount_subtotal: number;
24
+ amount_discount: number;
25
+ price: Price | null;
26
+ };
27
+ type PaymentStatus = 'no_payment_required' | 'paid' | 'unpaid';
28
+ declare function mapCheckoutSession(session: Stripe.Checkout.Session): {
29
+ id: string;
30
+ url: string | null;
31
+ coupon: string | undefined;
32
+ livemode: boolean;
33
+ expires_at: number;
34
+ payment_status: PaymentStatus;
35
+ currency: string | null;
36
+ amount_total: number | null;
37
+ line_items: {
17
38
  id: string;
18
39
  currency: string;
19
40
  quantity: number | null;
@@ -23,48 +44,50 @@ declare function mapLineItem(item: Stripe.LineItem): {
23
44
  amount_subtotal: number;
24
45
  amount_discount: number;
25
46
  price: Price | null;
26
- };
27
- type PaymentStatus = 'no_payment_required' | 'paid' | 'unpaid';
28
- declare function mapCheckoutSession(session: Stripe.Checkout.Session): {
29
- id: string;
30
- url: string | null;
31
- coupon: string | undefined;
32
- livemode: boolean;
33
- expires_at: number;
34
- payment_status: PaymentStatus;
35
- currency: string | null;
36
- amount_total: number | null;
37
- line_items: {
38
- id: string;
39
- currency: string;
40
- quantity: number | null;
41
- description: string | null;
42
- amount_tax: number;
43
- amount_total: number;
44
- amount_subtotal: number;
45
- amount_discount: number;
46
- price: Price | null;
47
- }[] | undefined;
47
+ }[] | undefined;
48
48
  };
49
49
  declare function mapInvoice(i: Stripe.Invoice): {
50
- id: string;
51
- number: string | null;
52
- total: number;
53
- subtotal: number;
54
- amount_due: number;
55
- amount_paid: number;
56
- amount_remaining: number;
57
- currency: string;
58
- billing_reason: Stripe.Invoice.BillingReason | null;
59
- hosted_invoice_url: string | null | undefined;
60
- invoice_pdf: string | null | undefined;
61
- receipt_number: string | null;
62
- status: Stripe.Invoice.Status | null;
63
- created: number;
64
- period_start: number;
65
- period_end: number;
50
+ id: string;
51
+ number: string | null;
52
+ total: number;
53
+ subtotal: number;
54
+ amount_due: number;
55
+ amount_paid: number;
56
+ amount_remaining: number;
57
+ currency: string;
58
+ billing_reason: Stripe.Invoice.BillingReason | null;
59
+ hosted_invoice_url: string | null | undefined;
60
+ invoice_pdf: string | null | undefined;
61
+ receipt_number: string | null;
62
+ status: Stripe.Invoice.Status | null;
63
+ created: number;
64
+ period_start: number;
65
+ period_end: number;
66
66
  };
67
67
  declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
68
+ id: string;
69
+ amount: number;
70
+ amount_capturable: number;
71
+ amount_received: number;
72
+ currency: string;
73
+ client_secret: string | null;
74
+ description: string | null;
75
+ status: Stripe.PaymentIntent.Status;
76
+ created: number;
77
+ };
78
+ declare function mapCharge(charge: Stripe.Charge): {
79
+ id: string;
80
+ description: string | null;
81
+ currency: string;
82
+ amount: number;
83
+ amount_captured: number;
84
+ amount_refunded: number;
85
+ receipt_email: string | null;
86
+ receipt_number: string | null;
87
+ receipt_url: string | null;
88
+ status: Stripe.Charge.Status;
89
+ created: number;
90
+ payment_intent: {
68
91
  id: string;
69
92
  amount: number;
70
93
  amount_capturable: number;
@@ -74,84 +97,62 @@ declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
74
97
  description: string | null;
75
98
  status: Stripe.PaymentIntent.Status;
76
99
  created: number;
77
- };
78
- declare function mapCharge(charge: Stripe.Charge): {
79
- id: string;
80
- description: string | null;
81
- currency: string;
82
- amount: number;
83
- amount_captured: number;
84
- amount_refunded: number;
85
- receipt_email: string | null;
86
- receipt_number: string | null;
87
- receipt_url: string | null;
88
- status: Stripe.Charge.Status;
89
- created: number;
90
- payment_intent: {
91
- id: string;
92
- amount: number;
93
- amount_capturable: number;
94
- amount_received: number;
95
- currency: string;
96
- client_secret: string | null;
97
- description: string | null;
98
- status: Stripe.PaymentIntent.Status;
99
- created: number;
100
- } | undefined;
100
+ } | undefined;
101
101
  };
102
102
  type CheckoutSession = ReturnType<typeof mapCheckoutSession>;
103
103
  type ProductPrice = {
104
- id: string;
105
- type: Stripe.Price.Type;
106
- unit_amount: number;
107
- currency: Stripe.Price['currency'];
108
- product: {
109
- id: Stripe.Product['id'];
110
- name: Stripe.Product['name'];
111
- description: Stripe.Product['description'];
112
- livemode: Stripe.Product['livemode'];
113
- };
104
+ id: string;
105
+ type: Stripe.Price.Type;
106
+ unit_amount: number;
107
+ currency: Stripe.Price['currency'];
108
+ product: {
109
+ id: Stripe.Product['id'];
110
+ name: Stripe.Product['name'];
111
+ description: Stripe.Product['description'];
112
+ livemode: Stripe.Product['livemode'];
113
+ };
114
114
  };
115
115
  declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
116
116
  declare const ZERO_DECIMAL_CURRENCIES: string[];
117
117
  declare function minorUnits(currency: string): 1 | 100;
118
118
  declare function price(value: number, currency: string): number;
119
119
  interface Item {
120
- item_id: string;
121
- item_name: string;
122
- affiliation?: 'Google Store' | (string & {});
123
- coupon?: string;
124
- discount?: number;
125
- index?: number;
126
- item_brand?: string;
127
- item_category?: string;
128
- item_category2?: string;
129
- item_category3?: string;
130
- item_category4?: string;
131
- item_category5?: string;
132
- item_list_id?: string;
133
- item_list_name?: string;
134
- item_variant?: string;
135
- location_id?: string;
136
- price?: number;
137
- quantity?: number;
120
+ item_id: string;
121
+ item_name: string;
122
+ affiliation?: 'Google Store' | (string & {});
123
+ coupon?: string;
124
+ discount?: number;
125
+ index?: number;
126
+ item_brand?: string;
127
+ item_category?: string;
128
+ item_category2?: string;
129
+ item_category3?: string;
130
+ item_category4?: string;
131
+ item_category5?: string;
132
+ item_list_id?: string;
133
+ item_list_name?: string;
134
+ item_variant?: string;
135
+ location_id?: string;
136
+ price?: number;
137
+ quantity?: number;
138
138
  }
139
139
  interface PurchaseProperties {
140
- currency: string;
141
- value: number;
142
- transaction_id: string;
143
- coupon?: string;
144
- shipping?: number;
145
- tax?: number;
146
- items?: Item[];
140
+ currency: string;
141
+ value: number;
142
+ transaction_id: string;
143
+ coupon?: string;
144
+ shipping?: number;
145
+ tax?: number;
146
+ items?: Item[];
147
147
  }
148
148
  interface BeginCheckoutProperties {
149
- currency: string;
150
- value: number;
151
- coupon?: string;
152
- items: Item[];
149
+ currency: string;
150
+ value: number;
151
+ coupon?: string;
152
+ items: Item[];
153
153
  }
154
154
  declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
155
155
  declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
156
-
157
- export { type BeginCheckoutProperties, type CheckoutSession, type Item, type PaymentStatus, type Price, type ProductPrice, type PurchaseProperties, ZERO_DECIMAL_CURRENCIES, getBeginCheckoutProperties, getPurchaseProperties, mapCharge, mapCheckoutSession, mapInvoice, mapLineItem, mapPaymentIntent, mapPrice, mapSubscriptionStatus, mapTime, minorUnits, price };
156
+ //#endregion
157
+ export { BeginCheckoutProperties, CheckoutSession, Item, PaymentStatus, Price, ProductPrice, PurchaseProperties, ZERO_DECIMAL_CURRENCIES, getBeginCheckoutProperties, getPurchaseProperties, mapCharge, mapCheckoutSession, mapInvoice, mapLineItem, mapPaymentIntent, mapPrice, mapSubscriptionStatus, mapTime, minorUnits, price };
158
+ //# sourceMappingURL=mapper.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper.d.cts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;iBAGgB,QAAQ,yBACtB,wBAAwB,IACvB;KAKS;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,gBAAgB,OAAO,MAAM;EAC7B,UAAU,OAAO;EACjB;EACA;EACA,WAAW,OAAO,MAAM;;iBAGV,SAAS,OAAO,OAAO,QAAQ;iBAa/B,YAAY,MAAM,OAAO;EAErC;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAK;;KAIG;iBAEI,mBAAmB,SAAS,OAAO,SAAS;;;;;;;;;;;;;;;;;;;;;iBA8B5C,WAAW,GAAG,OAAO;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAc,OAAA,QAAA;EACd;EACA;EACA;EACA,QAAM,OAAA,QAAA;EACN;EACA;EACA;;iBAIY,iBAAiB,QAAQ,OAAO;EAE5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,cAAA;EACN;;iBAIY,UAAU,QAAQ,OAAO;EAErC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,OAAA;EACN;EACA;;;;;;;;;;;;KAOQ,kBAAkB,kBAAkB;KACpC;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,UAAU,OAAO;EACjB;IACE,IAAI,OAAO;IACX,MAAM,OAAO;IACb,aAAa,OAAO;IACpB,UAAU,OAAO;;;iBAIL,sBAAsB,QAAQ,OAAO,aAAa,SAAS;cAyB9D;iBAmBG,WAAW;iBAIX,MAAM,eAAe;UAIpB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;UAGO;EACf;EACA;EACA;EACA,OAAO;;iBAGO,sBAAsB,SAAS,kBAAkB;iBA2BjD,2BAA2B,GAAG,eAAe"}
@@ -0,0 +1,158 @@
1
+ import { SubscriptionStatus } from "../subscription/index.mjs";
2
+ import { Stripe } from "stripe";
3
+ //#region src/stripe/mapper.d.ts
4
+ declare function mapTime<T extends number | null>(stripeTimestampSeconds: T): T extends number ? string : null;
5
+ type Price = {
6
+ id: string;
7
+ type: Stripe.Price.Type;
8
+ active: boolean;
9
+ billing_scheme: Stripe.Price.BillingScheme;
10
+ currency: Stripe.Price['currency'];
11
+ unit_amount: number | null;
12
+ unit_amount_decimal: string | null;
13
+ recurring: Stripe.Price.Recurring | null;
14
+ };
15
+ declare function mapPrice(price: Stripe.Price): Price;
16
+ declare function mapLineItem(item: Stripe.LineItem): {
17
+ id: string;
18
+ currency: string;
19
+ quantity: number | null;
20
+ description: string | null;
21
+ amount_tax: number;
22
+ amount_total: number;
23
+ amount_subtotal: number;
24
+ amount_discount: number;
25
+ price: Price | null;
26
+ };
27
+ type PaymentStatus = 'no_payment_required' | 'paid' | 'unpaid';
28
+ declare function mapCheckoutSession(session: Stripe.Checkout.Session): {
29
+ id: string;
30
+ url: string | null;
31
+ coupon: string | undefined;
32
+ livemode: boolean;
33
+ expires_at: number;
34
+ payment_status: PaymentStatus;
35
+ currency: string | null;
36
+ amount_total: number | null;
37
+ line_items: {
38
+ id: string;
39
+ currency: string;
40
+ quantity: number | null;
41
+ description: string | null;
42
+ amount_tax: number;
43
+ amount_total: number;
44
+ amount_subtotal: number;
45
+ amount_discount: number;
46
+ price: Price | null;
47
+ }[] | undefined;
48
+ };
49
+ declare function mapInvoice(i: Stripe.Invoice): {
50
+ id: string;
51
+ number: string | null;
52
+ total: number;
53
+ subtotal: number;
54
+ amount_due: number;
55
+ amount_paid: number;
56
+ amount_remaining: number;
57
+ currency: string;
58
+ billing_reason: Stripe.Invoice.BillingReason | null;
59
+ hosted_invoice_url: string | null | undefined;
60
+ invoice_pdf: string | null | undefined;
61
+ receipt_number: string | null;
62
+ status: Stripe.Invoice.Status | null;
63
+ created: number;
64
+ period_start: number;
65
+ period_end: number;
66
+ };
67
+ declare function mapPaymentIntent(intent: Stripe.PaymentIntent): {
68
+ id: string;
69
+ amount: number;
70
+ amount_capturable: number;
71
+ amount_received: number;
72
+ currency: string;
73
+ client_secret: string | null;
74
+ description: string | null;
75
+ status: Stripe.PaymentIntent.Status;
76
+ created: number;
77
+ };
78
+ declare function mapCharge(charge: Stripe.Charge): {
79
+ id: string;
80
+ description: string | null;
81
+ currency: string;
82
+ amount: number;
83
+ amount_captured: number;
84
+ amount_refunded: number;
85
+ receipt_email: string | null;
86
+ receipt_number: string | null;
87
+ receipt_url: string | null;
88
+ status: Stripe.Charge.Status;
89
+ created: number;
90
+ payment_intent: {
91
+ id: string;
92
+ amount: number;
93
+ amount_capturable: number;
94
+ amount_received: number;
95
+ currency: string;
96
+ client_secret: string | null;
97
+ description: string | null;
98
+ status: Stripe.PaymentIntent.Status;
99
+ created: number;
100
+ } | undefined;
101
+ };
102
+ type CheckoutSession = ReturnType<typeof mapCheckoutSession>;
103
+ type ProductPrice = {
104
+ id: string;
105
+ type: Stripe.Price.Type;
106
+ unit_amount: number;
107
+ currency: Stripe.Price['currency'];
108
+ product: {
109
+ id: Stripe.Product['id'];
110
+ name: Stripe.Product['name'];
111
+ description: Stripe.Product['description'];
112
+ livemode: Stripe.Product['livemode'];
113
+ };
114
+ };
115
+ declare function mapSubscriptionStatus(status: Stripe.Subscription.Status): SubscriptionStatus;
116
+ declare const ZERO_DECIMAL_CURRENCIES: string[];
117
+ declare function minorUnits(currency: string): 1 | 100;
118
+ declare function price(value: number, currency: string): number;
119
+ interface Item {
120
+ item_id: string;
121
+ item_name: string;
122
+ affiliation?: 'Google Store' | (string & {});
123
+ coupon?: string;
124
+ discount?: number;
125
+ index?: number;
126
+ item_brand?: string;
127
+ item_category?: string;
128
+ item_category2?: string;
129
+ item_category3?: string;
130
+ item_category4?: string;
131
+ item_category5?: string;
132
+ item_list_id?: string;
133
+ item_list_name?: string;
134
+ item_variant?: string;
135
+ location_id?: string;
136
+ price?: number;
137
+ quantity?: number;
138
+ }
139
+ interface PurchaseProperties {
140
+ currency: string;
141
+ value: number;
142
+ transaction_id: string;
143
+ coupon?: string;
144
+ shipping?: number;
145
+ tax?: number;
146
+ items?: Item[];
147
+ }
148
+ interface BeginCheckoutProperties {
149
+ currency: string;
150
+ value: number;
151
+ coupon?: string;
152
+ items: Item[];
153
+ }
154
+ declare function getPurchaseProperties(session: CheckoutSession): PurchaseProperties;
155
+ declare function getBeginCheckoutProperties(p: ProductPrice): BeginCheckoutProperties;
156
+ //#endregion
157
+ export { BeginCheckoutProperties, CheckoutSession, Item, PaymentStatus, Price, ProductPrice, PurchaseProperties, ZERO_DECIMAL_CURRENCIES, getBeginCheckoutProperties, getPurchaseProperties, mapCharge, mapCheckoutSession, mapInvoice, mapLineItem, mapPaymentIntent, mapPrice, mapSubscriptionStatus, mapTime, minorUnits, price };
158
+ //# sourceMappingURL=mapper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper.d.mts","names":[],"sources":["../../src/stripe/mapper.ts"],"mappings":";;;iBAGgB,QAAQ,yBACtB,wBAAwB,IACvB;KAKS;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,gBAAgB,OAAO,MAAM;EAC7B,UAAU,OAAO;EACjB;EACA;EACA,WAAW,OAAO,MAAM;;iBAGV,SAAS,OAAO,OAAO,QAAQ;iBAa/B,YAAY,MAAM,OAAO;EAErC;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAK;;KAIG;iBAEI,mBAAmB,SAAS,OAAO,SAAS;;;;;;;;;;;;;;;;;;;;;iBA8B5C,WAAW,GAAG,OAAO;EAEjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAc,OAAA,QAAA;EACd;EACA;EACA;EACA,QAAM,OAAA,QAAA;EACN;EACA;EACA;;iBAIY,iBAAiB,QAAQ,OAAO;EAE5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,cAAA;EACN;;iBAIY,UAAU,QAAQ,OAAO;EAErC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAM,OAAA,OAAA;EACN;EACA;;;;;;;;;;;;KAOQ,kBAAkB,kBAAkB;KACpC;EACV;EACA,MAAM,OAAO,MAAM;EACnB;EACA,UAAU,OAAO;EACjB;IACE,IAAI,OAAO;IACX,MAAM,OAAO;IACb,aAAa,OAAO;IACpB,UAAU,OAAO;;;iBAIL,sBAAsB,QAAQ,OAAO,aAAa,SAAS;cAyB9D;iBAmBG,WAAW;iBAIX,MAAM,eAAe;UAIpB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;UAGO;EACf;EACA;EACA;EACA,OAAO;;iBAGO,sBAAsB,SAAS,kBAAkB;iBA2BjD,2BAA2B,GAAG,eAAe"}