@pelcro/react-pelcro-js 3.6.0-beta.21 → 3.6.0-beta.23

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.
package/dist/index.cjs.js CHANGED
@@ -15224,6 +15224,14 @@ const PaymentMethodContainerWithoutStripe = ({
15224
15224
  if (result.error) {
15225
15225
  // Inform the user if there was an error
15226
15226
  onFailure(result.error);
15227
+ dispatch({
15228
+ type: DISABLE_SUBMIT,
15229
+ payload: false
15230
+ });
15231
+ dispatch({
15232
+ type: LOADING,
15233
+ payload: false
15234
+ });
15227
15235
  return dispatch({
15228
15236
  type: SHOW_ALERT,
15229
15237
  payload: {
@@ -15241,44 +15249,54 @@ const PaymentMethodContainerWithoutStripe = ({
15241
15249
  tap_token: result.id,
15242
15250
  redirect_url: `${window.Pelcro.environment.domain}/webhook/tap/callback/3dsecure?auth_token=${window.Pelcro.user.read().auth_token}`
15243
15251
  }, (err, res) => {
15244
- toggleAuthenticationPendingView(true, res);
15245
-
15246
- const listenFor3DSecureCompletionMessage = () => {
15247
- const retrieveSourceInfoFromIframe = event => {
15248
- const {
15249
- data
15250
- } = event;
15251
-
15252
- if (data.message === "3DS-authentication-complete") {
15253
- const tapID = data.tapID;
15254
- toggleAuthenticationPendingView(false);
15255
- window.removeEventListener("message", retrieveSourceInfoFromIframe);
15256
- handleTapPayment(tapID);
15252
+ if (err) {
15253
+ // Inform the user if there was an error
15254
+ onFailure(result.error);
15255
+ dispatch({
15256
+ type: DISABLE_SUBMIT,
15257
+ payload: false
15258
+ });
15259
+ dispatch({
15260
+ type: LOADING,
15261
+ payload: false
15262
+ });
15263
+ return dispatch({
15264
+ type: SHOW_ALERT,
15265
+ payload: {
15266
+ type: "error",
15267
+ content: getErrorMessages(result.error)
15257
15268
  }
15258
- }; // listen to injected iframe for authentication complete message
15259
-
15260
-
15261
- window.addEventListener("message", retrieveSourceInfoFromIframe);
15262
- };
15269
+ });
15270
+ } else {
15271
+ toggleAuthenticationPendingView(true, res);
15272
+
15273
+ const listenFor3DSecureCompletionMessage = () => {
15274
+ const retrieveSourceInfoFromIframe = event => {
15275
+ const {
15276
+ data
15277
+ } = event;
15278
+
15279
+ if (data.message === "3DS-authentication-complete") {
15280
+ const tapID = data.tapID;
15281
+ toggleAuthenticationPendingView(false);
15282
+ window.removeEventListener("message", retrieveSourceInfoFromIframe);
15283
+ dispatch({
15284
+ type: SHOW_ALERT,
15285
+ payload: {
15286
+ type: "error",
15287
+ content: null
15288
+ }
15289
+ });
15290
+ handleTapPayment(tapID);
15291
+ }
15292
+ }; // listen to injected iframe for authentication complete message
15293
+
15294
+
15295
+ window.addEventListener("message", retrieveSourceInfoFromIframe);
15296
+ };
15263
15297
 
15264
- listenFor3DSecureCompletionMessage(); // if (err) {
15265
- // onFailure(err);
15266
- // return dispatch({
15267
- // type: SHOW_ALERT,
15268
- // payload: {
15269
- // type: "error",
15270
- // content: getErrorMessages(err)
15271
- // }
15272
- // });
15273
- // }
15274
- // dispatch({
15275
- // type: SHOW_ALERT,
15276
- // payload: {
15277
- // type: "success",
15278
- // content: t("messages.sourceUpdated")
15279
- // }
15280
- // });
15281
- // onSuccess(res);
15298
+ listenFor3DSecureCompletionMessage();
15299
+ }
15282
15300
  });
15283
15301
  }
15284
15302
  });
package/dist/index.esm.js CHANGED
@@ -15194,6 +15194,14 @@ const PaymentMethodContainerWithoutStripe = ({
15194
15194
  if (result.error) {
15195
15195
  // Inform the user if there was an error
15196
15196
  onFailure(result.error);
15197
+ dispatch({
15198
+ type: DISABLE_SUBMIT,
15199
+ payload: false
15200
+ });
15201
+ dispatch({
15202
+ type: LOADING,
15203
+ payload: false
15204
+ });
15197
15205
  return dispatch({
15198
15206
  type: SHOW_ALERT,
15199
15207
  payload: {
@@ -15211,44 +15219,54 @@ const PaymentMethodContainerWithoutStripe = ({
15211
15219
  tap_token: result.id,
15212
15220
  redirect_url: `${window.Pelcro.environment.domain}/webhook/tap/callback/3dsecure?auth_token=${window.Pelcro.user.read().auth_token}`
15213
15221
  }, (err, res) => {
15214
- toggleAuthenticationPendingView(true, res);
15215
-
15216
- const listenFor3DSecureCompletionMessage = () => {
15217
- const retrieveSourceInfoFromIframe = event => {
15218
- const {
15219
- data
15220
- } = event;
15221
-
15222
- if (data.message === "3DS-authentication-complete") {
15223
- const tapID = data.tapID;
15224
- toggleAuthenticationPendingView(false);
15225
- window.removeEventListener("message", retrieveSourceInfoFromIframe);
15226
- handleTapPayment(tapID);
15222
+ if (err) {
15223
+ // Inform the user if there was an error
15224
+ onFailure(result.error);
15225
+ dispatch({
15226
+ type: DISABLE_SUBMIT,
15227
+ payload: false
15228
+ });
15229
+ dispatch({
15230
+ type: LOADING,
15231
+ payload: false
15232
+ });
15233
+ return dispatch({
15234
+ type: SHOW_ALERT,
15235
+ payload: {
15236
+ type: "error",
15237
+ content: getErrorMessages(result.error)
15227
15238
  }
15228
- }; // listen to injected iframe for authentication complete message
15229
-
15230
-
15231
- window.addEventListener("message", retrieveSourceInfoFromIframe);
15232
- };
15239
+ });
15240
+ } else {
15241
+ toggleAuthenticationPendingView(true, res);
15242
+
15243
+ const listenFor3DSecureCompletionMessage = () => {
15244
+ const retrieveSourceInfoFromIframe = event => {
15245
+ const {
15246
+ data
15247
+ } = event;
15248
+
15249
+ if (data.message === "3DS-authentication-complete") {
15250
+ const tapID = data.tapID;
15251
+ toggleAuthenticationPendingView(false);
15252
+ window.removeEventListener("message", retrieveSourceInfoFromIframe);
15253
+ dispatch({
15254
+ type: SHOW_ALERT,
15255
+ payload: {
15256
+ type: "error",
15257
+ content: null
15258
+ }
15259
+ });
15260
+ handleTapPayment(tapID);
15261
+ }
15262
+ }; // listen to injected iframe for authentication complete message
15263
+
15264
+
15265
+ window.addEventListener("message", retrieveSourceInfoFromIframe);
15266
+ };
15233
15267
 
15234
- listenFor3DSecureCompletionMessage(); // if (err) {
15235
- // onFailure(err);
15236
- // return dispatch({
15237
- // type: SHOW_ALERT,
15238
- // payload: {
15239
- // type: "error",
15240
- // content: getErrorMessages(err)
15241
- // }
15242
- // });
15243
- // }
15244
- // dispatch({
15245
- // type: SHOW_ALERT,
15246
- // payload: {
15247
- // type: "success",
15248
- // content: t("messages.sourceUpdated")
15249
- // }
15250
- // });
15251
- // onSuccess(res);
15268
+ listenFor3DSecureCompletionMessage();
15269
+ }
15252
15270
  });
15253
15271
  }
15254
15272
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.6.0-beta.21",
4
+ "version": "3.6.0-beta.23",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",