@rebilly/instruments 2.0.0-beta → 3.0.1-beta.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 (197) hide show
  1. package/dist/events/index.js +2 -1
  2. package/dist/functions/mount/fetch-data.js +187 -0
  3. package/dist/functions/mount/fetch-data.spec.js +189 -0
  4. package/dist/functions/mount/index.js +132 -164
  5. package/dist/functions/mount/mount.spec.js +2 -4
  6. package/dist/functions/mount/setup-element.js +40 -0
  7. package/dist/functions/mount/setup-framepay-theme.js +95 -0
  8. package/dist/functions/mount/setup-framepay.js +5 -1
  9. package/dist/functions/mount/setup-i18n.js +33 -0
  10. package/dist/functions/mount/setup-options.js +68 -47
  11. package/dist/functions/mount/setup-options.spec.js +66 -0
  12. package/dist/functions/mount/setup-storefront.js +6 -4
  13. package/dist/functions/mount/setup-styles.js +4 -2
  14. package/dist/functions/purchase.js +129 -24
  15. package/dist/functions/purchase.spec.js +13 -10
  16. package/dist/functions/setup.js +85 -0
  17. package/dist/functions/setup.spec.js +87 -0
  18. package/dist/functions/show.js +8 -4
  19. package/dist/functions/show.spec.js +9 -5
  20. package/dist/functions/update.js +39 -24
  21. package/dist/functions/update.spec.js +0 -4
  22. package/dist/i18n/en.json +5 -2
  23. package/dist/i18n/es.json +4 -1
  24. package/dist/index.js +17 -3
  25. package/dist/index.spec.js +3 -16
  26. package/dist/loader/index.js +4 -3
  27. package/dist/storefront/index.js +33 -0
  28. package/dist/storefront/invoices.js +27 -0
  29. package/dist/storefront/models/base-model.js +18 -0
  30. package/dist/storefront/models/invoice-model.js +14 -0
  31. package/dist/storefront/models/plan-model.js +4 -35
  32. package/dist/storefront/models/product-model.js +4 -23
  33. package/dist/storefront/models/summary-model.js +12 -25
  34. package/dist/storefront/models/transaction-model.js +31 -0
  35. package/dist/storefront/payment-instruments.js +47 -0
  36. package/dist/storefront/payment-instruments.spec.js +55 -0
  37. package/dist/storefront/plans.js +10 -18
  38. package/dist/storefront/plans.spec.js +3 -13
  39. package/dist/storefront/products.js +10 -13
  40. package/dist/storefront/products.spec.js +12 -19
  41. package/dist/storefront/purchase.js +23 -12
  42. package/dist/storefront/purchase.spec.js +1 -20
  43. package/dist/storefront/ready-to-pay.js +18 -15
  44. package/dist/storefront/ready-to-pay.spec.js +2 -12
  45. package/dist/storefront/summary.js +21 -17
  46. package/dist/storefront/summary.spec.js +4 -15
  47. package/dist/storefront/transactions.js +27 -0
  48. package/dist/style/base/__snapshots__/theme.spec.js.snap +188 -45
  49. package/dist/style/base/default-theme.js +699 -0
  50. package/dist/style/base/index.js +48 -16
  51. package/dist/style/base/theme.js +16 -48
  52. package/dist/style/base/theme.spec.js +4 -15
  53. package/dist/style/components/address.js +3 -3
  54. package/dist/style/components/button.js +32 -22
  55. package/dist/style/components/divider.js +9 -9
  56. package/dist/style/components/forms/checkbox.js +12 -9
  57. package/dist/style/components/forms/field.js +18 -6
  58. package/dist/style/components/forms/form.js +2 -2
  59. package/dist/style/components/forms/input.js +54 -13
  60. package/dist/style/components/forms/label.js +39 -18
  61. package/dist/style/components/forms/select.js +54 -22
  62. package/dist/style/components/forms/validation.js +53 -6
  63. package/dist/style/components/icons.js +4 -4
  64. package/dist/style/components/loader.js +5 -3
  65. package/dist/style/components/methods.js +18 -15
  66. package/dist/style/components/overlay.js +5 -5
  67. package/dist/style/helpers/index.js +46 -46
  68. package/dist/style/index.js +3 -1
  69. package/dist/style/payment-instruments/payment-card.js +4 -4
  70. package/dist/style/utils/border.js +47 -0
  71. package/dist/style/utils/color-values.js +39 -3
  72. package/dist/style/utils/remove-empty-null.js +20 -0
  73. package/dist/style/vendor/framepay.js +11 -8
  74. package/dist/style/vendor/postmate.js +2 -2
  75. package/dist/style/views/confirmation.js +13 -13
  76. package/dist/style/views/method-selector.js +2 -2
  77. package/dist/style/views/modal.js +6 -6
  78. package/dist/style/views/result.js +4 -4
  79. package/dist/style/views/summary.js +26 -22
  80. package/dist/views/__snapshots__/summary.spec.js.snap +77 -119
  81. package/dist/views/common/iframe/base-iframe.js +2 -0
  82. package/dist/views/common/iframe/modal-iframe.js +50 -4
  83. package/dist/views/confirmation.js +19 -8
  84. package/dist/views/method-selector/generate-digital-wallet.js +12 -3
  85. package/dist/views/method-selector/generate-digital-wallet.spec.js +11 -0
  86. package/dist/views/method-selector/get-payment-methods.js +13 -2
  87. package/dist/views/method-selector/get-payment-methods.spec.js +21 -19
  88. package/dist/views/method-selector/index.js +23 -34
  89. package/dist/views/method-selector/method-selector.spec.js +50 -55
  90. package/dist/views/method-selector/mount-methods.js +5 -8
  91. package/dist/views/modal.js +8 -2
  92. package/dist/views/result.js +3 -4
  93. package/dist/views/summary.js +156 -97
  94. package/dist/views/summary.spec.js +53 -58
  95. package/package.json +4 -2
  96. package/src/events/index.js +2 -1
  97. package/src/functions/mount/fetch-data.js +152 -0
  98. package/src/functions/mount/fetch-data.spec.js +238 -0
  99. package/src/functions/mount/index.js +101 -158
  100. package/src/functions/mount/mount.spec.js +3 -5
  101. package/src/functions/mount/setup-element.js +26 -0
  102. package/src/functions/mount/setup-framepay-theme.js +82 -0
  103. package/src/functions/mount/setup-framepay.js +5 -1
  104. package/src/functions/mount/setup-i18n.js +19 -0
  105. package/src/functions/mount/setup-options.js +78 -48
  106. package/src/functions/mount/setup-options.spec.js +60 -0
  107. package/src/functions/mount/setup-storefront.js +6 -4
  108. package/src/functions/mount/setup-styles.js +4 -2
  109. package/src/functions/on.spec.js +1 -1
  110. package/src/functions/purchase.js +99 -23
  111. package/src/functions/purchase.spec.js +10 -10
  112. package/src/functions/setup.js +48 -0
  113. package/src/functions/setup.spec.js +98 -0
  114. package/src/functions/show.js +2 -4
  115. package/src/functions/show.spec.js +3 -4
  116. package/src/functions/update.js +40 -25
  117. package/src/functions/update.spec.js +0 -4
  118. package/src/i18n/en.json +5 -2
  119. package/src/i18n/es.json +4 -1
  120. package/src/index.js +9 -3
  121. package/src/index.spec.js +3 -21
  122. package/src/loader/index.js +3 -3
  123. package/src/storefront/index.js +28 -0
  124. package/src/storefront/invoices.js +11 -0
  125. package/src/storefront/models/base-model.js +10 -0
  126. package/src/storefront/models/invoice-model.js +3 -0
  127. package/src/storefront/models/plan-model.js +3 -35
  128. package/src/storefront/models/product-model.js +3 -23
  129. package/src/storefront/models/summary-model.js +12 -19
  130. package/src/storefront/models/transaction-model.js +19 -0
  131. package/src/storefront/payment-instruments.js +30 -0
  132. package/src/storefront/payment-instruments.spec.js +69 -0
  133. package/src/storefront/plans.js +6 -17
  134. package/src/storefront/plans.spec.js +4 -11
  135. package/src/storefront/products.js +8 -16
  136. package/src/storefront/products.spec.js +16 -22
  137. package/src/storefront/purchase.js +14 -16
  138. package/src/storefront/purchase.spec.js +2 -14
  139. package/src/storefront/ready-to-pay.js +13 -16
  140. package/src/storefront/ready-to-pay.spec.js +3 -10
  141. package/src/storefront/summary.js +19 -17
  142. package/src/storefront/summary.spec.js +5 -12
  143. package/src/storefront/transactions.js +11 -0
  144. package/src/style/base/__snapshots__/theme.spec.js.snap +188 -45
  145. package/src/style/base/default-theme.js +674 -0
  146. package/src/style/base/index.js +48 -16
  147. package/src/style/base/theme.js +17 -47
  148. package/src/style/base/theme.spec.js +4 -16
  149. package/src/style/components/address.js +3 -3
  150. package/src/style/components/button.js +32 -24
  151. package/src/style/components/divider.js +9 -9
  152. package/src/style/components/forms/checkbox.js +11 -11
  153. package/src/style/components/forms/field.js +18 -6
  154. package/src/style/components/forms/form.js +2 -2
  155. package/src/style/components/forms/input.js +54 -13
  156. package/src/style/components/forms/label.js +39 -18
  157. package/src/style/components/forms/select.js +54 -22
  158. package/src/style/components/forms/validation.js +53 -6
  159. package/src/style/components/icons.js +4 -4
  160. package/src/style/components/loader.js +4 -5
  161. package/src/style/components/methods.js +18 -15
  162. package/src/style/components/overlay.js +5 -5
  163. package/src/style/helpers/index.js +46 -46
  164. package/src/style/index.js +2 -1
  165. package/src/style/payment-instruments/payment-card.js +4 -4
  166. package/src/style/utils/border.js +34 -0
  167. package/src/style/utils/color-values.js +27 -1
  168. package/src/style/utils/remove-empty-null.js +10 -0
  169. package/src/style/vendor/framepay.js +11 -8
  170. package/src/style/vendor/postmate.js +2 -2
  171. package/src/style/views/confirmation.js +13 -13
  172. package/src/style/views/method-selector.js +2 -2
  173. package/src/style/views/modal.js +6 -6
  174. package/src/style/views/result.js +4 -4
  175. package/src/style/views/summary.js +26 -22
  176. package/src/views/__snapshots__/summary.spec.js.snap +77 -119
  177. package/src/views/common/iframe/base-iframe.js +2 -0
  178. package/src/views/common/iframe/modal-iframe.js +45 -3
  179. package/src/views/confirmation.js +15 -5
  180. package/src/views/method-selector/generate-digital-wallet.js +10 -3
  181. package/src/views/method-selector/generate-digital-wallet.spec.js +10 -0
  182. package/src/views/method-selector/get-payment-methods.js +7 -2
  183. package/src/views/method-selector/get-payment-methods.spec.js +26 -23
  184. package/src/views/method-selector/index.js +21 -28
  185. package/src/views/method-selector/method-selector.spec.js +49 -64
  186. package/src/views/method-selector/mount-methods.js +5 -8
  187. package/src/views/modal.js +6 -2
  188. package/src/views/result.js +4 -3
  189. package/src/views/summary.js +161 -117
  190. package/src/views/summary.spec.js +60 -75
  191. package/tests/mocks/rebilly-instruments-mock.js +37 -7
  192. package/tests/mocks/storefront-api-mock.js +8 -0
  193. package/tests/mocks/storefront-mock.js +17 -0
  194. package/dist/functions/mount/fetch-summary-data.js +0 -46
  195. package/dist/functions/mount/fetch-summary-data.spec.js +0 -43
  196. package/src/functions/mount/fetch-summary-data.js +0 -29
  197. package/src/functions/mount/fetch-summary-data.spec.js +0 -40
@@ -1,7 +1,7 @@
1
1
  // -----------------------------------------------------------------------------
2
2
  // This file contains all styles related to the confirmation view.
3
3
  // -----------------------------------------------------------------------------
4
- export const confirmation = (theme) => `
4
+ export const confirmation = () => `
5
5
  /**
6
6
  * Confirmation
7
7
  */
@@ -11,8 +11,8 @@ export const confirmation = (theme) => `
11
11
 
12
12
  .rebilly-instruments-confirmation-go-back-link {
13
13
  display: inline-block;
14
- margin-bottom: ${theme.space.m};
15
- margin-left: -${theme.space.xs};
14
+ margin-bottom: var(--rebilly-spacings-base);
15
+ margin-left: calc(var(--rebilly-spacings-xs) * -1);
16
16
  }
17
17
 
18
18
  .rebilly-instruments-confirmation-address-title {
@@ -21,20 +21,20 @@ export const confirmation = (theme) => `
21
21
  }
22
22
 
23
23
  .rebilly-instruments-confirmation-address-title .rebilly-instruments-link {
24
- margin-left: ${theme.space.s};
24
+ margin-left: var(--rebilly-spacings-s);
25
25
  }
26
26
 
27
27
  .rebilly-instruments-confirmation-address-actions {
28
- margin-top: ${theme.space.m};
28
+ margin-top: var(--rebilly-spacings-base);
29
29
  display: flex;
30
30
  }
31
31
 
32
32
  .rebilly-instruments-confirmation-address-actions :first-child {
33
- margin: 0 ${theme.space.xs} 0 0;
33
+ margin: 0 var(--rebilly-spacings-xs) 0 0;
34
34
  }
35
35
 
36
36
  .rebilly-instruments-confirmation-address-actions :last-child {
37
- margin: 0 0 0 ${theme.space.xs};
37
+ margin: 0 0 0 var(--rebilly-spacings-xs);
38
38
  }
39
39
 
40
40
  .rebilly-instruments-confirmation-payment-method {
@@ -42,18 +42,18 @@ export const confirmation = (theme) => `
42
42
  align-items: center;
43
43
  justify-content: space-between;
44
44
  height: 26px;
45
- margin: 0 0 ${theme.space.l};
45
+ margin: 0 0 var(--rebilly-spacings-l);
46
46
  }
47
47
 
48
48
  .rebilly-instruments-confirmation-payment-method figure {
49
- margin: 0 ${theme.space.xxs} 0 0;
49
+ margin: 0 var(--rebilly-spacings-2xs) 0 0;
50
50
  height: 26px;
51
51
  padding: 0;
52
52
  }
53
53
 
54
54
  .rebilly-instruments-confirmation-payment-method figure img {
55
55
  width: 42px;
56
- border-radius: ${theme.borderRadius};
56
+ border-radius: 4px;
57
57
  }
58
58
 
59
59
  .rebilly-instruments-confirmation-payment-method-brand,
@@ -63,14 +63,14 @@ export const confirmation = (theme) => `
63
63
  }
64
64
 
65
65
  .rebilly-instruments-confirmation-payment-method-brand {
66
- margin: 0 0 0 ${theme.space.s};
66
+ margin: 0 0 0 var(--rebilly-spacings-s);
67
67
  }
68
68
 
69
69
  .rebilly-instruments-confirmation-payment-method-last4 {
70
- margin: 0 ${theme.space.s};
70
+ margin: 0 var(--rebilly-spacings-s);
71
71
  }
72
72
 
73
73
  .rebilly-instruments-confirmation-payment-method-exp {
74
- color: ${theme.getComputed.color.mutedText};
74
+ color: var(--rebilly-colorMutedText);
75
75
  }
76
76
  `;
@@ -1,11 +1,11 @@
1
1
  // -----------------------------------------------------------------------------
2
2
  // This file contains all styles related to the selector view.
3
3
  // -----------------------------------------------------------------------------
4
- export const methodSelector = (theme) => `
4
+ export const methodSelector = () => `
5
5
  /**
6
6
  * Method selector
7
7
  */
8
8
  .rebilly-instruments-method-selector.has-express-compact {
9
- padding-top: ${theme.space.s};
9
+ padding-top: var(--rebilly-spacings-s);
10
10
  }
11
11
  `;
@@ -1,7 +1,7 @@
1
1
  // -----------------------------------------------------------------------------
2
2
  // This file contains all styles related to the modal view.
3
3
  // -----------------------------------------------------------------------------
4
- export const modal = (theme) => `
4
+ export const modal = () => `
5
5
  /**
6
6
  * Modal
7
7
  */
@@ -31,10 +31,10 @@ export const modal = (theme) => `
31
31
  transition: all .24s ease-in-out;
32
32
  position: relative;
33
33
  max-width: 800px;
34
- background: ${theme.color.background};
34
+ background: var(--rebilly-colorBackground);
35
35
  margin: 50px auto 20px;
36
36
  box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);
37
- border-radius: ${theme.borderRadius};
37
+ border-radius: 4px;
38
38
  transform: translateY(-50px);
39
39
  opacity: 0;
40
40
  }
@@ -53,9 +53,9 @@ export const modal = (theme) => `
53
53
  transition: all .15s;
54
54
  padding: 20px;
55
55
  overflow: hidden;
56
- background-color: ${theme.color.background};
56
+ background-color: var(--rebilly-colorBackground);
57
57
  text-align: center;
58
- border-radius: ${theme.borderRadius};
58
+ border-radius: 4px;
59
59
  }
60
60
 
61
61
  .rebilly-instruments-modal-content .rebilly-instruments-iframe {
@@ -74,7 +74,7 @@ export const modal = (theme) => `
74
74
  height: 30px;
75
75
  top: -40px;
76
76
  right: 0;
77
- fill: #ffffff;
77
+ fill: #FFF;
78
78
  cursor: pointer;
79
79
  }
80
80
 
@@ -1,7 +1,7 @@
1
1
  // -----------------------------------------------------------------------------
2
2
  // This file contains all styles related to the result view.
3
3
  // -----------------------------------------------------------------------------
4
- export const result = (theme) => `
4
+ export const result = () => `
5
5
  /**
6
6
  * Result
7
7
  */
@@ -12,16 +12,16 @@ export const result = (theme) => `
12
12
 
13
13
  .rebilly-instruments-results-icon {
14
14
  width: 160px;
15
- margin: 0 auto ${theme.space.m} auto;
15
+ margin: 0 auto var(--rebilly-spacings-base) auto;
16
16
  display: block;
17
17
  }
18
18
 
19
19
  .rebilly-instruments-results-icon g {
20
- stroke: ${theme.color.primary};
20
+ stroke: var(--rebilly-colorPrimary);
21
21
  }
22
22
 
23
23
  .rebilly-instruments-results-icon.is-error g {
24
- stroke: ${theme.color.errorText};
24
+ stroke: var(--rebilly-colorDanger);
25
25
  }
26
26
 
27
27
  .rebilly-instruments-results-icon path {
@@ -1,13 +1,13 @@
1
1
  // -----------------------------------------------------------------------------
2
2
  // This file contains all styles related to the summary view.
3
3
  // -----------------------------------------------------------------------------
4
- export const summary = (theme) => `
4
+ export const summary = () => `
5
5
  /**
6
6
  * Summary
7
7
  */
8
8
  .rebilly-instruments-summary-line-item {
9
- border-bottom: 1px solid ${theme.getComputed.color.mutedBorder};
10
- padding: ${theme.space.s} 0;
9
+ border-bottom: 1px solid var(--rebilly-colorMutedBorder);
10
+ padding: var(--rebilly-spacings-s) 0;
11
11
  display: flex;
12
12
  align-items: center;
13
13
  position: relative;
@@ -18,12 +18,12 @@ export const summary = (theme) => `
18
18
  }
19
19
 
20
20
  .rebilly-instruments-summary-line-item-figure {
21
- margin: 0 ${theme.space.s} 0 0;
21
+ margin: 0 var(--rebilly-spacings-s) 0 0;
22
22
  flex: 0 0 auto;
23
23
  width: 48px;
24
24
  height: 48px;
25
- border-radius: ${theme.borderRadius};
26
- border: 1px solid ${theme.getComputed.color.mutedBorder};
25
+ border-radius: var(--rebilly-borderRadius);
26
+ border: 1px solid var(--rebilly-colorMutedBorder);
27
27
  overflow: hidden;
28
28
  }
29
29
 
@@ -41,31 +41,31 @@ export const summary = (theme) => `
41
41
  }
42
42
 
43
43
  .rebilly-instruments-summary-line-item-synopsis-description {
44
- color: ${theme.getComputed.color.mutedText};
44
+ color: var(--rebilly-colorMutedText);
45
45
  margin: 0;
46
- font-size: 14px;
47
- line-height: 14px;
46
+ font-size: calc(var(--rebilly-fontSizeBase) * 0.875);
47
+ line-height: 1;
48
48
  }
49
49
 
50
50
  .rebilly-instruments-summary-line-item-price-breakdown {
51
51
  display: flex;
52
52
  justify-content: center;
53
53
  align-items: center;
54
- color: ${theme.getComputed.color.mutedText};
55
- margin: 0 0 0 ${theme.spaceS};
54
+ color: var(--rebilly-colorMutedText);
55
+ margin: 0 0 0 var(--rebilly-spacings-s);
56
56
  }
57
57
 
58
58
  .rebilly-instruments-summary-line-item-price-breakdown .rebilly-instruments-icon {
59
- fill: ${theme.getComputed.color.mutedText};
59
+ fill: var(--rebilly-colorMutedText);
60
60
  }
61
61
 
62
62
  .rebilly-instruments-summary-line-item-price-breakdown-unit-price {
63
- color: ${theme.color.text};
63
+ color: var(--rebilly-colorText);
64
64
  }
65
65
 
66
66
  .rebilly-instruments-summary-breakdown table {
67
67
  width: 100%;
68
- margin: ${theme.space.xs} 0;
68
+ margin: var(--rebilly-spacings-xs) 0;
69
69
  color: inherit;
70
70
  }
71
71
 
@@ -82,33 +82,37 @@ export const summary = (theme) => `
82
82
  }
83
83
 
84
84
  .rebilly-instruments-summary-breakdown table tr td:first-child {
85
- padding-right: ${theme.space.s};
85
+ padding-right: var(--rebilly-spacings-s);
86
86
  font-weight: 500;
87
87
  }
88
88
 
89
+ .rebilly-instruments-summary-breakdown table {
90
+ border-bottom: 1px solid var(--rebilly-colorMutedBorder);
91
+ padding-bottom: var(--rebilly-spacings-xs);
92
+ }
93
+
89
94
  .rebilly-instruments-summary-breakdown-total {
90
- padding-top: ${theme.space.xs};
95
+ padding-top: var(--rebilly-spacings-xs);
91
96
  display: flex;
92
- border-top: 1px solid ${theme.getComputed.color.mutedBorder};
93
97
  align-items: center;
94
98
  }
95
99
 
96
100
  .rebilly-instruments-summary-breakdown-total p {
97
- margin: ${theme.space.s} 0;
101
+ margin: var(--rebilly-spacings-s) 0;
98
102
  }
99
103
 
100
104
  .rebilly-instruments-summary-breakdown-total-amount {
101
105
  flex: 1 2 80%;
102
- font-size: 24px;
106
+ font-size: calc(var(--rebilly-fontSizeBase) * 1.5);
103
107
  font-weight: 500;
104
108
  text-align: right;
105
109
  font-weight: bold;
106
110
  }
107
111
 
108
112
  .rebilly-instruments-summary-breakdown-total-amount-currency {
109
- font-size: ${theme.typography.fontSize};
113
+ font-size: var(--rebilly-fontSizeBase);
110
114
  font-weight: normal;
111
- color: ${theme.getComputed.color.mutedText};
112
- margin-right: ${theme.space.s};
115
+ color: var(--rebilly-colorMutedText);
116
+ margin-right: var(--rebilly-spacings-s);
113
117
  }
114
118
  `;
@@ -5,146 +5,151 @@ exports[`Summary component should render the summary correctly 1`] = `
5
5
  class="rebilly-instruments-summary-line-items"
6
6
  >
7
7
 
8
-
8
+
9
9
  <div
10
10
  class="rebilly-instruments-summary-line-item"
11
11
  >
12
12
 
13
-
14
-
13
+
14
+
15
15
  <div
16
16
  class="rebilly-instruments-summary-line-item-synopsis"
17
17
  >
18
18
 
19
-
19
+
20
20
  <p
21
21
  class="rebilly-instruments-summary-line-item-synopsis-title"
22
- />
22
+ >
23
+ My Awesome Product
24
+ </p>
23
25
 
26
+
24
27
 
25
-
26
28
  <p
27
29
  class="rebilly-instruments-summary-line-item-synopsis-description"
28
30
  >
29
31
  My Awesome Product
30
32
  </p>
31
33
 
32
-
33
-
34
+
35
+
34
36
  </div>
35
37
 
36
-
38
+
37
39
  <div
38
40
  class="rebilly-instruments-summary-line-item-price-breakdown"
39
41
  >
40
42
 
41
-
43
+
42
44
  <p
43
45
  class="rebilly-instruments-summary-line-item-price-breakdown-quantity"
44
46
  >
45
47
  1
46
48
  </p>
47
49
 
48
-
50
+
49
51
  <svg
50
52
  class="rebilly-instruments-icon"
51
53
  viewBox="0 0 24 24"
52
54
  xmlns="http://www.w3.org/2000/svg"
53
55
  >
54
56
 
55
-
57
+
56
58
  <path
57
59
  d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z"
58
60
  fill-rule="nonzero"
59
61
  />
60
62
 
61
-
63
+
62
64
  </svg>
63
65
 
64
-
66
+
65
67
  <p
66
68
  class="rebilly-instruments-summary-line-item-price-breakdown-unit-price"
67
69
  >
68
70
  $30.00
69
71
  </p>
70
72
 
71
-
73
+
72
74
  </div>
73
75
 
74
-
76
+
75
77
  </div>
76
78
 
79
+
80
+
77
81
 
78
-
79
82
  <div
80
83
  class="rebilly-instruments-summary-line-item"
81
84
  >
82
85
 
83
-
84
-
86
+
87
+
85
88
  <div
86
89
  class="rebilly-instruments-summary-line-item-synopsis"
87
90
  >
88
91
 
89
-
92
+
90
93
  <p
91
94
  class="rebilly-instruments-summary-line-item-synopsis-title"
92
- />
95
+ >
96
+ My Awesome T-Shirt
97
+ </p>
93
98
 
99
+
94
100
 
95
-
96
101
  <p
97
102
  class="rebilly-instruments-summary-line-item-synopsis-description"
98
103
  >
99
104
  Awesome T-Shirt
100
105
  </p>
101
106
 
102
-
103
-
107
+
108
+
104
109
  </div>
105
110
 
106
-
111
+
107
112
  <div
108
113
  class="rebilly-instruments-summary-line-item-price-breakdown"
109
114
  >
110
115
 
111
-
116
+
112
117
  <p
113
118
  class="rebilly-instruments-summary-line-item-price-breakdown-quantity"
114
119
  >
115
120
  2
116
121
  </p>
117
122
 
118
-
123
+
119
124
  <svg
120
125
  class="rebilly-instruments-icon"
121
126
  viewBox="0 0 24 24"
122
127
  xmlns="http://www.w3.org/2000/svg"
123
128
  >
124
129
 
125
-
130
+
126
131
  <path
127
132
  d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z"
128
133
  fill-rule="nonzero"
129
134
  />
130
135
 
131
-
136
+
132
137
  </svg>
133
138
 
134
-
139
+
135
140
  <p
136
141
  class="rebilly-instruments-summary-line-item-price-breakdown-unit-price"
137
142
  >
138
143
  $20.00
139
144
  </p>
140
145
 
141
-
146
+
142
147
  </div>
143
148
 
144
-
149
+
145
150
  </div>
146
151
 
147
-
152
+
148
153
  </div>
149
154
  `;
150
155
 
@@ -152,137 +157,90 @@ exports[`Summary component should render the summary correctly 2`] = `
152
157
  <div
153
158
  class="rebilly-instruments-summary-breakdown"
154
159
  >
155
-
156
-
157
160
  <table>
158
161
 
159
-
162
+
160
163
  <colgroup>
161
164
 
162
-
165
+
163
166
  <col />
164
167
 
165
-
168
+
166
169
  <col />
167
170
 
168
-
171
+
169
172
  </colgroup>
170
173
 
171
174
 
172
- <tbody>
173
- <tr
174
- class="rebilly-instruments-summary-breakdown-sub-total"
175
- >
176
-
177
-
178
- <td
179
- data-rebilly-i18n="summary.subTotal"
180
- >
181
- Sub Total
182
- </td>
183
-
184
-
185
- <td>
186
- $70.00
187
- </td>
188
-
189
-
190
- </tr>
191
-
175
+ <tr
176
+ class="rebilly-instruments-summary-breakdown-sub-total"
177
+ >
192
178
 
193
- <tr
194
- class="rebilly-instruments-summary-breakdown-discounts"
195
- >
196
179
 
197
-
198
- <td
199
- data-rebilly-i18n="summary.discounts"
200
- >
201
- Discounts
202
- </td>
203
-
204
-
205
- <td>
206
- $0.00
207
- </td>
208
-
209
-
210
- </tr>
211
-
212
-
213
- <tr
214
- class="rebilly-instruments-summary-breakdown-taxes"
180
+ <td
181
+ data-rebilly-i18n="summary.subTotal"
215
182
  >
183
+ Sub Total
184
+ </td>
185
+
216
186
 
217
-
218
- <td
219
- data-rebilly-i18n="summary.taxes"
220
- >
221
- Taxes
222
- </td>
223
-
224
-
225
- <td>
226
- $0.00
227
- </td>
228
-
187
+ <td>
188
+ $70.00
189
+ </td>
229
190
 
230
- </tr>
231
191
 
192
+ </tr>
193
+ <tr
194
+ class="rebilly-instruments-summary-breakdown-taxes"
195
+ >
232
196
 
233
- <tr
234
- class="rebilly-instruments-summary-breakdown-taxes"
235
- >
236
-
237
197
 
238
- <td
239
- data-rebilly-i18n="summary.shipping"
240
- >
241
- Shipping
242
- </td>
243
-
244
-
245
- <td>
246
- $0.00
247
- </td>
198
+ <td
199
+ data-rebilly-i18n="summary.taxes"
200
+ >
201
+ Taxes
202
+ </td>
203
+
248
204
 
205
+ <td>
206
+ $0.00
207
+ </td>
249
208
 
250
- </tr>
251
209
 
252
-
253
- </tbody>
210
+ </tr>
254
211
  </table>
255
-
256
-
257
212
  <div
258
213
  class="rebilly-instruments-summary-breakdown-total"
259
214
  >
260
215
 
261
-
216
+
262
217
  <p
263
218
  data-rebilly-i18n="summary.total"
264
219
  >
265
220
  Total
266
221
  </p>
267
222
 
268
-
223
+
269
224
  <p
270
225
  class="rebilly-instruments-summary-breakdown-total-amount"
271
226
  >
272
227
 
273
-
228
+
274
229
  <span
275
230
  class="rebilly-instruments-summary-breakdown-total-amount-currency"
276
231
  >
232
+
277
233
  USD
234
+
278
235
  </span>
236
+
279
237
  $70.00
238
+
239
+ </p>
240
+ <p>
280
241
 
242
+
281
243
  </p>
282
-
283
-
284
244
  </div>
285
-
286
-
287
245
  </div>
288
246
  `;
@@ -2,6 +2,7 @@ import Postmate from 'popostmate';
2
2
 
3
3
  export default class BaseIframe {
4
4
  constructor({
5
+ state = {},
5
6
  name = '',
6
7
  url = '',
7
8
  model = {},
@@ -13,6 +14,7 @@ export default class BaseIframe {
13
14
  classListArray.push('rebilly-instruments-iframe');
14
15
  }
15
16
 
17
+ this.state = state;
16
18
  this.container = container;
17
19
  this.classListArray = classListArray;
18
20
  this.name = name;