@automattic/newspack-blocks 4.18.0 → 4.19.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.
@@ -180,16 +180,16 @@ export function onCheckoutPlaceOrderStart( container, callback ) {
180
180
  }
181
181
 
182
182
  /**
183
- * Run a callback when the checkout place order succeeds.
183
+ * Run a callback when the checkout place order is processing.
184
184
  *
185
185
  * @param {Object} container The container element inside the iframe document.
186
- * @param {Function} callback The callback to execute when the checkout place order succeeds.
186
+ * @param {Function} callback The callback to execute when the checkout place order is processing.
187
187
  */
188
- export function onCheckoutPlaceOrderSuccess( container, callback ) {
189
- if ( container.checkoutPlaceOrderSuccess ) {
188
+ export function onCheckoutPlaceOrderProcessing( container, callback ) {
189
+ if ( container.checkoutPlaceOrderProcessing ) {
190
190
  callback();
191
191
  } else {
192
- container.addEventListener( 'checkout-place-order-success', callback );
192
+ container.addEventListener( 'checkout-place-order-processing', callback );
193
193
  }
194
194
  }
195
195
 
@@ -207,6 +207,20 @@ export function onCheckoutPlaceOrderError( container, callback ) {
207
207
  }
208
208
  }
209
209
 
210
+ /**
211
+ * Run a callback when the checkout place order fails in an unrecoverable state.
212
+ *
213
+ * @param {Object} container The container element inside the iframe document.
214
+ * @param {Function} callback The callback to execute when the checkout place order fails in an unrecoverable state.
215
+ */
216
+ export function onCheckoutPlaceOrderCriticalError( container, callback ) {
217
+ if ( container.checkoutPlaceOrderCriticalError ) {
218
+ callback();
219
+ } else {
220
+ container.addEventListener( 'checkout-place-order-critical-error', callback );
221
+ }
222
+ }
223
+
210
224
  /**
211
225
  * Run a callback when the checkout is complete.
212
226
  *
@@ -3,7 +3,7 @@
3
3
  'name' => 'automattic/newspack-blocks',
4
4
  'pretty_version' => 'dev-trunk',
5
5
  'version' => 'dev-trunk',
6
- 'reference' => 'fb8de312e707cf47e24d1c3d7b075988fc885be3',
6
+ 'reference' => '74f1b0a1b2d535217ff0cdb7b695724c1440fdbc',
7
7
  'type' => 'wordpress-plugin',
8
8
  'install_path' => __DIR__ . '/../../',
9
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
13
  'automattic/newspack-blocks' => array(
14
14
  'pretty_version' => 'dev-trunk',
15
15
  'version' => 'dev-trunk',
16
- 'reference' => 'fb8de312e707cf47e24d1c3d7b075988fc885be3',
16
+ 'reference' => '74f1b0a1b2d535217ff0cdb7b695724c1440fdbc',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),