@dintero/checkout-web-sdk 0.0.14 → 0.2.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 (46) hide show
  1. package/.babelrc +3 -0
  2. package/.github/dependabot.yml +10 -0
  3. package/.github/workflows/build.yml +25 -0
  4. package/.github/workflows/release.yml +34 -0
  5. package/.releaserc.json +11 -0
  6. package/CHANGELOG.md +22 -4
  7. package/LISENCE +20 -0
  8. package/README.md +78 -22
  9. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/base.css +224 -0
  10. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/block-navigation.js +79 -0
  11. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/checkout.ts.html +377 -0
  12. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/createIframeAsync.ts.html +254 -0
  13. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/favicon.png +0 -0
  14. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/index.html +171 -0
  15. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/index.ts.html +1103 -0
  16. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/prettify.css +1 -0
  17. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/prettify.js +2 -0
  18. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/sort-arrow-sprite.png +0 -0
  19. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/sorter.js +170 -0
  20. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/subscribe.ts.html +443 -0
  21. package/coverage/Chrome Headless 80.0.3987.0 (Linux x86_64)/html/url.ts.html +185 -0
  22. package/dist/declarations/package.d.ts +52 -0
  23. package/dist/{src → declarations}/src/checkout.d.ts +18 -2
  24. package/dist/{src → declarations}/src/createIframeAsync.d.ts +0 -0
  25. package/dist/{src/src/dintero-checkout-web-sdk.d.ts → declarations/src/index.d.ts} +7 -1
  26. package/dist/declarations/src/session.d.ts +953 -0
  27. package/dist/declarations/src/subscribe.d.ts +41 -0
  28. package/dist/{src → declarations}/src/url.d.ts +1 -0
  29. package/dist/dintero-checkout-web-sdk.cjs.d.ts +1 -0
  30. package/dist/dintero-checkout-web-sdk.cjs.dev.js +469 -0
  31. package/dist/dintero-checkout-web-sdk.cjs.js +7 -0
  32. package/dist/dintero-checkout-web-sdk.cjs.prod.js +469 -0
  33. package/dist/dintero-checkout-web-sdk.esm.js +464 -0
  34. package/dist/dintero-checkout-web-sdk.umd.min.js +7 -0
  35. package/dist/dintero-checkout-web-sdk.umd.min.js.map +1 -0
  36. package/karma.conf.js +33 -0
  37. package/package.json +49 -43
  38. package/dist/checkout-web-sdk.js +0 -2
  39. package/dist/checkout-web-sdk.js.map +0 -1
  40. package/dist/checkout-web-sdk.js.mjs +0 -2
  41. package/dist/checkout-web-sdk.js.mjs.map +0 -1
  42. package/dist/checkout-web-sdk.modern.js +0 -2
  43. package/dist/checkout-web-sdk.modern.js.map +0 -1
  44. package/dist/checkout-web-sdk.umd.js +0 -2
  45. package/dist/checkout-web-sdk.umd.js.map +0 -1
  46. package/dist/src/src/subscribe.d.ts +0 -25
@@ -0,0 +1,953 @@
1
+ export interface Address {
2
+ /**
3
+ * example:
4
+ * Sommerkroveien 34
5
+ */
6
+ address_line: string;
7
+ /**
8
+ * example:
9
+ * PB 123
10
+ */
11
+ address_line_2?: string;
12
+ /**
13
+ * example:
14
+ * 4515
15
+ */
16
+ postal_code?: string;
17
+ /**
18
+ * example:
19
+ * Oslo
20
+ */
21
+ postal_place: string;
22
+ /**
23
+ * ISO 3166-1 country code
24
+ *
25
+ * example:
26
+ * NO
27
+ */
28
+ country: string; // iso-3166-1
29
+ }
30
+ export interface Store {
31
+ /**
32
+ * example:
33
+ * sc029
34
+ */
35
+ id: string;
36
+ /**
37
+ * name of the store, aka trade name of the store
38
+ *
39
+ * example:
40
+ * SC Oslo
41
+ */
42
+ name?: string;
43
+ /**
44
+ * Official name of the person or entity that owns the store.
45
+ *
46
+ * example:
47
+ * SC Oslo AS
48
+ */
49
+ business_name?: string;
50
+ address?: Address;
51
+ /**
52
+ * example:
53
+ * SuperChain
54
+ */
55
+ chain?: string;
56
+ /**
57
+ * example:
58
+ * contact@superchain.com
59
+ */
60
+ email?: string;
61
+ /**
62
+ * example:
63
+ * 5790001398644
64
+ */
65
+ gln?: string;
66
+ /**
67
+ * example:
68
+ * 123456789MVA
69
+ */
70
+ organization_number?: string;
71
+ /**
72
+ * example:
73
+ * +4738260107
74
+ */
75
+ phone_number?: string;
76
+ /**
77
+ * A four-digit Merchant Category Code (MCC) for the store
78
+ * [ISO 18245:2003](https://www.iso.org/standard/33365.html)
79
+ *
80
+ * example:
81
+ * 5814
82
+ */
83
+ mcc?: string; // iso-18245
84
+ /**
85
+ * Merchant number associated with the stores
86
+ * payment terminal
87
+ *
88
+ * example:
89
+ * 102603
90
+ */
91
+ bax?: string;
92
+ /**
93
+ * Id to a specific point-of-sale (POS) terminal
94
+ * or workstation
95
+ *
96
+ * example:
97
+ * T0292
98
+ */
99
+ terminal_id?: string;
100
+ }
101
+ export interface ShippingOption {
102
+ /**
103
+ * Id of this shipping option product.
104
+ *
105
+ * The express checkout will group all products with the same id. Used for
106
+ * grouping delivery to the same address at different time slots, or for
107
+ * grouping deliveries to different pick up points.
108
+ *
109
+ * example:
110
+ * bring-pick-up-00001
111
+ */
112
+ id: string;
113
+ /**
114
+ * Unique id of the specific configuration of this shipping product
115
+ *
116
+ * example:
117
+ * bring-pick-up-00001-location-0a1f6b
118
+ */
119
+ line_id: string;
120
+ /**
121
+ * Countries where this shipping option can be used
122
+ */
123
+ countries?: string /* iso3166-alpha2 */[];
124
+ /**
125
+ * The monetary amount of the shipping option
126
+ *
127
+ * example:
128
+ * 3900
129
+ */
130
+ amount: number;
131
+ /**
132
+ * The VAT of the `amount` parameter. Only
133
+ * used for display purposes.
134
+ *
135
+ * example:
136
+ * 975
137
+ */
138
+ vat_amount?: number;
139
+ /**
140
+ * The VAT percentage
141
+ *
142
+ * example:
143
+ * 25
144
+ */
145
+ vat?: number;
146
+ /**
147
+ * A shipping option title. Eg. "Standard"
148
+ *
149
+ * example:
150
+ * Standard
151
+ */
152
+ title: string;
153
+ /**
154
+ * A short description of the shipping option product
155
+ *
156
+ * example:
157
+ * Pick up at your nearest postal office
158
+ */
159
+ description?: string;
160
+ /**
161
+ * example:
162
+ * pick_up
163
+ */
164
+ delivery_method?: "delivery" | "pick_up" | "none";
165
+ /**
166
+ * Name of company that provides shipping service
167
+ *
168
+ * example:
169
+ * Bring
170
+ */
171
+ operator: string;
172
+ /**
173
+ * The operators own id for this shipping product
174
+ *
175
+ * example:
176
+ * pick-up-00001-location-0a1f6b
177
+ */
178
+ operator_product_id?: string;
179
+ /**
180
+ * Estimated time of arrival
181
+ */
182
+ eta?: {
183
+ /**
184
+ * example:
185
+ * 2020-10-14T19:00:00Z
186
+ */
187
+ starts_at?: string; // date-time
188
+ /**
189
+ * example:
190
+ * 2020-10-14T20:00:00Z
191
+ */
192
+ ends_at?: string; // date-time
193
+ };
194
+ /**
195
+ * A specified time for delivery to customer
196
+ */
197
+ time_slot?: {
198
+ /**
199
+ * example:
200
+ * 2020-10-14T19:00:00Z
201
+ */
202
+ starts_at?: string; // date-time
203
+ /**
204
+ * example:
205
+ * 2020-10-14T20:00:00Z
206
+ */
207
+ ends_at?: string; // date-time
208
+ };
209
+ /**
210
+ * Address
211
+ */
212
+ pick_up_address?: {
213
+ /**
214
+ * example:
215
+ * John
216
+ */
217
+ first_name?: string;
218
+ /**
219
+ * example:
220
+ * Doe
221
+ */
222
+ last_name?: string;
223
+ /**
224
+ * Gaustadalleen 21
225
+ */
226
+ address_line?: string;
227
+ /**
228
+ * PB 123
229
+ */
230
+ address_line_2?: string;
231
+ /**
232
+ * example:
233
+ * Land Lord
234
+ */
235
+ co_address?: string;
236
+ /**
237
+ * Name of the company
238
+ */
239
+ business_name?: string;
240
+ /**
241
+ * The zip code / postal code of the address.
242
+ * example:
243
+ * O349
244
+ */
245
+ postal_code?: string;
246
+ /**
247
+ * The name of the postal code
248
+ * example:
249
+ * Oslo
250
+ */
251
+ postal_place?: string;
252
+ /**
253
+ * Country of the location
254
+ * example:
255
+ * NO
256
+ */
257
+ country?: string; // iso3166-alpha2
258
+ /**
259
+ * mobile number of a person / company, ITU/E.123 format with
260
+ * international prefix (+PPNNNNNNNNN...)
261
+ *
262
+ */
263
+ phone_number?: string; // ^\+?\d{5,15}$
264
+ /**
265
+ * The email address of a person or an organization
266
+ *
267
+ */
268
+ email?: string;
269
+ latitude?: number;
270
+ longitude?: number;
271
+ /**
272
+ * Comment about the address
273
+ *
274
+ */
275
+ comment?: string;
276
+ /**
277
+ * Distance in kilometers from the shipping_address.
278
+ *
279
+ */
280
+ distance?: number;
281
+ };
282
+ }
283
+ /**
284
+ * Address in an Order
285
+ */
286
+ export interface OrderAddress {
287
+ /**
288
+ * example:
289
+ * John
290
+ */
291
+ first_name?: string;
292
+ /**
293
+ * example:
294
+ * Doe
295
+ */
296
+ last_name?: string;
297
+ /**
298
+ * Gaustadalleen 21
299
+ */
300
+ address_line?: string;
301
+ /**
302
+ * PB 123
303
+ */
304
+ address_line_2?: string;
305
+ /**
306
+ * example:
307
+ * Land Lord
308
+ */
309
+ co_address?: string;
310
+ /**
311
+ * Name of the company
312
+ */
313
+ business_name?: string;
314
+ /**
315
+ * The zip code / postal code of the address.
316
+ * example:
317
+ * O349
318
+ */
319
+ postal_code?: string;
320
+ /**
321
+ * The name of the postal code
322
+ * example:
323
+ * Oslo
324
+ */
325
+ postal_place?: string;
326
+ /**
327
+ * Country of the location
328
+ * example:
329
+ * NO
330
+ */
331
+ country?: string; // iso3166-alpha2
332
+ /**
333
+ * mobile number of a person / company, ITU/E.123 format with
334
+ * international prefix (+PPNNNNNNNNN...)
335
+ *
336
+ */
337
+ phone_number?: string; // ^\+?\d{5,15}$
338
+ /**
339
+ * The email address of a person or an organization
340
+ *
341
+ */
342
+ email?: string;
343
+ latitude?: number;
344
+ longitude?: number;
345
+ /**
346
+ * Comment about the address
347
+ *
348
+ */
349
+ comment?: string;
350
+ }
351
+ export interface DiscountItem {
352
+ /**
353
+ * Monetary amount in smallest unit for the currency
354
+ *
355
+ * example:
356
+ * 23130
357
+ */
358
+ amount?: number;
359
+ /**
360
+ * Optional, set if the amount given was from a percentage discount
361
+ *
362
+ * example:
363
+ * 10
364
+ */
365
+ percentage?: number;
366
+ discount_type?:
367
+ | "customer"
368
+ | "periodic"
369
+ | "manual"
370
+ | "loyalty"
371
+ | "total"
372
+ | "employee"
373
+ | "external";
374
+ /**
375
+ * example:
376
+ * 766da0ef-9283-42bd-b012-0582344ec53c
377
+ */
378
+ discount_id?: string;
379
+ description?: string;
380
+ /**
381
+ * example:
382
+ * 1
383
+ */
384
+ line_id?: number;
385
+ }
386
+ /**
387
+ * Publish checkout message to the customer.
388
+ *
389
+ */
390
+ export type PublishConfiguration = {
391
+ channel: "sms" | "push";
392
+ type: "checkout-link" | "app";
393
+ readonly id?: string;
394
+ /**
395
+ * status of the message sent to the customer.
396
+ *
397
+ * **`skipped`** will used in case where publish
398
+ * cannot be sent given the `session.customer`.
399
+ *
400
+ */
401
+ readonly status?: "sent" | "skipped" | "failed";
402
+ }[];
403
+ export interface InstabankConfiguration {
404
+ /**
405
+ * finance payment
406
+ */
407
+ finance?: {
408
+ /**
409
+ * enable finance payment
410
+ */
411
+ enabled: boolean;
412
+ };
413
+ /**
414
+ * invoice payment
415
+ */
416
+ invoice?: {
417
+ /**
418
+ * enable invoice payment (only for amounts greater than 500 NOK)
419
+ */
420
+ enabled: boolean;
421
+ };
422
+ }
423
+ export interface VippsConfiguration {
424
+ /**
425
+ * enable vipps payment
426
+ */
427
+ enabled: boolean;
428
+ /**
429
+ * A short reference / descriptor that can be displayed to
430
+ * the end user
431
+ *
432
+ */
433
+ dynamic_descriptor?: string;
434
+ }
435
+ export interface CollectorConfiguration {
436
+ /**
437
+ * A textual description max 40 characters of the purchase.
438
+ *
439
+ */
440
+ dynamic_descriptor?: string;
441
+ invoice?: {
442
+ /**
443
+ * enable Collector Bank Invoice Payment
444
+ */
445
+ enabled: boolean;
446
+ };
447
+ finance?: {
448
+ /**
449
+ * enable Collector Bank Finance Payment
450
+ */
451
+ enabled: boolean;
452
+ };
453
+ }
454
+ export interface SantanderConfiguration {
455
+ /**
456
+ * Denotes what kind of config parameter this is
457
+ */
458
+ type?: "payment_type";
459
+ debit_account?: {
460
+ /**
461
+ * Denotes what kind of config parameter this is
462
+ */
463
+ type?: "payment_product_type";
464
+ /**
465
+ * enable Santander Finance Debit Account
466
+ */
467
+ enabled: boolean;
468
+ /**
469
+ * The name of the chain
470
+ */
471
+ branding_name?: string;
472
+ /**
473
+ * Debit accounts belonging to the customer's phone number
474
+ */
475
+ accounts?: {
476
+ /**
477
+ * Token to represent the account number
478
+ */
479
+ account_number_token?: string;
480
+ /**
481
+ * Representation of the account number for display purposes
482
+ */
483
+ masked_account_number?: string;
484
+ }[];
485
+ };
486
+ }
487
+ export interface PayExConfiguration {
488
+ /**
489
+ * A textual description max 40 characters of the purchase.
490
+ *
491
+ */
492
+ dynamic_descriptor?: string;
493
+ swish?: {
494
+ /**
495
+ * enable Payex Swish Payment
496
+ */
497
+ enabled: boolean;
498
+ };
499
+ creditcard?: {
500
+ /**
501
+ * enable Credit Card Payment
502
+ */
503
+ enabled: boolean;
504
+ };
505
+ }
506
+ export interface Session {
507
+ url: {
508
+ /**
509
+ * URL to page where Checkout will redirect the
510
+ * customer to after the Checkout process has ended.
511
+ *
512
+ * If a transaction was completed successfully, a `transaction_id`
513
+ * will be appended to the URL as a `query` string parameter
514
+ *
515
+ * > A `transaction_id` will be appended to the URL if the
516
+ * > Checkout failed with `error=capture`
517
+ *
518
+ * *Example*:
519
+ *
520
+ * ```
521
+ * https://example.com/accept?transaction_id=T00000000.3YkJXSdSnUBXcmQSzn7uJj
522
+ * ```
523
+ *
524
+ * query name | type | description | required
525
+ * -------------- | :----------: | ----------- | :-----------:
526
+ * transaction_id | string | Transaction Id | false
527
+ * error | string | Error code identifying cause | false
528
+ * merchant_reference | string | The merchants reference | true
529
+ *
530
+ * In case of that something went wrong with the payment flow, an
531
+ * `error` query parameter will be appended to the URL. The value
532
+ * of the error is a code identifying the cause.
533
+ *
534
+ * error | Description
535
+ * ------------- | ------------
536
+ * cancelled | Customer cancelled the checkout payment
537
+ * authorization | Customer failed to authorize the payment
538
+ * capture | The transaction capture operation failed during auto-capture
539
+ * failed | The transaction has been rejected by us, or an error has occurred during transaction processing
540
+ *
541
+ * example:
542
+ * https://example.com/accept
543
+ */
544
+ return_url: string; // uri https?://*
545
+ /**
546
+ * URL that Checkout will call when the session
547
+ * payment is complete and the transaction has been authorized/captured.
548
+ *
549
+ * > A session with `auto_capture` enabled will only receive the call
550
+ * > when the transaction is captured.
551
+ *
552
+ * Unlike the `return_url` the `callback_url` is system-to-system
553
+ * which means delivery is guaranteed.
554
+ *
555
+ * Once a session payment is complete the callback_url is invoked as a
556
+ * `GET` request to notify your system that the payment has been approved.
557
+ *
558
+ * A successful delivery to an HTTP/HTTPS callback_url sometimes requires
559
+ * more than one attempt. This can be the case, for example, if the server
560
+ * hosting the callback_url is down for maintenance or is experiencing
561
+ * heavy traffic.
562
+ *
563
+ * Dintero attempts a retry only after a failed delivery attempt, following
564
+ * situations is considered as failed delivery
565
+ *
566
+ * - HTTP status code 100 to 101 and 500 to 599 (inclusive)
567
+ * (HTTP status code 400 to 499 is considered as permanent failure)
568
+ * - A request timeout (10 seconds)
569
+ * - Any connection error such as connection timeout, bad certificate, etc
570
+ *
571
+ * Failed delivery will be retried 20 times.
572
+ *
573
+ * query name | type | description | required
574
+ * ------------- | :-----------: | -----------: | :-----------:
575
+ * transaction_id | string | Transaction Id | true
576
+ * session_id | string   | Session Id | true
577
+ * merchant_reference | string | The merchants reference | true
578
+ * time | string | ISO 8601 format | true
579
+ *
580
+ * example:
581
+ * https://example.com/callback
582
+ */
583
+ callback_url?: string; // uri https?://*
584
+ };
585
+ customer?: {
586
+ /**
587
+ * Customer id
588
+ *
589
+ */
590
+ customer_id?: string;
591
+ /**
592
+ * Customer email address
593
+ *
594
+ * example:
595
+ * john.doe@example.com
596
+ */
597
+ email?: string;
598
+ /**
599
+ * Customer phone number, ITU/E.123 format with
600
+ * international prefix (+PPNNNNNNNNN...)
601
+ *
602
+ * example:
603
+ * +4799999999
604
+ */
605
+ phone_number?: string;
606
+ };
607
+ order: {
608
+ /**
609
+ * The amount to authorize/capture including VAT and discounts.
610
+ *
611
+ * example:
612
+ * 29990
613
+ */
614
+ amount: number;
615
+ /**
616
+ * The VAT of the `amount` parameter.
617
+ * Only used for display purposes.
618
+ *
619
+ * example:
620
+ * 6000
621
+ */
622
+ vat_amount?: number;
623
+ /**
624
+ * The three-character ISO-4217 currency. https://en.wikipedia.org/wiki/ISO_4217
625
+ * example:
626
+ * NOK
627
+ */
628
+ currency: string; // iso4217-code
629
+ /**
630
+ * A reference by the merchant to identify the corresponding
631
+ * order for the Checkout Session
632
+ *
633
+ */
634
+ merchant_reference: string;
635
+ shipping_address?: OrderAddress;
636
+ billing_address?: OrderAddress;
637
+ /**
638
+ * This is a partial payment where the `order.amount` can be lower or
639
+ * equal to the sum of `order.items.amount`
640
+ *
641
+ */
642
+ partial_payment?: boolean;
643
+ /**
644
+ * Details about the order items.
645
+ *
646
+ * #### Instabank
647
+ * `required` if Instabank payment is configured in and partial_payment is false.
648
+ * All items must include a unique `line_id`, quantity and amount
649
+ *
650
+ * #### Collector Bank
651
+ * `required` if Collector Bank payment is configured in and partial_payment is false.
652
+ * All items must include a unique `line_id`, quantity and amount
653
+ *
654
+ */
655
+ items?: {
656
+ /**
657
+ * The ID or SKU of the product on the line
658
+ *
659
+ * example:
660
+ * item_01
661
+ */
662
+ id?: string;
663
+ /**
664
+ * The groups the product on the line belongs to
665
+ *
666
+ * example:
667
+ * [object Object]
668
+ */
669
+ groups?: {
670
+ /**
671
+ * Group ID
672
+ */
673
+ id: string;
674
+ /**
675
+ * Group name
676
+ */
677
+ name?: string;
678
+ }[];
679
+ /**
680
+ * the number of the line (or id), must be `unique` between
681
+ * all items. `required` when Instabank payment is configured.
682
+ *
683
+ * example:
684
+ * 1
685
+ */
686
+ line_id?: string;
687
+ /**
688
+ * A short, localized description of the line item
689
+ *
690
+ * example:
691
+ * Stablestol
692
+ */
693
+ description?: string;
694
+ /**
695
+ * The quantity of the product in the item line.
696
+ *
697
+ * example:
698
+ * 1
699
+ */
700
+ quantity?: number;
701
+ /**
702
+ * The total monetary amount of the line item
703
+ *
704
+ * example:
705
+ * 29990
706
+ */
707
+ amount?: number;
708
+ /**
709
+ * The VAT of the `amount` parameter. Only
710
+ * used for display purposes.
711
+ *
712
+ * example:
713
+ * 6000
714
+ */
715
+ vat_amount?: number;
716
+ /**
717
+ * The VAT percentage
718
+ *
719
+ * example:
720
+ * 25
721
+ */
722
+ vat?: number;
723
+ /**
724
+ * The volume of one item in m³ (cubic meters)
725
+ *
726
+ */
727
+ unit_volume?: number;
728
+ /**
729
+ * The volume of one item in kg (kilo grams)
730
+ *
731
+ */
732
+ unit_weight?: number;
733
+ /**
734
+ * The dimensional weight (also known as volumetric) value unit of one item. [Dimensional weight at Wikipedia](https://en.wikipedia.org/wiki/Dimensional_weight)
735
+ *
736
+ */
737
+ unit_dimensional_weight?: number;
738
+ /**
739
+ * The item is eligible for discount
740
+ *
741
+ */
742
+ eligible_for_discount?: boolean;
743
+ /**
744
+ * Discount applied to amount
745
+ *
746
+ */
747
+ is_changed?: boolean;
748
+ /**
749
+ * The origin item amount before any discount
750
+ *
751
+ */
752
+ readonly gross_amount?: number;
753
+ discount_lines?: DiscountItem[];
754
+ }[];
755
+ /**
756
+ * The origin amount to authorize/capture including VAT
757
+ * before any discount, only set if the session was updated
758
+ * when calculating discounts.
759
+ *
760
+ */
761
+ readonly gross_amount?: number;
762
+ /**
763
+ * The original order amount was changed by discount
764
+ * given.
765
+ *
766
+ */
767
+ readonly is_changed?: boolean;
768
+ shipping_option?: ShippingOption;
769
+ store?: Store;
770
+ };
771
+ /**
772
+ * The session expiration time after which the
773
+ * Checkout page wouldn't be available
774
+ *
775
+ */
776
+ expires_at?: string; // date-time
777
+ /**
778
+ * ### Present only for _Express Checkout_ sessions.
779
+ *
780
+ * An _Express Checkout_ session is a session where the end user will submit a
781
+ * shipping address and then select a shipping option before the before a
782
+ * payment method is selected and the payment is initiated.
783
+ *
784
+ * Endpoints used in the _Express Checkout_ flow.
785
+ * 1. [Set shipping address](/#operation/checkout_sid_json_order_shipping_address_put)
786
+ * 2. [Set shipping option](/#operation/checkout_sid_json_order_items_shipping_option_put)
787
+ *
788
+ */
789
+ express?: {
790
+ /**
791
+ * URL that Checkout will POST to when the end user has submitted/changed
792
+ * a shipping address for an express-session.
793
+ *
794
+ * Dintero will not attempt a retry after a failed delivery attempt.
795
+ * Following situations is considered as failed delivery
796
+ *
797
+ * - HTTP status codes that are not 200.
798
+ * - A request timeout (60 seconds)
799
+ * - Any connection error such as connection timeout, bad certificate, etc
800
+ *
801
+ * The request body of the POST request will be the
802
+ * [ExpressSession]((https://docs.dintero.com/specs/spec-checkout.yml))
803
+ * json object, containing a shipping address.
804
+ *
805
+ * The expected response has status code 200 and the response body contains a json object with a list of [ShippingOptions](https://docs.dintero.com/specs/spec-checkout.yml) that will replace the _`shipping_options`_ in the express-session.
806
+ * If the merchant is not able to ship the order to the end users shipping address, return an object with an empty array of _`shipping_options`_.
807
+ *
808
+ * <strong><small>Example callback response body:</small></strong>
809
+ * <pre>
810
+ * {
811
+ * "shipping_options": [
812
+ * {
813
+ * "id": "bring-pick-up-00001",
814
+ * "line_id": "bring-pick-up-00001-location-0a1f6b",
815
+ * "country": "NO",
816
+ * "amount": 3900,
817
+ * "vat_amount": 975,
818
+ * "vat": 25,
819
+ * "title": "Standard",
820
+ * "description": "Pick up at your nearest postal office",
821
+ * "delivery_method": "pick_up",
822
+ * "operator": "Bring",
823
+ * "operator_product_id": "pick-up-00001-location-0a1f6b",
824
+ * "eta": {
825
+ * "relative": {
826
+ * "minutes_min": 0,
827
+ * "minutes_max": 0
828
+ * },
829
+ * "absolute": {
830
+ * "starts_at": "2020-10-14T19:00:00Z",
831
+ * "ends_at": "2020-10-14T20:00:00Z"
832
+ * }
833
+ * },
834
+ * "time_slot": {
835
+ * "starts_at": "2020-10-14T19:00:00Z",
836
+ * "ends_at": "2020-10-14T20:00:00Z"
837
+ * },
838
+ * "pick_up_address": {
839
+ * "first_name": "John",
840
+ * "last_name": "Doe",
841
+ * "address_line": "string",
842
+ * "address_line_2": "string",
843
+ * "co_address": "Land Lord",
844
+ * "business_name": "string",
845
+ * "postal_code": "O349",
846
+ * "postal_place": "Oslo",
847
+ * "country": "NO",
848
+ * "phone_number": "string",
849
+ * "email": "string",
850
+ * "latitude": 0,
851
+ * "longitude": 0,
852
+ * "comment": "string"
853
+ * }
854
+ * }
855
+ * ]
856
+ * }
857
+ * </pre>
858
+ *
859
+ * example:
860
+ * https://example.com/order/00128110/address_updated
861
+ */
862
+ shipping_address_callback_url?: string; // uri https?://*
863
+ /**
864
+ * Shipping options that will be presented to the end user after the
865
+ * end user has submitted a shipping address.
866
+ *
867
+ * To dynamically update the shipping_options when the _`order.shipping_address`_ is
868
+ * changed by the end user in the checkout, use the
869
+ * _`url.shipping_address_callback_url`_.
870
+ *
871
+ * If the merchant is not able to ship the order to the end users shipping address, use an empty array.
872
+ *
873
+ * If there is only one option, a free delivery, the order still has to contain one option with a _`price.amount`_ of 0.
874
+ *
875
+ */
876
+ shipping_options: ShippingOption[];
877
+ };
878
+ configuration: {
879
+ /**
880
+ * If `true` the transaction from the payment session will be captured
881
+ * automatically after the transaction has been `AUTHORIZED`. The checkout
882
+ * sessions `callback_url` will not be called until after the transaction
883
+ * has been `CAPTURED`.
884
+ *
885
+ * If `auto_capture` is not specified it defaults to `false`.
886
+ *
887
+ * A successful auto-capture of a transaction sometimes requires more
888
+ * than one capture attempt. This can be the case if the payment gateway
889
+ * is down or is experiencing heavy traffic.
890
+ *
891
+ * Dintero will attempts capture retries for 48 hours, the `callback_url`
892
+ * will be invoked when capture succeeds.
893
+ *
894
+ * Manual capture of a transaction that is pending auto-capture will
895
+ * stop the auto-capture process from completing the capture.
896
+ *
897
+ */
898
+ auto_capture?: boolean;
899
+ publish?: PublishConfiguration;
900
+ /**
901
+ * Configure the default payment type, the selected payment when
902
+ * loading the checkout window. The value must be an enabled payment type.
903
+ *
904
+ */
905
+ default_payment_type?:
906
+ | "instabank.finance"
907
+ | "instabank.invoice"
908
+ | "vipps"
909
+ | "payex.creditcard"
910
+ | "payex.swish"
911
+ | "collector.finance"
912
+ | "collector.invoice"
913
+ | "santander.debit_account";
914
+ instabank?: InstabankConfiguration;
915
+ payex?: PayExConfiguration;
916
+ vipps?: VippsConfiguration;
917
+ collector?: CollectorConfiguration;
918
+ santander?: SantanderConfiguration;
919
+ discounts?: {
920
+ readonly type?: "discounts";
921
+ /**
922
+ * Enable discount calculation on order
923
+ * items eligible for discount
924
+ *
925
+ * - A session that has the `customer.customer_id` set will have
926
+ * its discounts calculated when the session is created.
927
+ *
928
+ * - A session with no customer_id will only have the discounts
929
+ * calculated when the customer is identified by the checkout
930
+ * page.
931
+ *
932
+ * - The autorized amount will be the net amount from the
933
+ * original session amount specified when the session was
934
+ * created.
935
+ *
936
+ */
937
+ enabled: boolean;
938
+ };
939
+ };
940
+ /**
941
+ * The ID of the Checkout
942
+ */
943
+ id?: string;
944
+ /**
945
+ * Time when the Checkout was created
946
+ */
947
+ created_at?: string; // date-time
948
+ /**
949
+ * Last time when the Checkout was updated
950
+ */
951
+
952
+ transaction_id?: string;
953
+ }