fontdue-js 1.11.0-alpha6 → 1.11.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.
@@ -129,6 +129,9 @@ fragment StoreModalReview_order on Order {
129
129
  clientSecret
130
130
  }
131
131
  completeUrl
132
+ total {
133
+ amount
134
+ }
132
135
  }
133
136
  */
134
137
 
@@ -549,12 +552,12 @@ const node = function () {
549
552
  }]
550
553
  },
551
554
  "params": {
552
- "cacheID": "aed5faf689fdfc1b2ad731c5058bc74d",
555
+ "cacheID": "34d773d28a967f9241d5174ad1f0e18e",
553
556
  "id": null,
554
557
  "metadata": {},
555
558
  "name": "StoreModalReviewCompleteOrderMutation",
556
559
  "operationKind": "mutation",
557
- "text": "mutation StoreModalReviewCompleteOrderMutation {\n completeOrder {\n order {\n ...StoreModalReview_order\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n requiresAction\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n}\n"
560
+ "text": "mutation StoreModalReviewCompleteOrderMutation {\n completeOrder {\n order {\n ...StoreModalReview_order\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n requiresAction\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n total {\n amount\n }\n}\n"
558
561
  }
559
562
  };
560
563
  }();
@@ -128,6 +128,9 @@ fragment StoreModalReview_order on Order {
128
128
  clientSecret
129
129
  }
130
130
  completeUrl
131
+ total {
132
+ amount
133
+ }
131
134
  }
132
135
 
133
136
  fragment StoreModalReview_viewer on Viewer {
@@ -622,12 +625,12 @@ const node = function () {
622
625
  }]
623
626
  },
624
627
  "params": {
625
- "cacheID": "921c7991fd0c243408b6e3e86165d605",
628
+ "cacheID": "ab1264b009e60ee2a4c28786470993cb",
626
629
  "id": null,
627
630
  "metadata": {},
628
631
  "name": "StoreModalReviewQuery",
629
632
  "operationKind": "query",
630
- "text": "query StoreModalReviewQuery {\n viewer {\n ...StripeProvider_viewer\n ...StoreModalReview_viewer\n currentOrder {\n ...StoreModalReview_order\n id\n }\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n}\n\nfragment StoreModalReview_viewer on Viewer {\n settings {\n eulaAgreementLabel(format: HTML)\n }\n}\n\nfragment StripeProvider_viewer on Viewer {\n settings {\n uiFontUrl\n uiFontName\n }\n themeConfig {\n customProperties\n }\n stripeCredentials {\n stripePublishableKey\n }\n currentOrder {\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n}\n"
633
+ "text": "query StoreModalReviewQuery {\n viewer {\n ...StripeProvider_viewer\n ...StoreModalReview_viewer\n currentOrder {\n ...StoreModalReview_order\n id\n }\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n total {\n amount\n }\n}\n\nfragment StoreModalReview_viewer on Viewer {\n settings {\n eulaAgreementLabel(format: HTML)\n }\n}\n\nfragment StripeProvider_viewer on Viewer {\n settings {\n uiFontUrl\n uiFontName\n }\n themeConfig {\n customProperties\n }\n stripeCredentials {\n stripePublishableKey\n }\n currentOrder {\n stripePaymentIntent {\n clientSecret\n }\n id\n }\n}\n"
631
634
  }
632
635
  };
633
636
  }();
@@ -0,0 +1,53 @@
1
+ import { ConcreteRequest } from "relay-runtime";
2
+ import { FragmentRefs } from "relay-runtime";
3
+ export declare type UpdateOrderInput = {
4
+ billingIdentity?: IdentityInput | null;
5
+ licenseeIdentity?: IdentityInput | null;
6
+ licenseeIsBillingIdentity?: boolean | null;
7
+ orderItems?: Array<OrderItemInput | null> | null;
8
+ stripePaymentMethodId?: string | null;
9
+ stripeTokenId?: string | null;
10
+ };
11
+ export declare type IdentityInput = {
12
+ administrativeArea?: string | null;
13
+ country: string;
14
+ email: string;
15
+ locality?: string | null;
16
+ name: string;
17
+ organization?: string | null;
18
+ phone: string;
19
+ sortingCode?: string | null;
20
+ street?: string | null;
21
+ sublocality?: string | null;
22
+ vatNumber?: string | null;
23
+ zip?: string | null;
24
+ };
25
+ export declare type OrderItemInput = {
26
+ id: string;
27
+ licenseSelections: Array<LicenseSelectionInput | null>;
28
+ };
29
+ export declare type LicenseSelectionInput = {
30
+ licenseId: string;
31
+ licenseOptionId?: string | null;
32
+ licenseVariableId?: string | null;
33
+ variableText?: string | null;
34
+ };
35
+ export declare type StoreModalReviewUpdateOrderMutationVariables = {
36
+ input: UpdateOrderInput;
37
+ };
38
+ export declare type StoreModalReviewUpdateOrderMutationResponse = {
39
+ readonly updateOrder: {
40
+ readonly order: {
41
+ readonly total: {
42
+ readonly amount: number;
43
+ } | null;
44
+ readonly " $fragmentRefs": FragmentRefs<"StoreModalReview_order">;
45
+ } | null;
46
+ } | null;
47
+ };
48
+ export declare type StoreModalReviewUpdateOrderMutation = {
49
+ readonly response: StoreModalReviewUpdateOrderMutationResponse;
50
+ readonly variables: StoreModalReviewUpdateOrderMutationVariables;
51
+ };
52
+ declare const node: ConcreteRequest;
53
+ export default node;
@@ -0,0 +1,567 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /* tslint:disable */
8
+ /* eslint-disable */
9
+ // @ts-nocheck
10
+
11
+ /*
12
+ mutation StoreModalReviewUpdateOrderMutation(
13
+ $input: UpdateOrderInput!
14
+ ) {
15
+ updateOrder(input: $input) {
16
+ order {
17
+ ...StoreModalReview_order
18
+ total {
19
+ amount
20
+ }
21
+ id
22
+ }
23
+ }
24
+ }
25
+
26
+ fragment CartTotals_order on Order {
27
+ subtotal {
28
+ ...Price_price
29
+ }
30
+ discount {
31
+ amount {
32
+ amount
33
+ ...Price_price
34
+ }
35
+ coupon {
36
+ ...CouponText_coupon
37
+ id
38
+ }
39
+ id
40
+ }
41
+ discountedSubtotal {
42
+ ...Price_price
43
+ }
44
+ total {
45
+ amount
46
+ ...Price_price
47
+ }
48
+ taxes {
49
+ ...Price_price
50
+ }
51
+ taxName
52
+ gstIncluded
53
+ }
54
+
55
+ fragment CouponText_coupon on Coupon {
56
+ type
57
+ percentAmount
58
+ creditAmountRemaining {
59
+ amount
60
+ currency
61
+ }
62
+ }
63
+
64
+ fragment Price_price on Money {
65
+ amount
66
+ currency
67
+ }
68
+
69
+ fragment SKUPrice_sku on Sku {
70
+ id
71
+ price(licenseOptions: []) {
72
+ amount
73
+ ...Price_price
74
+ }
75
+ }
76
+
77
+ fragment StoreModalDownload_order on Order {
78
+ id
79
+ archiveUrl
80
+ }
81
+
82
+ fragment StoreModalReviewIdentity_identity on Identity {
83
+ email
84
+ phoneFormatted
85
+ addressFormatted
86
+ vatNumber
87
+ }
88
+
89
+ fragment StoreModalReview_order on Order {
90
+ ...CartTotals_order
91
+ ...StoreModalDownload_order
92
+ customer {
93
+ email
94
+ name
95
+ id
96
+ }
97
+ billingIdentity {
98
+ name
99
+ email
100
+ phone
101
+ street
102
+ locality
103
+ administrativeArea
104
+ country
105
+ zip
106
+ ...StoreModalReviewIdentity_identity
107
+ }
108
+ licenseeIdentity {
109
+ ...StoreModalReviewIdentity_identity
110
+ }
111
+ licenseeIsBillingIdentity
112
+ stripePaymentMethod {
113
+ card {
114
+ last4
115
+ brandFormatted
116
+ }
117
+ }
118
+ orderItems {
119
+ id
120
+ description
121
+ sku {
122
+ ...SKUPrice_sku
123
+ id
124
+ }
125
+ }
126
+ canCompleteWithCoupon
127
+ completedWithCoupon
128
+ stripePaymentIntent {
129
+ status
130
+ clientSecret
131
+ }
132
+ completeUrl
133
+ total {
134
+ amount
135
+ }
136
+ }
137
+ */
138
+
139
+ const node = function () {
140
+ var v0 = [{
141
+ "defaultValue": null,
142
+ "kind": "LocalArgument",
143
+ "name": "input"
144
+ }],
145
+ v1 = [{
146
+ "kind": "Variable",
147
+ "name": "input",
148
+ "variableName": "input"
149
+ }],
150
+ v2 = {
151
+ "alias": null,
152
+ "args": null,
153
+ "kind": "ScalarField",
154
+ "name": "amount",
155
+ "storageKey": null
156
+ },
157
+ v3 = [v2 /*: any*/, {
158
+ "alias": null,
159
+ "args": null,
160
+ "kind": "ScalarField",
161
+ "name": "currency",
162
+ "storageKey": null
163
+ }],
164
+ v4 = {
165
+ "alias": null,
166
+ "args": null,
167
+ "kind": "ScalarField",
168
+ "name": "id",
169
+ "storageKey": null
170
+ },
171
+ v5 = {
172
+ "alias": null,
173
+ "args": null,
174
+ "kind": "ScalarField",
175
+ "name": "email",
176
+ "storageKey": null
177
+ },
178
+ v6 = {
179
+ "alias": null,
180
+ "args": null,
181
+ "kind": "ScalarField",
182
+ "name": "name",
183
+ "storageKey": null
184
+ },
185
+ v7 = {
186
+ "alias": null,
187
+ "args": null,
188
+ "kind": "ScalarField",
189
+ "name": "phoneFormatted",
190
+ "storageKey": null
191
+ },
192
+ v8 = {
193
+ "alias": null,
194
+ "args": null,
195
+ "kind": "ScalarField",
196
+ "name": "addressFormatted",
197
+ "storageKey": null
198
+ },
199
+ v9 = {
200
+ "alias": null,
201
+ "args": null,
202
+ "kind": "ScalarField",
203
+ "name": "vatNumber",
204
+ "storageKey": null
205
+ };
206
+ return {
207
+ "fragment": {
208
+ "argumentDefinitions": v0 /*: any*/,
209
+ "kind": "Fragment",
210
+ "metadata": null,
211
+ "name": "StoreModalReviewUpdateOrderMutation",
212
+ "selections": [{
213
+ "alias": null,
214
+ "args": v1 /*: any*/,
215
+ "concreteType": "UpdateOrderPayload",
216
+ "kind": "LinkedField",
217
+ "name": "updateOrder",
218
+ "plural": false,
219
+ "selections": [{
220
+ "alias": null,
221
+ "args": null,
222
+ "concreteType": "Order",
223
+ "kind": "LinkedField",
224
+ "name": "order",
225
+ "plural": false,
226
+ "selections": [{
227
+ "alias": null,
228
+ "args": null,
229
+ "concreteType": "Money",
230
+ "kind": "LinkedField",
231
+ "name": "total",
232
+ "plural": false,
233
+ "selections": [v2 /*: any*/],
234
+
235
+ "storageKey": null
236
+ }, {
237
+ "args": null,
238
+ "kind": "FragmentSpread",
239
+ "name": "StoreModalReview_order"
240
+ }],
241
+ "storageKey": null
242
+ }],
243
+ "storageKey": null
244
+ }],
245
+ "type": "RootMutationType",
246
+ "abstractKey": null
247
+ },
248
+ "kind": "Request",
249
+ "operation": {
250
+ "argumentDefinitions": v0 /*: any*/,
251
+ "kind": "Operation",
252
+ "name": "StoreModalReviewUpdateOrderMutation",
253
+ "selections": [{
254
+ "alias": null,
255
+ "args": v1 /*: any*/,
256
+ "concreteType": "UpdateOrderPayload",
257
+ "kind": "LinkedField",
258
+ "name": "updateOrder",
259
+ "plural": false,
260
+ "selections": [{
261
+ "alias": null,
262
+ "args": null,
263
+ "concreteType": "Order",
264
+ "kind": "LinkedField",
265
+ "name": "order",
266
+ "plural": false,
267
+ "selections": [{
268
+ "alias": null,
269
+ "args": null,
270
+ "concreteType": "Money",
271
+ "kind": "LinkedField",
272
+ "name": "subtotal",
273
+ "plural": false,
274
+ "selections": v3 /*: any*/,
275
+ "storageKey": null
276
+ }, {
277
+ "alias": null,
278
+ "args": null,
279
+ "concreteType": "Discount",
280
+ "kind": "LinkedField",
281
+ "name": "discount",
282
+ "plural": false,
283
+ "selections": [{
284
+ "alias": null,
285
+ "args": null,
286
+ "concreteType": "Money",
287
+ "kind": "LinkedField",
288
+ "name": "amount",
289
+ "plural": false,
290
+ "selections": v3 /*: any*/,
291
+ "storageKey": null
292
+ }, {
293
+ "alias": null,
294
+ "args": null,
295
+ "concreteType": "Coupon",
296
+ "kind": "LinkedField",
297
+ "name": "coupon",
298
+ "plural": false,
299
+ "selections": [{
300
+ "alias": null,
301
+ "args": null,
302
+ "kind": "ScalarField",
303
+ "name": "type",
304
+ "storageKey": null
305
+ }, {
306
+ "alias": null,
307
+ "args": null,
308
+ "kind": "ScalarField",
309
+ "name": "percentAmount",
310
+ "storageKey": null
311
+ }, {
312
+ "alias": null,
313
+ "args": null,
314
+ "concreteType": "Money",
315
+ "kind": "LinkedField",
316
+ "name": "creditAmountRemaining",
317
+ "plural": false,
318
+ "selections": v3 /*: any*/,
319
+ "storageKey": null
320
+ }, v4 /*: any*/],
321
+
322
+ "storageKey": null
323
+ }, v4 /*: any*/],
324
+
325
+ "storageKey": null
326
+ }, {
327
+ "alias": null,
328
+ "args": null,
329
+ "concreteType": "Money",
330
+ "kind": "LinkedField",
331
+ "name": "discountedSubtotal",
332
+ "plural": false,
333
+ "selections": v3 /*: any*/,
334
+ "storageKey": null
335
+ }, {
336
+ "alias": null,
337
+ "args": null,
338
+ "concreteType": "Money",
339
+ "kind": "LinkedField",
340
+ "name": "total",
341
+ "plural": false,
342
+ "selections": v3 /*: any*/,
343
+ "storageKey": null
344
+ }, {
345
+ "alias": null,
346
+ "args": null,
347
+ "concreteType": "Money",
348
+ "kind": "LinkedField",
349
+ "name": "taxes",
350
+ "plural": false,
351
+ "selections": v3 /*: any*/,
352
+ "storageKey": null
353
+ }, {
354
+ "alias": null,
355
+ "args": null,
356
+ "kind": "ScalarField",
357
+ "name": "taxName",
358
+ "storageKey": null
359
+ }, {
360
+ "alias": null,
361
+ "args": null,
362
+ "kind": "ScalarField",
363
+ "name": "gstIncluded",
364
+ "storageKey": null
365
+ }, v4 /*: any*/, {
366
+ "alias": null,
367
+ "args": null,
368
+ "kind": "ScalarField",
369
+ "name": "archiveUrl",
370
+ "storageKey": null
371
+ }, {
372
+ "alias": null,
373
+ "args": null,
374
+ "concreteType": "Customer",
375
+ "kind": "LinkedField",
376
+ "name": "customer",
377
+ "plural": false,
378
+ "selections": [v5 /*: any*/, v6 /*: any*/, v4 /*: any*/],
379
+
380
+ "storageKey": null
381
+ }, {
382
+ "alias": null,
383
+ "args": null,
384
+ "concreteType": "Identity",
385
+ "kind": "LinkedField",
386
+ "name": "billingIdentity",
387
+ "plural": false,
388
+ "selections": [v6 /*: any*/, v5 /*: any*/, {
389
+ "alias": null,
390
+ "args": null,
391
+ "kind": "ScalarField",
392
+ "name": "phone",
393
+ "storageKey": null
394
+ }, {
395
+ "alias": null,
396
+ "args": null,
397
+ "kind": "ScalarField",
398
+ "name": "street",
399
+ "storageKey": null
400
+ }, {
401
+ "alias": null,
402
+ "args": null,
403
+ "kind": "ScalarField",
404
+ "name": "locality",
405
+ "storageKey": null
406
+ }, {
407
+ "alias": null,
408
+ "args": null,
409
+ "kind": "ScalarField",
410
+ "name": "administrativeArea",
411
+ "storageKey": null
412
+ }, {
413
+ "alias": null,
414
+ "args": null,
415
+ "kind": "ScalarField",
416
+ "name": "country",
417
+ "storageKey": null
418
+ }, {
419
+ "alias": null,
420
+ "args": null,
421
+ "kind": "ScalarField",
422
+ "name": "zip",
423
+ "storageKey": null
424
+ }, v7 /*: any*/, v8 /*: any*/, v9 /*: any*/],
425
+
426
+ "storageKey": null
427
+ }, {
428
+ "alias": null,
429
+ "args": null,
430
+ "concreteType": "Identity",
431
+ "kind": "LinkedField",
432
+ "name": "licenseeIdentity",
433
+ "plural": false,
434
+ "selections": [v5 /*: any*/, v7 /*: any*/, v8 /*: any*/, v9 /*: any*/],
435
+
436
+ "storageKey": null
437
+ }, {
438
+ "alias": null,
439
+ "args": null,
440
+ "kind": "ScalarField",
441
+ "name": "licenseeIsBillingIdentity",
442
+ "storageKey": null
443
+ }, {
444
+ "alias": null,
445
+ "args": null,
446
+ "concreteType": "StripePaymentMethod",
447
+ "kind": "LinkedField",
448
+ "name": "stripePaymentMethod",
449
+ "plural": false,
450
+ "selections": [{
451
+ "alias": null,
452
+ "args": null,
453
+ "concreteType": "StripeSource",
454
+ "kind": "LinkedField",
455
+ "name": "card",
456
+ "plural": false,
457
+ "selections": [{
458
+ "alias": null,
459
+ "args": null,
460
+ "kind": "ScalarField",
461
+ "name": "last4",
462
+ "storageKey": null
463
+ }, {
464
+ "alias": null,
465
+ "args": null,
466
+ "kind": "ScalarField",
467
+ "name": "brandFormatted",
468
+ "storageKey": null
469
+ }],
470
+ "storageKey": null
471
+ }],
472
+ "storageKey": null
473
+ }, {
474
+ "alias": null,
475
+ "args": null,
476
+ "concreteType": "OrderItem",
477
+ "kind": "LinkedField",
478
+ "name": "orderItems",
479
+ "plural": true,
480
+ "selections": [v4 /*: any*/, {
481
+ "alias": null,
482
+ "args": null,
483
+ "kind": "ScalarField",
484
+ "name": "description",
485
+ "storageKey": null
486
+ }, {
487
+ "alias": null,
488
+ "args": null,
489
+ "concreteType": "Sku",
490
+ "kind": "LinkedField",
491
+ "name": "sku",
492
+ "plural": false,
493
+ "selections": [v4 /*: any*/, {
494
+ "alias": null,
495
+ "args": [{
496
+ "kind": "Literal",
497
+ "name": "licenseOptions",
498
+ "value": []
499
+ }],
500
+ "concreteType": "Money",
501
+ "kind": "LinkedField",
502
+ "name": "price",
503
+ "plural": false,
504
+ "selections": v3 /*: any*/,
505
+ "storageKey": "price(licenseOptions:[])"
506
+ }],
507
+ "storageKey": null
508
+ }],
509
+ "storageKey": null
510
+ }, {
511
+ "alias": null,
512
+ "args": null,
513
+ "kind": "ScalarField",
514
+ "name": "canCompleteWithCoupon",
515
+ "storageKey": null
516
+ }, {
517
+ "alias": null,
518
+ "args": null,
519
+ "kind": "ScalarField",
520
+ "name": "completedWithCoupon",
521
+ "storageKey": null
522
+ }, {
523
+ "alias": null,
524
+ "args": null,
525
+ "concreteType": "StripePaymentIntent",
526
+ "kind": "LinkedField",
527
+ "name": "stripePaymentIntent",
528
+ "plural": false,
529
+ "selections": [{
530
+ "alias": null,
531
+ "args": null,
532
+ "kind": "ScalarField",
533
+ "name": "status",
534
+ "storageKey": null
535
+ }, {
536
+ "alias": null,
537
+ "args": null,
538
+ "kind": "ScalarField",
539
+ "name": "clientSecret",
540
+ "storageKey": null
541
+ }],
542
+ "storageKey": null
543
+ }, {
544
+ "alias": null,
545
+ "args": null,
546
+ "kind": "ScalarField",
547
+ "name": "completeUrl",
548
+ "storageKey": null
549
+ }],
550
+ "storageKey": null
551
+ }],
552
+ "storageKey": null
553
+ }]
554
+ },
555
+ "params": {
556
+ "cacheID": "e89388a21bf4c2064b75304b79f69e1d",
557
+ "id": null,
558
+ "metadata": {},
559
+ "name": "StoreModalReviewUpdateOrderMutation",
560
+ "operationKind": "mutation",
561
+ "text": "mutation StoreModalReviewUpdateOrderMutation(\n $input: UpdateOrderInput!\n) {\n updateOrder(input: $input) {\n order {\n ...StoreModalReview_order\n total {\n amount\n }\n id\n }\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxes {\n ...Price_price\n }\n taxName\n gstIncluded\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalDownload_order on Order {\n id\n archiveUrl\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalReview_order on Order {\n ...CartTotals_order\n ...StoreModalDownload_order\n customer {\n email\n name\n id\n }\n billingIdentity {\n name\n email\n phone\n street\n locality\n administrativeArea\n country\n zip\n ...StoreModalReviewIdentity_identity\n }\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brandFormatted\n }\n }\n orderItems {\n id\n description\n sku {\n ...SKUPrice_sku\n id\n }\n }\n canCompleteWithCoupon\n completedWithCoupon\n stripePaymentIntent {\n status\n clientSecret\n }\n completeUrl\n total {\n amount\n }\n}\n"
562
+ }
563
+ };
564
+ }();
565
+ node.hash = '5ee297fdd5931c542d2f683651e54643';
566
+ var _default = node;
567
+ exports.default = _default;
@@ -40,6 +40,9 @@ export declare type StoreModalReview_order = {
40
40
  readonly clientSecret: string | null;
41
41
  } | null;
42
42
  readonly completeUrl: string;
43
+ readonly total: {
44
+ readonly amount: number;
45
+ } | null;
43
46
  readonly " $fragmentRefs": FragmentRefs<"CartTotals_order" | "StoreModalDownload_order">;
44
47
  readonly " $refType": "StoreModalReview_order";
45
48
  };
@@ -208,6 +208,21 @@ const node = function () {
208
208
  "kind": "ScalarField",
209
209
  "name": "completeUrl",
210
210
  "storageKey": null
211
+ }, {
212
+ "alias": null,
213
+ "args": null,
214
+ "concreteType": "Money",
215
+ "kind": "LinkedField",
216
+ "name": "total",
217
+ "plural": false,
218
+ "selections": [{
219
+ "alias": null,
220
+ "args": null,
221
+ "kind": "ScalarField",
222
+ "name": "amount",
223
+ "storageKey": null
224
+ }],
225
+ "storageKey": null
211
226
  }, {
212
227
  "args": null,
213
228
  "kind": "FragmentSpread",
@@ -221,6 +236,6 @@ const node = function () {
221
236
  "abstractKey": null
222
237
  };
223
238
  }();
224
- node.hash = '039b531ec1968e12d77dd23e0493a513';
239
+ node.hash = '0257d97d4d3f3a989cba19fb108f0e00';
225
240
  var _default = node;
226
241
  exports.default = _default;
@@ -123,10 +123,7 @@ const Checkout = _ref => {
123
123
  let stripe;
124
124
  let elements;
125
125
  if (!skipPaymentMethod) {
126
- // TODO this seems like it shouldn't be necessary, once we have items in the
127
- // cart and we click "checkout", the order should have already updated with
128
- // a clientSecret -- is it possible we need to add to the mutation the fragment
129
- // for the StripeProvider?
126
+ // https://twitter.com/acdlite/status/1581401077915975680
130
127
  stripe = (0, _reactStripeJs.useStripe)();
131
128
  elements = (0, _reactStripeJs.useElements)();
132
129
  }
@@ -29,7 +29,7 @@ const StoreModalDownload = _ref => {
29
29
  body: /*#__PURE__*/_react.default.createElement(_StoreModalDownloadLayout.default, {
30
30
  archiveUrl: order.archiveUrl
31
31
  }, {
32
- message: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Thanks, your payment was received!"), /*#__PURE__*/_react.default.createElement("p", null, "Your download is ", order.archiveUrl ? 'ready.' : 'being prepared...'), /*#__PURE__*/_react.default.createElement("p", null, "An email receipt with a download link has been sent to your email address."))
32
+ message: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Your order was confirmed."), /*#__PURE__*/_react.default.createElement("p", null, "Your download is ", order.archiveUrl ? 'ready.' : 'being prepared...'), /*#__PURE__*/_react.default.createElement("p", null, "An email receipt with a download link has been sent to your email address."))
33
33
  })
34
34
  });
35
35
  };
@@ -20,7 +20,7 @@ var _StoreModalReviewConfirm = _interopRequireDefault(require("../elements/Store
20
20
  var _StoreModalDownload = _interopRequireDefault(require("./StoreModalDownload"));
21
21
  var _StoreModalCheckoutContext = _interopRequireDefault(require("./StoreModalCheckoutContext"));
22
22
  var _StripeProvider = _interopRequireDefault(require("../StripeProvider"));
23
- var _StoreModalReviewCompleteOrderMutation, _StoreModalReview_order, _StoreModalReview_viewer, _StoreModalReviewQuery;
23
+ var _StoreModalReviewCompleteOrderMutation, _StoreModalReviewUpdateOrderMutation, _StoreModalReview_order, _StoreModalReview_viewer, _StoreModalReviewQuery;
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -33,13 +33,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
33
33
  // but here we want to keep displaying the order that they
34
34
  // just paid for
35
35
  const submitCompleteMutation = _StoreModalReviewCompleteOrderMutation !== void 0 ? _StoreModalReviewCompleteOrderMutation : (_StoreModalReviewCompleteOrderMutation = require("../../__generated__/StoreModalReviewCompleteOrderMutation.graphql"), _StoreModalReviewCompleteOrderMutation.hash && _StoreModalReviewCompleteOrderMutation.hash !== "de20197df49deb030c473adbd9560e03" && console.error("The definition of 'StoreModalReviewCompleteOrderMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalReviewCompleteOrderMutation);
36
+ const updateOrderMutation = _StoreModalReviewUpdateOrderMutation !== void 0 ? _StoreModalReviewUpdateOrderMutation : (_StoreModalReviewUpdateOrderMutation = require("../../__generated__/StoreModalReviewUpdateOrderMutation.graphql"), _StoreModalReviewUpdateOrderMutation.hash && _StoreModalReviewUpdateOrderMutation.hash !== "5ee297fdd5931c542d2f683651e54643" && console.error("The definition of 'StoreModalReviewUpdateOrderMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalReviewUpdateOrderMutation);
36
37
  const StoreModalReview = _ref => {
37
- var _order$stripePaymentI, _order$orderItems, _viewer$settings$eula, _viewer$settings;
38
+ var _order$stripePaymentI, _order$total, _order$orderItems, _viewer$settings$eula, _viewer$settings;
38
39
  let {
39
40
  viewer: viewerKey,
40
41
  order: orderKey
41
42
  } = _ref;
42
- const order = (0, _reactRelay.useFragment)(_StoreModalReview_order !== void 0 ? _StoreModalReview_order : (_StoreModalReview_order = require("../../__generated__/StoreModalReview_order.graphql"), _StoreModalReview_order.hash && _StoreModalReview_order.hash !== "039b531ec1968e12d77dd23e0493a513" && console.error("The definition of 'StoreModalReview_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalReview_order), orderKey);
43
+ const order = (0, _reactRelay.useFragment)(_StoreModalReview_order !== void 0 ? _StoreModalReview_order : (_StoreModalReview_order = require("../../__generated__/StoreModalReview_order.graphql"), _StoreModalReview_order.hash && _StoreModalReview_order.hash !== "0257d97d4d3f3a989cba19fb108f0e00" && console.error("The definition of 'StoreModalReview_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalReview_order), orderKey);
43
44
  const viewer = (0, _reactRelay.useFragment)(_StoreModalReview_viewer !== void 0 ? _StoreModalReview_viewer : (_StoreModalReview_viewer = require("../../__generated__/StoreModalReview_viewer.graphql"), _StoreModalReview_viewer.hash && _StoreModalReview_viewer.hash !== "9136dd09437ff0102d8235b72b9b5c66" && console.error("The definition of 'StoreModalReview_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalReview_viewer), viewerKey);
44
45
  const dispatch = (0, _reactRedux.useDispatch)();
45
46
  const [completing, setCompleting] = (0, _react.useState)(false);
@@ -51,18 +52,26 @@ const StoreModalReview = _ref => {
51
52
  scrollToTop
52
53
  } = (0, _react.useContext)(_StoreModalContainerContext.default);
53
54
  const environment = (0, _reactRelay.useRelayEnvironment)();
54
- const stripe = (0, _reactStripeJs.useStripe)();
55
- const elements = (0, _reactStripeJs.useElements)();
55
+ let stripe = null;
56
+ let elements = null;
57
+ if (order !== null && order !== void 0 && (_order$stripePaymentI = order.stripePaymentIntent) !== null && _order$stripePaymentI !== void 0 && _order$stripePaymentI.clientSecret) {
58
+ // normally we can't conditionally call hooks, but context consumers are
59
+ // exceptions, react actually allows this. in this case, there's no Elements
60
+ // provider because there's no payment intent, which probably means that this
61
+ // order has a zero value.
62
+ // https://twitter.com/acdlite/status/1581401077915975680
63
+ stripe = (0, _reactStripeJs.useStripe)();
64
+ elements = (0, _reactStripeJs.useElements)();
65
+ }
56
66
  if (!order) return null;
57
- if (order.completedWithCoupon || ((_order$stripePaymentI = order.stripePaymentIntent) === null || _order$stripePaymentI === void 0 ? void 0 : _order$stripePaymentI.status) === 'succeeded') {
67
+ if (order.completedWithCoupon) {
58
68
  return /*#__PURE__*/_react.default.createElement(_StoreModalDownload.default, {
59
69
  order: order
60
70
  });
61
71
  }
62
72
  const billingIdentity = order.billingIdentity;
73
+ const lastShownTotal = (0, _react.useRef)((_order$total = order.total) === null || _order$total === void 0 ? void 0 : _order$total.amount);
63
74
  const handleSubmit = () => {
64
- var _billingIdentity$stre, _billingIdentity$stre2, _billingIdentity$stre3, _billingIdentity$loca, _billingIdentity$admi, _billingIdentity$zip;
65
- if (!stripe || !elements) return;
66
75
  if (!billingIdentity) {
67
76
  console.error('No billing identity, required for payment');
68
77
  return;
@@ -73,47 +82,75 @@ const StoreModalReview = _ref => {
73
82
  (0, _relayRuntime.commitMutation)(environment, {
74
83
  mutation: submitCompleteMutation,
75
84
  variables: {},
76
- onCompleted: (_response, errors) => {
85
+ onCompleted: (response, errors) => {
77
86
  if (errors && errors.length > 0) {
78
87
  setCompleting(false);
79
88
  setError(errors[0].message);
80
89
  scrollToTop === null || scrollToTop === void 0 ? void 0 : scrollToTop();
81
90
  return;
82
91
  }
83
-
84
- // TODO: test this
85
-
86
- window.location.href = order.completeUrl;
87
92
  }
88
93
  });
89
94
  return;
90
95
  }
91
- stripe === null || stripe === void 0 ? void 0 : stripe.confirmPayment({
92
- elements,
93
- confirmParams: {
94
- return_url: order.completeUrl,
95
- payment_method_data: {
96
- billing_details: {
97
- email: billingIdentity.email,
98
- name: billingIdentity.name,
99
- address: {
100
- line1: (_billingIdentity$stre = billingIdentity.street) === null || _billingIdentity$stre === void 0 ? void 0 : _billingIdentity$stre.split(/\n/)[0],
101
- line2: (_billingIdentity$stre2 = (_billingIdentity$stre3 = billingIdentity.street) === null || _billingIdentity$stre3 === void 0 ? void 0 : _billingIdentity$stre3.split(/\n/)[1]) !== null && _billingIdentity$stre2 !== void 0 ? _billingIdentity$stre2 : '',
102
- city: (_billingIdentity$loca = billingIdentity.locality) !== null && _billingIdentity$loca !== void 0 ? _billingIdentity$loca : '',
103
- state: (_billingIdentity$admi = billingIdentity.administrativeArea) !== null && _billingIdentity$admi !== void 0 ? _billingIdentity$admi : '',
104
- country: billingIdentity.country,
105
- postal_code: (_billingIdentity$zip = billingIdentity.zip) !== null && _billingIdentity$zip !== void 0 ? _billingIdentity$zip : undefined
96
+
97
+ // first do an `update` mutation without any inputs, which will make sure
98
+ // the total has been calculated from the latest coupon data. if the total
99
+ // doesn't change, submit the payment
100
+ (0, _relayRuntime.commitMutation)(environment, {
101
+ mutation: updateOrderMutation,
102
+ variables: {
103
+ input: {}
104
+ },
105
+ onCompleted: (response, errors) => {
106
+ var _response$updateOrder, _response$updateOrder2, _response$updateOrder3, _stripe, _billingIdentity$stre, _billingIdentity$stre2, _billingIdentity$stre3, _billingIdentity$loca, _billingIdentity$admi, _billingIdentity$zip;
107
+ if (errors && errors.length > 0) {
108
+ setCompleting(false);
109
+ setError(errors[0].message);
110
+ scrollToTop === null || scrollToTop === void 0 ? void 0 : scrollToTop();
111
+ return;
112
+ }
113
+ const newTotal = (_response$updateOrder = response.updateOrder) === null || _response$updateOrder === void 0 ? void 0 : (_response$updateOrder2 = _response$updateOrder.order) === null || _response$updateOrder2 === void 0 ? void 0 : (_response$updateOrder3 = _response$updateOrder2.total) === null || _response$updateOrder3 === void 0 ? void 0 : _response$updateOrder3.amount;
114
+ if (newTotal !== lastShownTotal.current) {
115
+ var _response$updateOrder4, _response$updateOrder5, _response$updateOrder6;
116
+ setCompleting(false);
117
+ setError('Order total has updated. Please review and confirm again.');
118
+ scrollToTop === null || scrollToTop === void 0 ? void 0 : scrollToTop();
119
+ lastShownTotal.current = (_response$updateOrder4 = response.updateOrder) === null || _response$updateOrder4 === void 0 ? void 0 : (_response$updateOrder5 = _response$updateOrder4.order) === null || _response$updateOrder5 === void 0 ? void 0 : (_response$updateOrder6 = _response$updateOrder5.total) === null || _response$updateOrder6 === void 0 ? void 0 : _response$updateOrder6.amount;
120
+ return;
121
+ }
122
+ if (!stripe || !elements) return;
123
+ (_stripe = stripe) === null || _stripe === void 0 ? void 0 : _stripe.confirmPayment({
124
+ elements,
125
+ confirmParams: {
126
+ return_url: order.completeUrl,
127
+ payment_method_data: {
128
+ billing_details: {
129
+ email: billingIdentity.email,
130
+ name: billingIdentity.name,
131
+ address: {
132
+ line1: (_billingIdentity$stre = billingIdentity.street) === null || _billingIdentity$stre === void 0 ? void 0 : _billingIdentity$stre.split(/\n/)[0],
133
+ line2: (_billingIdentity$stre2 = (_billingIdentity$stre3 = billingIdentity.street) === null || _billingIdentity$stre3 === void 0 ? void 0 : _billingIdentity$stre3.split(/\n/)[1]) !== null && _billingIdentity$stre2 !== void 0 ? _billingIdentity$stre2 : '',
134
+ city: (_billingIdentity$loca = billingIdentity.locality) !== null && _billingIdentity$loca !== void 0 ? _billingIdentity$loca : '',
135
+ state: (_billingIdentity$admi = billingIdentity.administrativeArea) !== null && _billingIdentity$admi !== void 0 ? _billingIdentity$admi : '',
136
+ country: billingIdentity.country,
137
+ postal_code: (_billingIdentity$zip = billingIdentity.zip) !== null && _billingIdentity$zip !== void 0 ? _billingIdentity$zip : undefined
138
+ }
139
+ }
106
140
  }
107
141
  }
108
- }
109
- }
110
- }).then(result => {
111
- if ('error' in result) {
112
- setCompleting(false);
142
+ }).then(result => {
143
+ if ('error' in result) {
144
+ var _result$error$message;
145
+ setCompleting(false);
146
+ setError((_result$error$message = result.error.message) !== null && _result$error$message !== void 0 ? _result$error$message : 'Payment failed. Please try another payment method.');
147
+ scrollToTop === null || scrollToTop === void 0 ? void 0 : scrollToTop();
148
+ }
149
+ }).catch(error => {
150
+ console.log(error);
151
+ setCompleting(false);
152
+ });
113
153
  }
114
- }).catch(error => {
115
- console.log(error);
116
- setCompleting(false);
117
154
  });
118
155
  };
119
156
  const handleClickSection = step => {
@@ -138,7 +175,7 @@ const StoreModalReview = _ref => {
138
175
  }) : order.licenseeIdentity && /*#__PURE__*/_react.default.createElement(_StoreModalReviewIdentity.default, {
139
176
  identity: order.licenseeIdentity
140
177
  }),
141
- payment: /*#__PURE__*/_react.default.createElement(_reactStripeJs.PaymentElement, {
178
+ payment: stripe && elements && /*#__PURE__*/_react.default.createElement(_reactStripeJs.PaymentElement, {
142
179
  options: {
143
180
  fields: {
144
181
  billingDetails: {
@@ -162,14 +199,14 @@ const StoreModalReview = _ref => {
162
199
  confirm: /*#__PURE__*/_react.default.createElement(_StoreModalReviewConfirm.default, {
163
200
  onSubmit: handleSubmit,
164
201
  submitting: completing,
165
- disabled: !stripe || !elements
202
+ disabled: order.canCompleteWithCoupon ? false : !stripe || !elements
166
203
  }, {
167
204
  eulaText: /*#__PURE__*/_react.default.createElement("div", {
168
205
  dangerouslySetInnerHTML: {
169
206
  __html: (_viewer$settings$eula = (_viewer$settings = viewer.settings) === null || _viewer$settings === void 0 ? void 0 : _viewer$settings.eulaAgreementLabel) !== null && _viewer$settings$eula !== void 0 ? _viewer$settings$eula : ''
170
207
  }
171
208
  }),
172
- submitText: completing ? 'Submitting...' : 'Confirm purchase'
209
+ submitText: completing ? 'Submitting...' : order.canCompleteWithCoupon ? 'Confirm order' : 'Confirm purchase'
173
210
  })
174
211
  })
175
212
  });
@@ -24,6 +24,9 @@ const StripeProvider = _ref => {
24
24
  const stripePromiseRef = (0, _react.useRef)(stripeKey ? (0, _stripeJs.loadStripe)(stripeKey) : null);
25
25
  const cssSrc = (_data$settings = data.settings) === null || _data$settings === void 0 ? void 0 : _data$settings.uiFontUrl;
26
26
  const clientSecret = (_data$currentOrder$st = (_data$currentOrder = data.currentOrder) === null || _data$currentOrder === void 0 ? void 0 : (_data$currentOrder$st2 = _data$currentOrder.stripePaymentIntent) === null || _data$currentOrder$st2 === void 0 ? void 0 : _data$currentOrder$st2.clientSecret) !== null && _data$currentOrder$st !== void 0 ? _data$currentOrder$st : undefined;
27
+
28
+ // the stripe provider may not be rendered, so we have to conditonally call
29
+ // useStripe down in the children
27
30
  if (requireClientSecret && !clientSecret) return children;
28
31
 
29
32
  // stripe validates that the strings match this pattern and throws an error
@@ -43,7 +43,7 @@ const StoreModalReviewLayout = _ref => {
43
43
  onClick: () => onClickSection(_CheckoutSteps.default.Licensee)
44
44
  }, /*#__PURE__*/_react.default.createElement("h2", {
45
45
  className: "store-modal__review__heading"
46
- }, "Licensee information"), /*#__PURE__*/_react.default.createElement("div", null, licensee)), /*#__PURE__*/_react.default.createElement("div", {
46
+ }, "Licensee information"), /*#__PURE__*/_react.default.createElement("div", null, licensee)), payment && /*#__PURE__*/_react.default.createElement("div", {
47
47
  className: "store-modal__review__section"
48
48
  }, /*#__PURE__*/_react.default.createElement("h2", {
49
49
  className: "store-modal__review__heading"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "1.11.0-alpha6",
3
+ "version": "1.11.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "npm run relay && run-p build-js build-css build-ts-declarations",